We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc32e9f commit 7ebac32Copy full SHA for 7ebac32
pages/5_🛢_chat_with_sql_db.py
@@ -67,7 +67,7 @@ def main(self):
67
db_uri = 'USE_SAMPLE_DB'
68
69
if not db_uri:
70
- st.error("Please enter database URI to connect to continue!")
+ st.error("Please enter database URI to continue!")
71
st.stop()
72
73
db = self.setup_db(db_uri)
@@ -81,7 +81,11 @@ def main(self):
81
82
with st.chat_message("assistant"):
83
st_cb = StreamlitCallbackHandler(st.container())
84
- response = agent.run(user_query, callbacks=[st_cb])
+ result = agent.invoke(
85
+ {"input": user_query},
86
+ {"callbacks": [st_cb]}
87
+ )
88
+ response = result["output"]
89
st.session_state.messages.append({"role": "assistant", "content": response})
90
st.write(response)
91
0 commit comments