Spaces:
Sleeping
Sleeping
aasherkamal216
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ if "messages" not in st.session_state:
|
|
30 |
|
31 |
for message in st.session_state.messages:
|
32 |
st.chat_message(message['role']).write(message['content'])
|
33 |
-
|
34 |
if api_key:
|
35 |
if prompt := st.chat_input("What is Generative AI?"):
|
36 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
@@ -40,7 +40,7 @@ if api_key:
|
|
40 |
tools = [wiki_tool, arxiv_tool, search]
|
41 |
|
42 |
search_agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
|
43 |
-
|
44 |
with st.chat_message("assistant"):
|
45 |
st_callback = StreamlitCallbackHandler(st.container(), expand_new_thoughts=True)
|
46 |
response = search_agent.run(st.session_state.messages, callbacks=[st_callback])
|
|
|
30 |
|
31 |
for message in st.session_state.messages:
|
32 |
st.chat_message(message['role']).write(message['content'])
|
33 |
+
|
34 |
if api_key:
|
35 |
if prompt := st.chat_input("What is Generative AI?"):
|
36 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
|
|
40 |
tools = [wiki_tool, arxiv_tool, search]
|
41 |
|
42 |
search_agent = initialize_agent(tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
|
43 |
+
agent_executor_kwargs={"handle_parsing_errors": True})
|
44 |
with st.chat_message("assistant"):
|
45 |
st_callback = StreamlitCallbackHandler(st.container(), expand_new_thoughts=True)
|
46 |
response = search_agent.run(st.session_state.messages, callbacks=[st_callback])
|