GianJSX commited on
Commit
da203a4
1 Parent(s): c14bb0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -83,6 +83,7 @@ def start_chat():
83
  cl.user_session.set("image_history", [{"role": "system", "content": "You are a helpful assistant."}])
84
 
85
  @cl.on_message
 
86
  async def on_message(msg: cl.Message):
87
  message_history = cl.user_session.get("message_history")
88
  image_history = cl.user_session.get("image_history")
@@ -104,3 +105,5 @@ async def on_message(msg: cl.Message):
104
  await process_stream(stream, msg=stream_msg)
105
  image_history.append({"role": "system", "content": stream_msg.content})
106
  message_history.append({"role": "system", "content": stream_msg.content})
 
 
 
83
  cl.user_session.set("image_history", [{"role": "system", "content": "You are a helpful assistant."}])
84
 
85
  @cl.on_message
86
+ @traceable(run_type="chain", name="gpt 4 turbo")
87
  async def on_message(msg: cl.Message):
88
  message_history = cl.user_session.get("message_history")
89
  image_history = cl.user_session.get("image_history")
 
105
  await process_stream(stream, msg=stream_msg)
106
  image_history.append({"role": "system", "content": stream_msg.content})
107
  message_history.append({"role": "system", "content": stream_msg.content})
108
+
109
+ return stream_msg.content