Find answers from the community

Updated last year

Hi I need help please

At a glance
Hi , I need help please,
I just create a agent from OpenAIAgent.from_tools(:
agent = OpenAIAgent.from_tools(
[query_plan_tool],
max_function_calls=10,
llm=OpenAI(temperature=0, model="gpt-4-0613"),
verbose=True,
)
I want to use Streamlit to use this agent for chat. ST use chat_engine and I dont know how to use it with agent.
st.session_state.chat_engine =

Thanks
W
i
2 comments
You can put the agent into streamlit session like this

Plain Text
# Store the agent in Streamlit session like this
st.session_state['agent'] = agent


# Chat with the agent directly like
print(st.session_state.agent.chat("Hi")
Thanks, so much, I will try with your code. Really thanks
Add a reply
Sign up and join the conversation on Discord