langchain_community.callbacks.streamlit.streamlit_callback_handler.LLMThoughtLabeler

class langchain_community.callbacks.streamlit.streamlit_callback_handler.LLMThoughtLabeler[source]

生成LLMThought容器的Markdown标签。将自定义的子类传递给StreamlitCallbackHandler,以覆盖其默认的标记逻辑。

Methods

__init__()

get_final_agent_thought_label()

返回代理的最终思考的标签 - “现在我有答案”思考,不涉及工具。

get_history_label()

返回一个markdown标签,用于表示包含溢出思维的特殊“history”容器。

get_initial_label()

返回一个新的LLMThought的markdown标签,该LLMThought尚未关联任何工具。

get_tool_label(tool, is_complete)

返回具有关联工具的LLMThought的标签。

__init__()
get_final_agent_thought_label() str[source]

返回代理的最终思考的标签 - “现在我有答案”思考,不涉及工具。

Return type

str

get_history_label() str[source]

返回一个markdown标签,用于表示包含溢出思维的特殊“history”容器。

Return type

str

get_initial_label() str[source]

返回一个新的LLMThought的markdown标签,该LLMThought尚未关联任何工具。

Return type

str

get_tool_label(tool: ToolRecord, is_complete: bool) str[source]

返回具有关联工具的LLMThought的标签。

tool

工具的ToolRecord

is_complete

如果思考完成,则为True;如果思考仍在接收输入,则为False。

思考容器的Markdown标签。

Parameters
Return type

str