- langgraph_agent_toolkit.streamlit_app.create_welcome_message(agent)[source][source]
Create a welcome message based on the current agent.
- Parameters:
agent (str)
- Return type:
- async langgraph_agent_toolkit.streamlit_app.draw_messages(messages_agen, is_new=False)[source][source]
Draws a set of chat messages - either replaying existing messages or streaming new ones.
This function has additional logic to handle streaming tokens and tool calls. - Use a placeholder container to render streaming tokens as they arrive. - Use a status container to render tool calls. Track the tool inputs and outputs
and update the status container accordingly.
The function also needs to track the last message container in session state since later messages can draw to the same container. This is also used for drawing the feedback widget in the latest chat message.
- Parameters:
messages_agen (AsyncGenerator[ChatMessage | str, None]) – An async iterator over messages to draw.
is_new (bool) – Whether the messages are new or not.
- Return type:
None