Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|