Tony20100/langchain_full huggingface dataset:
langchain_community.callbacks.aim_callback.BaseMetadataCallbackHandler¶
class langchain_community.callbacks.aim_callback.BaseMetadataCallbackHandler[source]¶
Callback handler for the metadata and associated function states for callbacks.
step¶
The current step.
Type
int
starts¶
The number of times the start method has been called.
Type
int
ends¶
The number of times the end method has been called.
Type
int
errors¶
The number of times the error method has been called.
Type
int
text_ctr¶
The number of times the text method has been called.
Type
int
ignore_llm_¶
Whether to ignore llm callbacks.
Type
bool
ignore_chain_¶
Whether to ignore chain callbacks.
Type
bool
ignore_agent_¶
Whether to ignore agent callbacks.
Type
bool
ignore_retriever_¶
Whether to ignore retriever callbacks.
Type
bool
always_verbose_¶
Whether to always be verbose.
Type
bool
chain_starts¶
The number of times the chain start method has been called.
Type
int
chain_ends¶
The number of times the chain end method has been called.
Type
int
llm_starts¶
The number of times the llm start method has been called.
Type
int
llm_ends¶
The number of times the llm end method has been called.
Type
int
llm_streams¶
The number of times the text method has been called.
Type
int
tool_starts¶
The number of times the tool start method has been called.
Type
int
tool_ends¶
The number of times the tool end method has been called.
Type
int
agent_ends¶
The number of times the agent end method has been called.
Type
int
Attributes
always_verbose
Type
int
Attributes
always_verbose
Whether to call verbose callbacks even if verbose is False.
ignore_agent
Whether to ignore agent callbacks.
ignore_chain
Whether to ignore chain callbacks.
ignore_llm
Whether to ignore LLM callbacks.
ignore_retriever
Whether to ignore retriever callbacks.
Methods
__init__()
get_custom_callback_meta()
reset_callback_meta()
Reset the callback metadata.
__init__() → None[source]¶
Return type
None
get_custom_callback_meta() → Dict[str, Any][source]¶
Return type
Dict[str, Any]
reset_callback_meta() → None[source]¶
Reset the callback metadata.
Return type
None
on_tool_error(error, **kwargs)
Run when tool errors.
__init__(*, run_id: UUID, handlers: List[BaseCallbackHandler], inheritable_handlers: List[BaseCallbackHandler], parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, inheritable_tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, inheritable_metadata: Optional[Dict[str, Any]] = None) → None¶
Initialize the run manager.
Parameters
run_id (UUID) – The ID of the run.
handlers (List[BaseCallbackHandler]) – The list of handlers.
inheritable_handlers (List[BaseCallbackHandler]) – The list of inheritable handlers.
parent_run_id (UUID, optional) – The ID of the parent run.
Defaults to None.
tags (Optional[List[str]]) – The list of tags.
inheritable_tags (Optional[List[str]]) – The list of inheritable tags.
metadata (Optional[Dict[str, Any]]) – The metadata.
inheritable_metadata (Optional[Dict[str, Any]]) – The inheritable metadata.
Return type
None
get_child(tag: Optional[str] = None) → CallbackManager¶
Get a child callback manager.
Parameters
tag (str, optional) – The tag for the child callback manager.
Defaults to None.
Returns
The child callback manager.
Return type
CallbackManager
classmethod get_noop_manager() → BRM¶
Return a manager that doesn’t perform any operations.
Returns
The noop manager.
Return type
BaseRunManager
on_retry(retry_state: RetryCallState, **kwargs: Any) → None¶
Run on a retry event.
Parameters
retry_state (RetryCallState) – 
kwargs (Any) – 
Return type
None
kwargs (Any) – 
Return type
None
on_text(text: str, **kwargs: Any) → Any¶
Run when text is received.
Parameters
text (str) – The received text.
kwargs (Any) – 
Returns
The result of the callback.
Return type
Any
on_tool_end(output: Any, **kwargs: Any) → None[source]¶
Run when tool ends running.
Parameters
output (Any) – The output of the tool.
kwargs (Any) – 
Return type
None
on_tool_error(error: BaseException, **kwargs: Any) → None[source]¶
Run when tool errors.
Parameters
error (Exception or KeyboardInterrupt) – The error.
kwargs (Any) – 
Return type
None
Examples using CallbackManagerForToolRun¶
How to add a semantic layer over graph database
How to create custom tools
langchain_core.callbacks.manager.AsyncCallbackManagerForRetrieverRun¶
class langchain_core.callbacks.manager.AsyncCallbackManagerForRetrieverRun(*, run_id: UUID, handlers: List[BaseCallbackHandler], inheritable_handlers: List[BaseCallbackHandler], parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, inheritable_tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, inheritable_metadata: Optional[Dict[str, Any]] = None)[source]¶
Async callback manager for retriever run.
Initialize the run manager.
Parameters
run_id (UUID) – The ID of the run.
handlers (List[BaseCallbackHandler]) – The list of handlers.
inheritable_handlers (List[BaseCallbackHandler]) – The list of inheritable handlers.
parent_run_id (UUID, optional) – The ID of the parent run.
Defaults to None.
tags (Optional[List[str]]) – The list of tags.
inheritable_tags (Optional[List[str]]) – The list of inheritable tags.
metadata (Optional[Dict[str, Any]]) – The metadata.
inheritable_metadata (Optional[Dict[str, Any]]) – The inheritable metadata.
Methods
__init__(*, run_id, handlers, ...[, ...])
Initialize the run manager.
get_child([tag])
Get a child callback manager.
get_noop_manager()
Return a manager that doesn't perform any operations.
get_sync()
Get the equivalent sync RunManager.
on_retriever_end(documents, **kwargs)
Run when retriever ends running.
on_retriever_error(error, **kwargs)
Run when retriever errors.
on_retry(retry_state, **kwargs)
Run on a retry event.
on_text(text, **kwargs)
Run on a retry event.
on_text(text, **kwargs)
Run when text is received.
__init__(*, run_id: UUID, handlers: List[BaseCallbackHandler], inheritable_handlers: List[BaseCallbackHandler], parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, inheritable_tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, inheritable_metadata: Optional[Dict[str, Any]] = None) → None¶
Initialize the run manager.
Parameters
run_id (UUID) – The ID of the run.
handlers (List[BaseCallbackHandler]) – The list of handlers.
inheritable_handlers (List[BaseCallbackHandler]) – The list of inheritable handlers.
parent_run_id (UUID, optional) – The ID of the parent run.
Defaults to None.
tags (Optional[List[str]]) – The list of tags.
inheritable_tags (Optional[List[str]]) – The list of inheritable tags.
metadata (Optional[Dict[str, Any]]) – The metadata.
inheritable_metadata (Optional[Dict[str, Any]]) – The inheritable metadata.
Return type
None
get_child(tag: Optional[str] = None) → AsyncCallbackManager¶
Get a child callback manager.
Parameters
tag (str, optional) – The tag for the child callback manager.
Defaults to None.
Returns
The child callback manager.
Return type
AsyncCallbackManager
classmethod get_noop_manager() → BRM¶
Return a manager that doesn’t perform any operations.
Returns
The noop manager.
Return type
BaseRunManager
get_sync() → CallbackManagerForRetrieverRun[source]¶
Get the equivalent sync RunManager.
Returns
The sync RunManager.
Return type
CallbackManagerForRetrieverRun
Returns
The sync RunManager.
Return type
CallbackManagerForRetrieverRun
async on_retriever_end(documents: Sequence[Document], **kwargs: Any) → None[source]¶
Run when retriever ends running.
Parameters
documents (Sequence[Document]) – 
kwargs (Any) – 
Return type
None
async on_retriever_error(error: BaseException, **kwargs: Any) → None[source]¶
Run when retriever errors.
Parameters
error (BaseException) – 
kwargs (Any) – 
Return type
None
async on_retry(retry_state: RetryCallState, **kwargs: Any) → None¶
Run on a retry event.
Parameters
retry_state (RetryCallState) – 
kwargs (Any) – 
Return type
None
async on_text(text: str, **kwargs: Any) → Any¶
Run when text is received.
Parameters
text (str) – The received text.
kwargs (Any) – 
Returns
The result of the callback.
Return type
Any
langchain_core.callbacks.base.RunManagerMixin¶
class langchain_core.callbacks.base.RunManagerMixin[source]¶
Mixin for run manager.
Methods
__init__()
on_retry(retry_state, *, run_id[, parent_run_id])
Run on a retry event.
on_text(text, *, run_id[, parent_run_id])
Run on arbitrary text.
__init__()¶
on_retry(retry_state: RetryCallState, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any[source]¶
Run on a retry event.
Parameters
retry_state (RetryCallState) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_text(text: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any[source]¶
Run on arbitrary text.
Parameters
text (str) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
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__()
get_final_agent_thought_label()
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()
Return a markdown label for the special 'history' container that contains overflow thoughts.
get_initial_label()
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.
Return type
str
get_history_label() → str[source]¶
Return a markdown label for the special ‘history’ container
that contains overflow thoughts.
Return type
str
get_initial_label() → str[source]¶
Return the markdown label for a new LLMThought that doesn’t have
an associated tool yet.
Return type
str
get_tool_label(tool: ToolRecord, is_complete: bool) → str[source]¶
Return the label for an LLMThought that has an associated
tool.
Parameters
tool (ToolRecord) – The tool’s ToolRecord
is_complete (bool) – True if the thought is complete; False if the thought
is still receiving input.
Return type
The markdown label for the thought’s container.
langchain.callbacks.streaming_stdout_final_only.FinalStreamingStdOutCallbackHandler¶
class langchain.callbacks.streaming_stdout_final_only.FinalStreamingStdOutCallbackHandler(*, answer_prefix_tokens: Optional[List[str]] = None, strip_tokens: bool = True, stream_prefix: bool = False)[source]¶
Callback handler for streaming in agents.
Only works with agents using LLMs that support streaming.
Only the final output of the agent will be streamed.
Instantiate FinalStreamingStdOutCallbackHandler.
Parameters
answer_prefix_tokens (Optional[List[str]]) – Token sequence that prefixes the answer.
Default is [“Final”, “Answer”, “:”]
strip_tokens (bool) – Ignore white spaces and new lines when comparing
answer_prefix_tokens to last tokens? (to determine if answer has been
reached)
stream_prefix (bool) – Should answer prefix itself also be streamed?
Attributes
ignore_agent
Whether to ignore agent callbacks.
ignore_chain
Whether to ignore chain callbacks.
ignore_chat_model
Whether to ignore chat model callbacks.
ignore_llm
Whether to ignore LLM callbacks.
ignore_retriever
Whether to ignore retriever callbacks.
ignore_retry
Whether to ignore retry callbacks.
raise_error
run_inline
Methods
__init__(*[, answer_prefix_tokens, ...])
Instantiate FinalStreamingStdOutCallbackHandler.
append_to_last_tokens(token)
check_if_answer_reached()
on_agent_action(action, **kwargs)
Run on agent action.
on_agent_finish(finish, **kwargs)
Run on agent end.
on_chain_end(outputs, **kwargs)
Run when chain ends running.
on_chain_error(error, **kwargs)
Run when chain errors.
on_chain_start(serialized, inputs, **kwargs)
Run when chain starts running.
on_chat_model_start(serialized, messages, ...)
Run when chain starts running.
on_chat_model_start(serialized, messages, ...)
Run when LLM starts running.
on_llm_end(response, **kwargs)
Run when LLM ends running.
on_llm_error(error, **kwargs)
Run when LLM errors.
on_llm_new_token(token, **kwargs)
Run on new LLM token.
on_llm_start(serialized, prompts, **kwargs)
Run when LLM starts running.
on_retriever_end(documents, *, run_id[, ...])
Run when Retriever ends running.
on_retriever_error(error, *, run_id[, ...])
Run when Retriever errors.
on_retriever_start(serialized, query, *, run_id)
Run when Retriever starts running.
on_retry(retry_state, *, run_id[, parent_run_id])
Run on a retry event.
on_text(text, **kwargs)
Run on arbitrary text.
on_tool_end(output, **kwargs)
Run when tool ends running.
on_tool_error(error, **kwargs)
Run when tool errors.
on_tool_start(serialized, input_str, **kwargs)
Run when tool starts running.
__init__(*, answer_prefix_tokens: Optional[List[str]] = None, strip_tokens: bool = True, stream_prefix: bool = False) → None[source]¶
Instantiate FinalStreamingStdOutCallbackHandler.
Parameters
answer_prefix_tokens (Optional[List[str]]) – Token sequence that prefixes the answer.
Default is [“Final”, “Answer”, “:”]
strip_tokens (bool) – Ignore white spaces and new lines when comparing
answer_prefix_tokens to last tokens? (to determine if answer has been
reached)
answer_prefix_tokens to last tokens? (to determine if answer has been
reached)
stream_prefix (bool) – Should answer prefix itself also be streamed?
Return type
None
append_to_last_tokens(token: str) → None[source]¶
Parameters
token (str) – 
Return type
None
check_if_answer_reached() → bool[source]¶
Return type
bool
on_agent_action(action: AgentAction, **kwargs: Any) → Any¶
Run on agent action.
Parameters
action (AgentAction) – 
kwargs (Any) – 
Return type
Any
on_agent_finish(finish: AgentFinish, **kwargs: Any) → None¶
Run on agent end.
Parameters
finish (AgentFinish) – 
kwargs (Any) – 
Return type
None
on_chain_end(outputs: Dict[str, Any], **kwargs: Any) → None¶
Run when chain ends running.
Parameters
outputs (Dict[str, Any]) – 
kwargs (Any) – 
Return type
None
on_chain_error(error: BaseException, **kwargs: Any) → None¶
Run when chain errors.
Parameters
error (BaseException) – 
kwargs (Any) – 
Return type
None
on_chain_start(serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any) → None¶
Run when chain starts running.
Parameters
serialized (Dict[str, Any]) – 
inputs (Dict[str, Any]) – 
kwargs (Any) – 
Return type
None
on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], **kwargs: Any) → None¶
Run when LLM starts running.
Parameters
serialized (Dict[str, Any]) – 
messages (List[List[BaseMessage]]) –
messages (List[List[BaseMessage]]) – 
kwargs (Any) – 
Return type
None
on_llm_end(response: LLMResult, **kwargs: Any) → None¶
Run when LLM ends running.
Parameters
response (LLMResult) – 
kwargs (Any) – 
Return type
None
on_llm_error(error: BaseException, **kwargs: Any) → None¶
Run when LLM errors.
Parameters
error (BaseException) – 
kwargs (Any) – 
Return type
None
on_llm_new_token(token: str, **kwargs: Any) → None[source]¶
Run on new LLM token. Only available when streaming is enabled.
Parameters
token (str) – 
kwargs (Any) – 
Return type
None
on_llm_start(serialized: Dict[str, Any], prompts: List[str], **kwargs: Any) → None[source]¶
Run when LLM starts running.
Parameters
serialized (Dict[str, Any]) – 
prompts (List[str]) – 
kwargs (Any) – 
Return type
None
on_retriever_end(documents: Sequence[Document], *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run when Retriever ends running.
Parameters
documents (Sequence[Document]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_retriever_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run when Retriever errors.
Parameters
error (BaseException) – 
run_id (UUID) –
Parameters
error (BaseException) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_retriever_start(serialized: Dict[str, Any], query: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → Any¶
Run when Retriever starts running.
Parameters
serialized (Dict[str, Any]) – 
query (str) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
metadata (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
Any
on_retry(retry_state: RetryCallState, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on a retry event.
Parameters
retry_state (RetryCallState) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_text(text: str, **kwargs: Any) → None¶
Run on arbitrary text.
Parameters
text (str) – 
kwargs (Any) – 
Return type
None
on_tool_end(output: Any, **kwargs: Any) → None¶
Run when tool ends running.
Parameters
output (Any) – 
kwargs (Any) – 
Return type
None
on_tool_error(error: BaseException, **kwargs: Any) → None¶
Run when tool errors.
Parameters
error (BaseException) – 
kwargs (Any) – 
Return type
langchain_community.callbacks.flyte_callback.analyze_text¶
langchain_community.callbacks.flyte_callback.analyze_text(text: str, nlp: Optional[Any] = None, textstat: Optional[Any] = None) → dict[source]¶
Analyze text using textstat and spacy.
Parameters
text (str) – The text to analyze.
nlp (spacy.lang) – The spacy language model to use for visualization.
textstat (Optional[Any]) – 
Returns
A dictionary containing the complexity metrics and visualizationfiles serialized to HTML string.
Return type
(dict)
langchain.callbacks.tracers.logging.LoggingCallbackHandler¶
class langchain.callbacks.tracers.logging.LoggingCallbackHandler(logger: Logger, log_level: int = 20, extra: Optional[dict] = None, **kwargs: Any)[source]¶
Tracer that logs via the input Logger.
Initialize the tracer.
Parameters
_schema_format – Primarily changes how the inputs and outputs are
handled. For internal use only. This API will change.
- ‘original’ is the format used by all current tracers.
This format is slightly inconsistent with respect to inputs
and outputs.
’streaming_events’ is used for supporting streaming events,for internal usage. It will likely change in the future, or
be deprecated entirely in favor of a dedicated async tracer
for streaming events.
’original+chat’ is a format that is the same as ‘original’except it does NOT raise an attribute error on_chat_model_start
kwargs (Any) – Additional keyword arguments that will be passed to
the super class.
logger (Logger) – 
log_level (int) – 
extra (Optional[dict]) – 
Attributes
ignore_agent
Whether to ignore agent callbacks.
ignore_chain
Whether to ignore chain callbacks.
ignore_chat_model
Whether to ignore chat model callbacks.
ignore_llm
Whether to ignore LLM callbacks.
ignore_retriever
Whether to ignore retriever callbacks.
ignore_retry
Whether to ignore retry callbacks.
name
raise_error
run_inline
Methods
__init__(logger[, log_level, extra])
Initialize the tracer.
get_breadcrumbs(run)
get_parents(run)
on_agent_action(action, *, run_id[, ...])
Run on agent action.
on_agent_finish(finish, *, run_id[, ...])
Run on agent end.
Handle an error for a tool run.
on_tool_start(serialized, input_str, *, run_id)
Start a trace for a tool run.
__init__(logger: Logger, log_level: int = 20, extra: Optional[dict] = None, **kwargs: Any) → None[source]¶
Initialize the tracer.
Parameters
_schema_format – Primarily changes how the inputs and outputs are
handled. For internal use only. This API will change.
- ‘original’ is the format used by all current tracers.
This format is slightly inconsistent with respect to inputs
and outputs.
’streaming_events’ is used for supporting streaming events,for internal usage. It will likely change in the future, or
be deprecated entirely in favor of a dedicated async tracer
for streaming events.
’original+chat’ is a format that is the same as ‘original’except it does NOT raise an attribute error on_chat_model_start
kwargs (Any) – Additional keyword arguments that will be passed to
the super class.
logger (Logger) – 
log_level (int) – 
extra (Optional[dict]) – 
Return type
None
get_breadcrumbs(run: Run) → str¶
Parameters
run (Run) – 
Return type
str
get_parents(run: Run) → List[Run]¶
Parameters
run (Run) – 
Return type
List[Run]
on_agent_action(action: AgentAction, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on agent action.
Parameters
action (AgentAction) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
kwargs (Any) – 
Return type
Any
on_agent_finish(finish: AgentFinish, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run on agent end.
Parameters
finish (AgentFinish) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_chain_end(outputs: Dict[str, Any], *, run_id: UUID, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) → Run¶
End a trace for a chain run.
Parameters
outputs (Dict[str, Any]) – 
run_id (UUID) – 
inputs (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
Run
on_chain_error(error: BaseException, *, inputs: Optional[Dict[str, Any]] = None, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for a chain run.
Parameters
error (BaseException) – 
inputs (Optional[Dict[str, Any]]) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_chain_start(serialized: Dict[str, Any], inputs: Dict[str, Any], *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, run_type: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) → Run¶
Start a trace for a chain run.
Parameters
serialized (Dict[str, Any]) – 
inputs (Dict[str, Any]) – 
run_id (UUID) – 
tags (Optional[List[str]]) –
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
run_type (Optional[str]) – 
name (Optional[str]) – 
kwargs (Any) – 
Return type
Run
on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, name: Optional[str] = None, **kwargs: Any) → Run¶
Start a trace for an LLM run.
Parameters
serialized (Dict[str, Any]) – 
messages (List[List[BaseMessage]]) – 
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
name (Optional[str]) – 
kwargs (Any) – 
Return type
Run
on_llm_end(response: LLMResult, *, run_id: UUID, **kwargs: Any) → Run¶
End a trace for an LLM run.
Parameters
response (LLMResult) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_llm_error(error: BaseException, *, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for an LLM run.
Parameters
error (BaseException) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run