I’m creating a SQL agent using
from langchain.agents import create_agent
from langchain_community.agent_toolkits import SQLDatabaseToolkit
from langchain_community.callbacks import StreamlitCallbackHandler
from langchain_community.utilities import SQLDatabase
from langchain_groq import ChatGroq
i converted the DB into SQLDatabaseToolkit and passed it to the create_agent.
The problem I’m facing is, that I the model thinking and reasoning is not visible in streamlit UI, I tried many times but it’s not working instead of showing the “thinking” it is just blank and at last it provides the output in end. I tried with llama, GPToss and qwen models
code snippet:
with st.chat_message("ai"):
st_callback = StreamlitCallbackHandler(st.container())
# response = agent.invoke({
# "messages": [{"role": "user", "content": user_query}]
# }, config={"callbacks": [st_callback]})
for event in agent.stream(
{"messages": [{"role": "user", "content": user_query}]},
config={"callbacks": [st_callback]},
stream_mode="messages"
):
pass
