Tony20100/langchain_full huggingface dataset:
utils.mustache.l_sa_check(template, literal, ...)
Do a preliminary check to see if a tag could be a standalone.
utils.mustache.parse_tag(template, l_del, r_del)
Parse a tag from a template.
utils.mustache.r_sa_check(template, ...)
Do a final check to see if a tag could be a standalone.
utils.mustache.render([template, data, ...])
Render a mustache template.
utils.mustache.tokenize(template[, ...])
Tokenize a mustache template.
utils.pydantic.get_pydantic_major_version()
Get the major version of Pydantic.
utils.strings.comma_list(items)
Convert a list to a comma-separated string.
utils.strings.stringify_dict(data)
Stringify a dictionary.
utils.strings.stringify_value(val)
Stringify a value.
utils.utils.build_extra_kwargs(extra_kwargs, ...)
Build extra kwargs from values and extra_kwargs.
utils.utils.check_package_version(package[, ...])
Check the version of a package.
utils.utils.convert_to_secret_str(value)
Convert a string to a SecretStr if needed.
utils.utils.get_pydantic_field_names(...)
Get field names, including aliases, for a pydantic class.
utils.utils.guard_import(module_name, *[, ...])
Dynamically import a module and raise an exception if the module is not installed.
utils.utils.mock_now(dt_value)
Context manager for mocking out datetime.now() in unit tests.
utils.utils.raise_for_status_with_text(response)
Raise an error with the response text.
utils.utils.xor_args(*arg_groups)
Validate specified keyword args are mutually exclusive.
langchain_core.vectorstores¶
Vector store stores embedded data and performs vector search.
One of the most common ways to store and search over unstructured data is to
One of the most common ways to store and search over unstructured data is to
embed it and store the resulting embedding vectors, and then query the store
and retrieve the data that are ‘most similar’ to the embedded query.
Class hierarchy:
VectorStore --> <name>  # Examples: Annoy, FAISS, Milvus
BaseRetriever --> VectorStoreRetriever --> <name>Retriever  # Example: VespaRetriever
Main helpers:
Embeddings, Document
Classes¶
vectorstores.VectorStore()
Interface for vector store.
vectorstores.VectorStoreRetriever
Base Retriever class for VectorStore.
langchain_anthropic 0.1.15¶
langchain_anthropic.chat_models¶
Classes¶
chat_models.AnthropicTool
chat_models.ChatAnthropic
Anthropic chat model integration.
chat_models.ChatAnthropicMessages
[Deprecated]
Functions¶
chat_models.convert_to_anthropic_tool(tool)
langchain_anthropic.experimental¶
Classes¶
experimental.ChatAnthropicTools
[Deprecated] Chat model for interacting with Anthropic functions.
Functions¶
experimental.get_system_message(tools)
langchain_anthropic.llms¶
Classes¶
llms.Anthropic
[Deprecated]
llms.AnthropicLLM
Anthropic large language model.
langchain_anthropic.output_parsers¶
Classes¶
output_parsers.ToolsOutputParser
Create a new model by parsing and validating input data from keyword arguments.
Functions¶
output_parsers.extract_tool_calls(content)
langchain_astradb 0.3.3¶
langchain_astradb.cache¶
Classes¶
cache.AstraDBCache(*[, collection_name, ...])
Cache that uses Astra DB as a backend.
cache.AstraDBSemanticCache(*[, ...])
Cache that uses Astra DB as a vector-store backend for semantic (i.e.
langchain_astradb.chat_message_histories¶
Astra DB - based chat message history, based on astrapy.
Classes¶
chat_message_histories.AstraDBChatMessageHistory(*, ...)
Chat message history that stores history in Astra DB.
langchain_astradb.document_loaders¶
Classes¶
document_loaders.AstraDBLoader(...)
Load DataStax Astra DB documents.
langchain_astradb.storage¶
Classes¶
storage.AstraDBBaseStore(*args, **kwargs)
Base class for the DataStax AstraDB data store.
storage.AstraDBByteStore(*, collection_name)
ByteStore implementation using DataStax AstraDB as the underlying store.
storage.AstraDBStore(collection_name, *[, ...])
BaseStore implementation using DataStax AstraDB as the underlying store.
langchain_astradb.utils¶
Classes¶
utils.astradb.SetupMode(value)
An enumeration.
Functions¶
utils.mmr.cosine_similarity(X, Y)
Row-wise cosine similarity between two equal-width matrices.
utils.mmr.maximal_marginal_relevance(...[, ...])
Calculate maximal marginal relevance.
langchain_astradb.vectorstores¶
Classes¶
vectorstores.AstraDBVectorStore(*, ...[, ...])
Wrapper around DataStax Astra DB for vector-store workloads.
on_retry(retry_state, **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) → 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_agent_action(action: AgentAction, **kwargs: Any) → Any[source]¶
Run when agent action is received.
Parameters
Run when agent action is received.
Parameters
action (AgentAction) – The agent action.
kwargs (Any) – 
Returns
The result of the callback.
Return type
Any
on_agent_finish(finish: AgentFinish, **kwargs: Any) → Any[source]¶
Run when agent finish is received.
Parameters
finish (AgentFinish) – The agent finish.
kwargs (Any) – 
Returns
The result of the callback.
Return type
Any
on_chain_end(outputs: Union[Dict[str, Any], Any], **kwargs: Any) → None[source]¶
Run when chain ends running.
Parameters
outputs (Union[Dict[str, Any], Any]) – The outputs of the chain.
kwargs (Any) – 
Return type
None
on_chain_error(error: BaseException, **kwargs: Any) → None[source]¶
Run when chain errors.
Parameters
error (Exception or KeyboardInterrupt) – The error.
kwargs (Any) – 
Return type
None
on_retry(retry_state: RetryCallState, **kwargs: Any) → None¶
Run on a retry event.
Parameters
retry_state (RetryCallState) – 
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
langchain_core.callbacks.base.RetrieverManagerMixin¶
class langchain_core.callbacks.base.RetrieverManagerMixin[source]¶
Mixin for Retriever callbacks.
Methods
__init__()
on_retriever_end(documents, *, run_id[, ...])
Run when Retriever ends running.
on_retriever_error(error, *, run_id[, ...])
Run when Retriever errors.
__init__()¶
on_retriever_end(documents: Sequence[Document], *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any[source]¶
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[source]¶
Run when Retriever errors.
Parameters
error (BaseException) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
langchain_community.callbacks.human.AsyncHumanApprovalCallbackHandler¶
class langchain_community.callbacks.human.AsyncHumanApprovalCallbackHandler(approve: ~typing.Callable[[~typing.Any], ~typing.Awaitable[bool]] = <function _adefault_approve>, should_check: ~typing.Callable[[~typing.Dict[str, ~typing.Any]], bool] = <function _default_true>)[source]¶
Asynchronous callback for manually validating values.
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__([approve, should_check])
on_agent_action(action, *, run_id[, ...])
Run on agent action.
on_agent_finish(finish, *, run_id[, ...])
Run on agent end.
on_chain_end(outputs, *, run_id[, ...])
Run when chain ends running.
on_chain_error(error, *, run_id[, ...])
Run when chain errors.
on_chain_start(serialized, inputs, *, run_id)
Run when chain starts running.
on_chat_model_start(serialized, messages, *, ...)
Run when a chat model starts running.
on_llm_end(response, *, run_id[, ...])
Run when LLM ends running.
on_llm_error(error, *, run_id[, ...])
Run when LLM errors.
on_llm_new_token(token, *[, chunk, ...])
Run on new LLM token.
Run on new LLM token.
on_llm_start(serialized, prompts, *, run_id)
Run when LLM starts running.
on_retriever_end(documents, *, run_id[, ...])
Run on retriever end.
on_retriever_error(error, *, run_id[, ...])
Run on retriever error.
on_retriever_start(serialized, query, *, run_id)
Run on retriever start.
on_retry(retry_state, *, run_id[, parent_run_id])
Run on a retry event.
on_text(text, *, run_id[, parent_run_id, tags])
Run on arbitrary text.
on_tool_end(output, *, run_id[, ...])
Run when tool ends running.
on_tool_error(error, *, run_id[, ...])
Run when tool errors.
on_tool_start(serialized, input_str, *, run_id)
Run when tool starts running.
Parameters
approve (Callable[[Any], Awaitable[bool]]) – 
should_check (Callable[[Dict[str, Any]], bool]) – 
__init__(approve: ~typing.Callable[[~typing.Any], ~typing.Awaitable[bool]] = <function _adefault_approve>, should_check: ~typing.Callable[[~typing.Dict[str, ~typing.Any]], bool] = <function _default_true>)[source]¶
Parameters
approve (Callable[[Any], Awaitable[bool]]) – 
should_check (Callable[[Dict[str, Any]], bool]) – 
async on_agent_action(action: AgentAction, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run on agent action.
Run on agent action.
Parameters
action (AgentAction) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_agent_finish(finish: AgentFinish, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run on agent end.
Parameters
finish (AgentFinish) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_chain_end(outputs: Dict[str, Any], *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run when chain ends running.
Parameters
outputs (Dict[str, Any]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_chain_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run when chain errors.
Parameters
error (BaseException) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
kwargs (Any) – 
Return type
None
async on_chain_start(serialized: Dict[str, Any], inputs: Dict[str, Any], *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → None¶
Run when chain starts running.
Parameters
serialized (Dict[str, Any]) – 
inputs (Dict[str, Any]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
metadata (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
None
async on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], *, 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 a chat model starts running.
ATTENTION: This method is called for chat models. If you’re implementinga handler for a non-chat model, you should use on_llm_start instead.
Parameters
serialized (Dict[str, Any]) – 
messages (List[List[BaseMessage]]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
metadata (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
Any
async on_llm_end(response: LLMResult, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run when LLM ends running.
Parameters
Run when LLM ends running.
Parameters
response (LLMResult) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_llm_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run when LLM errors.
Parameters
error (BaseException) – The error that occurred.
kwargs (Any) – Additional keyword arguments.
- response (LLMResult): The response which was generated before
the error occurred.
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
Return type
None
async on_llm_new_token(token: str, *, chunk: Optional[Union[GenerationChunk, ChatGenerationChunk]] = None, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run on new LLM token. Only available when streaming is enabled.
Parameters
token (str) – 
chunk (Optional[Union[GenerationChunk, ChatGenerationChunk]]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_llm_start(serialized: Dict[str, Any], prompts: List[str], *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → None¶
Run when LLM starts running.
ATTENTION: This method is called for non-chat models (regular LLMs). Ifyou’re implementing a handler for a chat model,
you should use on_chat_model_start instead.
Parameters
serialized (Dict[str, Any]) – 
prompts (List[str]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
metadata (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
None
async on_retriever_end(documents: Sequence[Document], *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run on retriever end.
Parameters
documents (Sequence[Document]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_retriever_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run on retriever error.
Parameters
error (BaseException) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async 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) → None¶
Run on retriever start.
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
None
async 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
async on_text(text: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run on arbitrary text.
Parameters
text (str) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_tool_end(output: Any, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run when tool ends running.
Parameters
output (Any) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
kwargs (Any) – 
Return type
None
async on_tool_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → None¶
Run when tool errors.
Parameters
error (BaseException) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
tags (Optional[List[str]]) – 
kwargs (Any) – 
Return type
None
async on_tool_start(serialized: Dict[str, Any], input_str: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any[source]¶
Run when tool starts running.
Parameters
serialized (Dict[str, Any]) – 
input_str (str) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
langchain_community.callbacks.streamlit.streamlit_callback_handler.LLMThoughtState¶
class langchain_community.callbacks.streamlit.streamlit_callback_handler.LLMThoughtState(value)[source]¶
Enumerator of the LLMThought state.
THINKING = 'THINKING'¶
RUNNING_TOOL = 'RUNNING_TOOL'¶
COMPLETE = 'COMPLETE'¶
Optional because the preferred way to specify the dataset id is
with environment variable WHYLABS_DEFAULT_DATASET_ID.
sentiment (bool) – Whether to enable sentiment analysis. Defaults to False.
toxicity (bool) – Whether to enable toxicity analysis. Defaults to False.
themes (bool) – Whether to enable theme analysis. Defaults to False.
logger (Logger) – 
handler (Any) – 
Initiate the rolling logger.
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__(logger, handler)
Initiate the rolling logger.
close()
Close any loggers to allow writing out of any profiles before exiting.
flush()
Explicitly write current profile if using a rolling logger.
from_params(*[, api_key, org_id, ...])
Instantiate whylogs Logger from params.
on_agent_action(action, *, run_id[, ...])
Run on agent action.
on_agent_finish(finish, *, run_id[, ...])
Run on agent end.
on_chain_end(outputs, *, run_id[, parent_run_id])
Run when chain ends running.
on_chain_error(error, *, run_id[, parent_run_id])
Run when chain errors.
on_chain_start(serialized, inputs, *, run_id)
Run when chain starts running.
on_chat_model_start(serialized, messages, *, ...)
Run when a chat model starts running.
Run when a chat model starts running.
on_llm_end(response, *, run_id[, parent_run_id])
Run when LLM ends running.
on_llm_error(error, *, run_id[, parent_run_id])
Run when LLM errors. :param error: The error that occurred. :type error: BaseException :param kwargs: Additional keyword arguments. - response (LLMResult): The response which was generated before                    the error occurred. :type kwargs: Any.
on_llm_new_token(token, *[, chunk, ...])
Run on new LLM token.
on_llm_start(serialized, prompts, *, run_id)
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, *, run_id[, parent_run_id])
Run on arbitrary text.
on_tool_end(output, *, run_id[, parent_run_id])
Run when tool ends running.
on_tool_error(error, *, run_id[, parent_run_id])
Run when tool errors.
on_tool_start(serialized, input_str, *, run_id)
Run when tool starts running.
__init__(logger: Logger, handler: Any)[source]¶
Initiate the rolling logger.
Parameters
logger (Logger) – 
handler (Any) –
Parameters
logger (Logger) – 
handler (Any) – 
close() → None[source]¶
Close any loggers to allow writing out of any profiles before exiting.
Return type
None
flush() → None[source]¶
Explicitly write current profile if using a rolling logger.
Return type
None
classmethod from_params(*, api_key: Optional[str] = None, org_id: Optional[str] = None, dataset_id: Optional[str] = None, sentiment: bool = False, toxicity: bool = False, themes: bool = False, logger: Optional[Logger] = None) → WhyLabsCallbackHandler[source]¶
Instantiate whylogs Logger from params.
Parameters
api_key (Optional[str]) – WhyLabs API key. Optional because the preferred
way to specify the API key is with environment variable
WHYLABS_API_KEY.
org_id (Optional[str]) – WhyLabs organization id to write profiles to.
If not set must be specified in environment variable
WHYLABS_DEFAULT_ORG_ID.
dataset_id (Optional[str]) – The model or dataset this callback is gathering
telemetry for. If not set must be specified in environment variable
WHYLABS_DEFAULT_DATASET_ID.
sentiment (bool) – If True will initialize a model to perform
sentiment analysis compound score. Defaults to False and will not gather
this metric.
toxicity (bool) – If True will initialize a model to score
toxicity. Defaults to False and will not gather this metric.
themes (bool) – If True will initialize a model to calculate
distance to configured themes. Defaults to None and will not gather this
metric.
logger (Optional[Logger]) – If specified will bind the configured logger as
the telemetry gathering agent. Defaults to LangKit schema with periodic
WhyLabs writer.
Return type
WhyLabs writer.
Return type
WhyLabsCallbackHandler
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
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, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run when chain ends running.
Parameters
outputs (Dict[str, Any]) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any
on_chain_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run when chain errors.
Parameters
error (BaseException) – 
run_id (UUID) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
Any