text: thoughts and actions live in your app.from langchain.llms import OpenAIfrom langchain.agents import AgentType, initialize_agent, load_toolsfrom langchain.callbacks import StreamlitCallbackHandlerimport streamlit as stllm = OpenAI(temperature=0, streaming=True)tools = load_tools(["ddg-search"])agent = initialize_agent(    tools, llm, agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION, verbose=True)if prompt := st.chat_input():    st.chat_message("user").write(prompt)    with st.chat_message("assistant"):        st_callback = StreamlitCallbackHandler(st.container())        response = agent.run(prompt, callbacks=[st_callback])        st.write(response)Note: You will need to set OPENAI_API_KEY for the above app code to run successfully.
  The easiest way to do this is via Streamlit secrets.toml,
  or any other local ENV management tool.Additional scenariosâ€‹Currently StreamlitCallbackHandler is geared towards use with a LangChain Agent Executor. Support for additional agent types,
  use directly with Chains, etc will be added in the future.PreviousPromptLayerNextChat modelsInstallation and SetupDisplay thoughts and actionsScenario 1: Using an Agent with ToolsAdditional scenariosCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright Â© 2023 LangChain, Inc.