langchain_community.callbacks.streamlit.streamlit_callback_handler
.LLMThoughtLabeler¶
- class langchain_community.callbacks.streamlit.streamlit_callback_handler.LLMThoughtLabeler[source]¶
Generates markdown labels for LLMThought containers. Pass a custom subclass of this to StreamlitCallbackHandler to override its default labeling logic.
Methods
__init__
()Return the markdown label for the agent's final thought - the "Now I have the answer" thought, that doesn't involve a tool.
Return a markdown label for the special 'history' container that contains overflow thoughts.
Return the markdown label for a new LLMThought that doesn't have an associated tool yet.
get_tool_label
(tool, is_complete)Return the label for an LLMThought that has an associated tool.
- __init__()¶
- get_final_agent_thought_label() str [source]¶
Return the markdown label for the agentâs final thought - the âNow I have the answerâ thought, that doesnât involve a tool.
- get_history_label() str [source]¶
Return a markdown label for the special âhistoryâ container that contains overflow thoughts.
- get_initial_label() str [source]¶
Return the markdown label for a new LLMThought that doesnât have an associated tool yet.
- get_tool_label(tool: ToolRecord, is_complete: bool) str [source]¶
Return the label for an LLMThought that has an associated tool.
- Parameters
tool â The toolâs ToolRecord
is_complete â True if the thought is complete; False if the thought is still receiving input.
- Return type
The markdown label for the thoughtâs container.