Message helpers for the Streamlit UI: welcome messages, feedback, and multimodal content blocks.

langgraph_agent_toolkit.ui.utils.message.create_welcome_message(agent)[source][source]

Create a welcome message based on the current agent.

Parameters:

agent (str)

Return type:

ChatMessage

langgraph_agent_toolkit.ui.utils.message.file_to_content_block(file)[source][source]

Encode an uploaded Streamlit file as a LangChain multimodal content block (base64).

Return type:

dict

langgraph_agent_toolkit.ui.utils.message.build_chat_message(text, files)[source][source]

Return plain text, or a list of content blocks when files are attached.

Parameters:
Return type:

str | list[dict]

langgraph_agent_toolkit.ui.utils.message.render_human_message(content)[source][source]

Render a user message that may be plain text or a list of multimodal content blocks.

Parameters:

content (str | list)

Return type:

None

async langgraph_agent_toolkit.ui.utils.message.handle_feedback()[source][source]

Draw a feedback widget and record feedback from the user.

Return type:

None