Artin2009 commited on
Commit
f36e448
β€’
1 Parent(s): e01d4f8

Update chain_app.py

Browse files
Files changed (1) hide show
  1. chain_app.py +8 -6
chain_app.py CHANGED
@@ -1908,17 +1908,14 @@ async def on_chat_start():
1908
  async def main(message: cl.Message):
1909
  chat_profile = cl.user_session.get("chat_profile")
1910
  res = await cl.AskActionMessage(
1911
- content="Pick an action!",
1912
  actions=[
1913
- cl.Action(name="continue", value="continue", label="βœ… Continue"),
1914
- cl.Action(name="cancel", value="cancel", label="❌ Cancel"),
1915
  ],
1916
  ).send()
1917
 
1918
  if res and res.get("value") == "continue":
1919
- await cl.Message(
1920
- content="Continue!",
1921
- ).send()
1922
  if chat_profile == 'neural-brain-AI':
1923
  completion = openai_client.chat.completions.create(
1924
  model="ft:gpt-3.5-turbo-1106:nb:aria1:9UWDrLJK",
@@ -2547,6 +2544,11 @@ async def main(message: cl.Message):
2547
  if event.event_type == 'text-generation':
2548
  complete_content += event.text
2549
  await cl.Message(content=complete_content).send()
 
 
 
 
 
2550
 
2551
  @cl.on_settings_update
2552
  async def setup_agent(settings):
 
1908
  async def main(message: cl.Message):
1909
  chat_profile = cl.user_session.get("chat_profile")
1910
  res = await cl.AskActionMessage(
1911
+ content="Is that message correct and accurate ? check it and choose an option:",
1912
  actions=[
1913
+ cl.Action(name="Yes", value="continue", label="βœ… Continue"),
1914
+ cl.Action(name="No", value="cancel", label="❌ Cancel"),
1915
  ],
1916
  ).send()
1917
 
1918
  if res and res.get("value") == "continue":
 
 
 
1919
  if chat_profile == 'neural-brain-AI':
1920
  completion = openai_client.chat.completions.create(
1921
  model="ft:gpt-3.5-turbo-1106:nb:aria1:9UWDrLJK",
 
2544
  if event.event_type == 'text-generation':
2545
  complete_content += event.text
2546
  await cl.Message(content=complete_content).send()
2547
+ else:
2548
+ await cl.Message(
2549
+ content="Try Sending your message again. or edit it.",
2550
+ ).send()
2551
+
2552
 
2553
  @cl.on_settings_update
2554
  async def setup_agent(settings):