langchain.callbacks.streamlit.streamlit_callback_handler.LLMThought¶
class langchain.callbacks.streamlit.streamlit_callback_handler.LLMThought(parent_container: DeltaGenerator, labeler: LLMThoughtLabeler, expanded: bool, collapse_on_complete: bool)[source]¶
A thought in the LLM’s thought stream.
Initialize the LLMThought.
Parameters
parent_container – The container we’re writing into.
labeler – The labeler to use for this thought.
expanded – Whether the thought should be expanded by default.
collapse_on_complete – Whether the thought should be collapsed.
Attributes
container
The container we're writing into.
last_tool
The last tool executed by this thought
Methods
__init__(parent_container, labeler, ...)
Initialize the LLMThought.
clear()
Remove the thought from the screen.
complete([final_label])
Finish the thought.
on_agent_action(action[, color])
on_llm_end(response, **kwargs)
on_llm_error(error, **kwargs)
on_llm_new_token(token, **kwargs)
on_llm_start(serialized, prompts)
on_tool_end(output[, color, ...])
on_tool_error(error, **kwargs)
on_tool_start(serialized, input_str, **kwargs)
__init__(parent_container: DeltaGenerator, labeler: LLMThoughtLabeler, expanded: bool, collapse_on_complete: bool)[source]¶
Initialize the LLMThought.
Parameters
parent_container – The container we’re writing into.
labeler – The labeler to use for this thought.
expanded – Whether the thought should be expanded by default.
collapse_on_complete – Whether the thought should be collapsed.
clear() → None[source]¶
Remove the thought from the screen. A cleared thought can’t be reused.