Spaces:
Running
Running
Chae
commited on
Commit
·
a187d8f
1
Parent(s):
86f15b3
fix code font
Browse files
chat.py
CHANGED
|
@@ -27,9 +27,6 @@ if "chat_history" not in st.session_state:
|
|
| 27 |
for message in st.session_state.chat_history:
|
| 28 |
with st.chat_message(message["role"]):
|
| 29 |
st.markdown(message["content"])
|
| 30 |
-
# if "reasoning" in message:
|
| 31 |
-
# with st.expander("Show reasoning"):
|
| 32 |
-
# st.markdown(message["reasoning"])
|
| 33 |
|
| 34 |
if prompt := st.chat_input("Send a message"):
|
| 35 |
# add message to chat history
|
|
@@ -55,19 +52,10 @@ if prompt := st.chat_input("Send a message"):
|
|
| 55 |
stream=False,
|
| 56 |
)
|
| 57 |
|
| 58 |
-
######## debug #########
|
| 59 |
-
# print("=== RAW RESPONSE ===")
|
| 60 |
-
# print(json.dumps(response.__dict__, indent=2, default=str))
|
| 61 |
-
|
| 62 |
# show the response
|
| 63 |
reply = response.choices[0].message["content"]
|
| 64 |
st.markdown(reply)
|
| 65 |
# print(reply)
|
| 66 |
-
|
| 67 |
-
# reasoning = getattr(response.choices[0], "reasoning", None)
|
| 68 |
-
# if reasoning:
|
| 69 |
-
# with st.expander("Show reasoning"):
|
| 70 |
-
# st.markdown(reasoning)
|
| 71 |
|
| 72 |
# Add assistant response to chat history
|
| 73 |
st.session_state.chat_history.append(
|
|
|
|
| 27 |
for message in st.session_state.chat_history:
|
| 28 |
with st.chat_message(message["role"]):
|
| 29 |
st.markdown(message["content"])
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
if prompt := st.chat_input("Send a message"):
|
| 32 |
# add message to chat history
|
|
|
|
| 52 |
stream=False,
|
| 53 |
)
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
# show the response
|
| 56 |
reply = response.choices[0].message["content"]
|
| 57 |
st.markdown(reply)
|
| 58 |
# print(reply)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
# Add assistant response to chat history
|
| 61 |
st.session_state.chat_history.append(
|