Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,9 +57,10 @@ if prompt := st.chat_input(placeholder="Who won the Women's U.S. Open in 2018?")
|
|
| 57 |
st.stop()
|
| 58 |
|
| 59 |
llm = ChatOpenAI(model_name="gpt-3.5-turbo", openai_api_key=openai_api_key, streaming=True)
|
| 60 |
-
|
| 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", "content": response})
|
|
|
|
| 57 |
st.stop()
|
| 58 |
|
| 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 |
+
with st.chat_message("assistant"):
|
| 64 |
st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=False)
|
| 65 |
response = search_agent.run(st.session_state.messages, callbacks=[st_cb])
|
| 66 |
st.session_state.messages.append({"role": "assistant", "content": response})
|