Chris Alexiuk
commited on
Commit
·
749b6b4
1
Parent(s):
a120fd1
Update app.py
Browse files
app.py
CHANGED
@@ -31,9 +31,12 @@ def start_chat():
|
|
31 |
@cl.on_message # marks a function that should be run each time the chatbot receives a message from a user
|
32 |
async def main(message: str):
|
33 |
message_history = cl.user_session.get("message_history")
|
|
|
|
|
|
|
34 |
message_history.append({"role": "user", "content": message + " Think through your response step by step."})
|
35 |
|
36 |
-
msg = cl.Message(content="")
|
37 |
|
38 |
async for stream_resp in await openai.ChatCompletion.acreate(
|
39 |
model=model_name, messages=message_history, stream=True, **settings
|
|
|
31 |
@cl.on_message # marks a function that should be run each time the chatbot receives a message from a user
|
32 |
async def main(message: str):
|
33 |
message_history = cl.user_session.get("message_history")
|
34 |
+
|
35 |
+
prompt = message + " Think through your response step by step."
|
36 |
+
|
37 |
message_history.append({"role": "user", "content": message + " Think through your response step by step."})
|
38 |
|
39 |
+
msg = cl.Message(content="", prompt=prompt)
|
40 |
|
41 |
async for stream_resp in await openai.ChatCompletion.acreate(
|
42 |
model=model_name, messages=message_history, stream=True, **settings
|