langchain_community.callbacks.utils
.BaseMetadataCallbackHandler¶
- class langchain_community.callbacks.utils.BaseMetadataCallbackHandler[source]¶
处理回调函数的元数据和相关函数状态。
- 属性:
step (int): 当前步骤。 starts (int): 调用start方法的次数。 ends (int): 调用end方法的次数。 errors (int): 调用error方法的次数。 text_ctr (int): 调用text方法的次数。 ignore_llm_ (bool): 是否忽略llm回调。 ignore_chain_ (bool): 是否忽略chain回调。 ignore_agent_ (bool): 是否忽略agent回调。 ignore_retriever_ (bool): 是否忽略retriever回调。 always_verbose_ (bool): 是否始终详细。 chain_starts (int): 调用chain start方法的次数。 chain_ends (int): 调用chain end方法的次数。 llm_starts (int): 调用llm start方法的次数。 llm_ends (int): 调用llm end方法的次数。 llm_streams (int): 调用text方法的次数。 tool_starts (int): 调用tool start方法的次数。 tool_ends (int): 调用tool end方法的次数。 agent_ends (int): 调用agent end方法的次数。 on_llm_start_records (list): on_llm_start方法的记录列表。 on_llm_token_records (list): on_llm_token方法的记录列表。 on_llm_end_records (list): on_llm_end方法的记录列表。 on_chain_start_records (list): on_chain_start方法的记录列表。 on_chain_end_records (list): on_chain_end方法的记录列表。 on_tool_start_records (list): on_tool_start方法的记录列表。 on_tool_end_records (list): on_tool_end方法的记录列表。 on_agent_finish_records (list): on_agent_end方法的记录列表。
Attributes
always_verbose
即使 verbose 为 False,也要调用详细回调函数。
ignore_agent
是否忽略代理回调。
ignore_chain
是否忽略链式回调。
ignore_llm
是否忽略LLM回调。
Methods
__init__
()重置回调元数据。
- Return type
None