Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -59,8 +59,8 @@ if prompt := st.chat_input(placeholder="Who won the Women's U.S. Open in 2018?")
|
|
| 59 |
llm = ChatOpenAI(model_name="gpt-3.5-turbo", openai_api_key=openai_api_key, streaming=True)
|
| 60 |
search = DuckDuckGoSearchRun(name="Search")
|
| 61 |
search_agent = initialize_agent([search], llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, handle_parsing_errors=True)
|
| 62 |
-
|
| 63 |
st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=False)
|
| 64 |
response = search_agent.run(st.session_state.messages, callbacks=[st_cb])
|
| 65 |
-
st.session_state.messages.append({"role": "assistant
|
| 66 |
-
|
|
|
|
| 59 |
llm = ChatOpenAI(model_name="gpt-3.5-turbo", openai_api_key=openai_api_key, streaming=True)
|
| 60 |
search = DuckDuckGoSearchRun(name="Search")
|
| 61 |
search_agent = initialize_agent([search], llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, handle_parsing_errors=True)
|
| 62 |
+
with st.chat_message("assistant"):
|
| 63 |
st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=False)
|
| 64 |
response = search_agent.run(st.session_state.messages, callbacks=[st_cb])
|
| 65 |
+
st.session_state.messages.append({"role": "assistant", "content": response})
|
| 66 |
+
st.write(response)
|