Tony20100/langchain_full huggingface dataset:
langchain_core.callbacks.manager.CallbackManagerForChainGroup¶
class langchain_core.callbacks.manager.CallbackManagerForChainGroup(handlers: List[BaseCallbackHandler], inheritable_handlers: Optional[List[BaseCallbackHandler]] = None, parent_run_id: Optional[UUID] = None, *, parent_run_manager: CallbackManagerForChainRun, **kwargs: Any)[source]¶
Callback manager for the chain group.
Initialize callback manager.
Attributes
is_async
Whether the callback manager is async.
Methods
__init__(handlers[, inheritable_handlers, ...])
Initialize callback manager.
add_handler(handler[, inherit])
Add a handler to the callback manager.
add_metadata(metadata[, inherit])
add_tags(tags[, inherit])
configure([inheritable_callbacks, ...])
Configure the callback manager.
copy()
Copy the callback manager.
on_chain_end(outputs, **kwargs)
Run when traced chain group ends.
on_chain_error(error, **kwargs)
Run when chain errors.
on_chain_start(serialized, inputs[, run_id])
Run when chain starts running.
on_chat_model_start(serialized, messages[, ...])
Run when LLM starts running.
on_llm_start(serialized, prompts[, run_id])
Run when LLM starts running.
on_retriever_start(serialized, query[, ...])
Run when retriever starts running.
on_tool_start(serialized, input_str[, ...])
Run when tool starts running.
remove_handler(handler)
Remove a handler from the callback manager.
remove_metadata(keys)
remove_tags(tags)
set_handler(handler[, inherit])
Set handler as the only handler on the callback manager.
set_handlers(handlers[, inherit])
Set handlers as the only handlers on the callback manager.
Parameters
Set handlers as the only handlers on the callback manager.
Parameters
handlers (List[BaseCallbackHandler]) – 
inheritable_handlers (Optional[List[BaseCallbackHandler]]) – 
parent_run_id (Optional[UUID]) – 
parent_run_manager (CallbackManagerForChainRun) – 
kwargs (Any) – 
__init__(handlers: List[BaseCallbackHandler], inheritable_handlers: Optional[List[BaseCallbackHandler]] = None, parent_run_id: Optional[UUID] = None, *, parent_run_manager: CallbackManagerForChainRun, **kwargs: Any) → None[source]¶
Initialize callback manager.
Parameters
handlers (List[BaseCallbackHandler]) – 
inheritable_handlers (Optional[List[BaseCallbackHandler]]) – 
parent_run_id (Optional[UUID]) – 
parent_run_manager (CallbackManagerForChainRun) – 
kwargs (Any) – 
Return type
None
add_handler(handler: BaseCallbackHandler, inherit: bool = True) → None¶
Add a handler to the callback manager.
Parameters
handler (BaseCallbackHandler) – 
inherit (bool) – 
Return type
None
add_metadata(metadata: Dict[str, Any], inherit: bool = True) → None¶
Parameters
metadata (Dict[str, Any]) – 
inherit (bool) – 
Return type
None
add_tags(tags: List[str], inherit: bool = True) → None¶
Parameters
tags (List[str]) – 
inherit (bool) – 
Return type
None
tags (List[str]) – 
inherit (bool) – 
Return type
None
classmethod configure(inheritable_callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, local_callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, verbose: bool = False, inheritable_tags: Optional[List[str]] = None, local_tags: Optional[List[str]] = None, inheritable_metadata: Optional[Dict[str, Any]] = None, local_metadata: Optional[Dict[str, Any]] = None) → CallbackManager¶
Configure the callback manager.
Parameters
inheritable_callbacks (Optional[Callbacks], optional) – The inheritable
callbacks. Defaults to None.
local_callbacks (Optional[Callbacks], optional) – The local callbacks.
Defaults to None.
verbose (bool, optional) – Whether to enable verbose mode. Defaults to False.
inheritable_tags (Optional[List[str]], optional) – The inheritable tags.
Defaults to None.
local_tags (Optional[List[str]], optional) – The local tags.
Defaults to None.
inheritable_metadata (Optional[Dict[str, Any]], optional) – The inheritable
metadata. Defaults to None.
local_metadata (Optional[Dict[str, Any]], optional) – The local metadata.
Defaults to None.
Returns
The configured callback manager.
Return type
CallbackManager
copy() → CallbackManagerForChainGroup[source]¶
Copy the callback manager.
Return type
CallbackManagerForChainGroup
on_chain_end(outputs: Union[Dict[str, Any], Any], **kwargs: Any) → None[source]¶
Run when traced chain group ends.
Parameters
outputs (Union[Dict[str, Any], Any]) – The outputs of the chain.
kwargs (Any) – 
Return type
None
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_chain_start(serialized: Dict[str, Any], inputs: Union[Dict[str, Any], Any], run_id: Optional[UUID] = None, **kwargs: Any) → CallbackManagerForChainRun¶
Run when chain starts running.
Parameters
serialized (Dict[str, Any]) – The serialized chain.
inputs (Union[Dict[str, Any], Any]) – The inputs to the chain.
run_id (UUID, optional) – The ID of the run. Defaults to None.
kwargs (Any) – 
Returns
The callback manager for the chain run.
Return type
CallbackManagerForChainRun
on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], run_id: Optional[UUID] = None, **kwargs: Any) → List[CallbackManagerForLLMRun]¶
Run when LLM starts running.
Parameters
serialized (Dict[str, Any]) – The serialized LLM.
messages (List[List[BaseMessage]]) – The list of messages.
run_id (UUID, optional) – The ID of the run. Defaults to None.
kwargs (Any) – 
Returns
A callback manager for eachlist of messages as an LLM run.
Return type
List[CallbackManagerForLLMRun]
on_llm_start(serialized: Dict[str, Any], prompts: List[str], run_id: Optional[UUID] = None, **kwargs: Any) → List[CallbackManagerForLLMRun]¶
Run when LLM starts running.
Parameters
Run when LLM starts running.
Parameters
serialized (Dict[str, Any]) – The serialized LLM.
prompts (List[str]) – The list of prompts.
run_id (UUID, optional) – The ID of the run. Defaults to None.
kwargs (Any) – 
Returns
A callback manager for eachprompt as an LLM run.
Return type
List[CallbackManagerForLLMRun]
on_retriever_start(serialized: Dict[str, Any], query: str, run_id: Optional[UUID] = None, parent_run_id: Optional[UUID] = None, **kwargs: Any) → CallbackManagerForRetrieverRun¶
Run when retriever starts running.
Parameters
serialized (Dict[str, Any]) – 
query (str) – 
run_id (Optional[UUID]) – 
parent_run_id (Optional[UUID]) – 
kwargs (Any) – 
Return type
CallbackManagerForRetrieverRun
on_tool_start(serialized: Dict[str, Any], input_str: str, run_id: Optional[UUID] = None, parent_run_id: Optional[UUID] = None, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) → CallbackManagerForToolRun¶
Run when tool starts running.
Parameters
serialized (Dict[str, Any]) – Serialized representation of the tool.
input_str (str) – The  input to the tool as a string.
Non-string inputs are cast to strings.
run_id (Optional[UUID]) – ID for the run. Defaults to None.
parent_run_id (Optional[UUID]) – The ID of the parent run. Defaults to None.
inputs (Optional[Dict[str, Any]]) – The original input to the tool if provided.
Recommended for usage instead of input_str when the original
input is needed.
Recommended for usage instead of input_str when the original
input is needed.
If provided, the inputs are expected to be formatted as a dict.
The keys will correspond to the named-arguments in the tool.
kwargs (Any) – 
Returns
The callback manager for the tool run.
Return type
CallbackManagerForToolRun
remove_handler(handler: BaseCallbackHandler) → None¶
Remove a handler from the callback manager.
Parameters
handler (BaseCallbackHandler) – 
Return type
None
remove_metadata(keys: List[str]) → None¶
Parameters
keys (List[str]) – 
Return type
None
remove_tags(tags: List[str]) → None¶
Parameters
tags (List[str]) – 
Return type
None
set_handler(handler: BaseCallbackHandler, inherit: bool = True) → None¶
Set handler as the only handler on the callback manager.
Parameters
handler (BaseCallbackHandler) – 
inherit (bool) – 
Return type
None
set_handlers(handlers: List[BaseCallbackHandler], inherit: bool = True) → None¶
Set handlers as the only handlers on the callback manager.
Parameters
handlers (List[BaseCallbackHandler]) – 
inherit (bool) – 
Return type
None
langchain_community.callbacks.openai_info.standardize_model_name¶
langchain_community.callbacks.openai_info.standardize_model_name(model_name: str, is_completion: bool = False) → str[source]¶
Standardize the model name to a format that can be used in the OpenAI API.
Parameters
model_name (str) – Model name to standardize.
is_completion (bool) – Whether the model is used for completion or not.
Defaults to False.
Returns
Standardized model name.
Return type
str
langchain_community.callbacks.tracers.comet.CometTracer¶
class langchain_community.callbacks.tracers.comet.CometTracer(**kwargs: Any)[source]¶
Comet Tracer.
Initialize the Comet Tracer.
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__(**kwargs)
Initialize the Comet Tracer.
flush()
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[, inputs])
End a trace for a chain run.
on_chain_error(error, *[, inputs])
Handle an error for a chain run.
on_chain_start(serialized, inputs, *, run_id)
Start a trace for a chain run.
on_chat_model_start(serialized, messages, *, ...)
Start a trace for an LLM run.
on_llm_end(response, *, run_id, **kwargs)
End a trace for an LLM run.
on_llm_error(error, *, run_id, **kwargs)
Handle an error for an LLM run.
on_llm_new_token(token, *[, chunk, ...])
Run on new LLM token.
on_llm_start(serialized, prompts, *, run_id)
Start a trace for an LLM run.
Start a trace for an LLM run.
on_retriever_end(documents, *, run_id, **kwargs)
Run when Retriever ends running.
on_retriever_error(error, *, run_id, **kwargs)
Run when Retriever errors.
on_retriever_start(serialized, query, *, run_id)
Run when Retriever starts running.
on_retry(retry_state, *, run_id, **kwargs)
Run on a retry event.
on_text(text, *, run_id[, parent_run_id])
Run on arbitrary text.
on_tool_end(output, *, run_id, **kwargs)
End a trace for a tool run.
on_tool_error(error, *, run_id, **kwargs)
Handle an error for a tool run.
on_tool_start(serialized, input_str, *, run_id)
Start a trace for a tool run.
Parameters
kwargs (Any) – 
__init__(**kwargs: Any) → None[source]¶
Initialize the Comet Tracer.
Parameters
kwargs (Any) – 
Return type
None
flush() → None[source]¶
Return type
None
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
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]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
run_type (Optional[str]) – 
name (Optional[str]) – 
kwargs (Any) –
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_tool_error(error: BaseException, *, run_id: UUID, **kwargs: Any) → Run¶
Handle an error for a tool run.
Parameters
error (BaseException) – 
run_id (UUID) – 
kwargs (Any) – 
Return type
Run
on_tool_start(serialized: Dict[str, Any], input_str: str, *, run_id: UUID, tags: Optional[List[str]] = None, parent_run_id: Optional[UUID] = None, metadata: Optional[Dict[str, Any]] = None, name: Optional[str] = None, inputs: Optional[Dict[str, Any]] = None, **kwargs: Any) → Run¶
Start a trace for a tool run.
Parameters
serialized (Dict[str, Any]) – 
input_str (str) – 
run_id (UUID) – 
tags (Optional[List[str]]) – 
parent_run_id (Optional[UUID]) – 
metadata (Optional[Dict[str, Any]]) – 
name (Optional[str]) – 
inputs (Optional[Dict[str, Any]]) – 
kwargs (Any) – 
Return type
Run
Examples using CometTracer¶
Comet
Comet Tracing
langchain_community.callbacks.comet_ml_callback.CometCallbackHandler¶
class langchain_community.callbacks.comet_ml_callback.CometCallbackHandler(task_type: Optional[str] = 'inference', workspace: Optional[str] = None, project_name: Optional[str] = None, tags: Optional[Sequence] = None, name: Optional[str] = None, visualizations: Optional[List[str]] = None, complexity_metrics: bool = False, custom_metrics: Optional[Callable] = None, stream_logs: bool = True)[source]¶
Callback Handler that logs to Comet.
Parameters
job_type (str) – The type of comet_ml task such as “inference”,
“testing” or “qc”
project_name (str) – The comet_ml project name
tags (list) – Tags to add to the task
task_name (str) – Name of the comet_ml task
visualize (bool) – Whether to visualize the run.
complexity_metrics (bool) – Whether to log complexity metrics
stream_logs (bool) – Whether to stream callback actions to Comet
task_type (Optional[str]) – 
workspace (Optional[str]) – 
name (Optional[str]) – 
visualizations (Optional[List[str]]) – 
custom_metrics (Optional[Callable]) – 
This handler will utilize the associated callback method and formats
the input of each callback function with metadata regarding the state of LLM run,
and adds the response to the list of records for both the {method}_records and
action. It then logs the response to Comet.
Initialize callback handler.
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_chat_model
Whether to ignore chat model callbacks.
ignore_llm
Whether to ignore LLM callbacks.
ignore_retriever
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__([task_type, workspace, ...])
Initialize callback handler.
flush_tracker([langchain_asset, task_type, ...])
Flush the tracker and setup the session.
get_custom_callback_meta()
on_agent_action(action, **kwargs)
Run on agent action.
on_agent_finish(finish, **kwargs)
Run when agent ends running.
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 a chat model 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 when LLM generates a new token.
on_llm_start(serialized, prompts, **kwargs)
Run when LLM starts.
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 a retry event.
on_text(text, **kwargs)
Run when agent is ending.
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.
reset_callback_meta()
Reset the callback metadata.
__init__(task_type: Optional[str] = 'inference', workspace: Optional[str] = None, project_name: Optional[str] = None, tags: Optional[Sequence] = None, name: Optional[str] = None, visualizations: Optional[List[str]] = None, complexity_metrics: bool = False, custom_metrics: Optional[Callable] = None, stream_logs: bool = True) → None[source]¶
Initialize callback handler.
Parameters
task_type (Optional[str]) – 
workspace (Optional[str]) – 
project_name (Optional[str]) – 
tags (Optional[Sequence]) – 
name (Optional[str]) – 
visualizations (Optional[List[str]]) – 
complexity_metrics (bool) – 
custom_metrics (Optional[Callable]) – 
stream_logs (bool) – 
Return type
None
flush_tracker(langchain_asset: Optional[Any] = None, task_type: Optional[str] = 'inference', workspace: Optional[str] = None, project_name: Optional[str] = 'comet-langchain-demo', tags: Optional[Sequence] = None, name: Optional[str] = None, visualizations: Optional[List[str]] = None, complexity_metrics: bool = False, custom_metrics: Optional[Callable] = None, finish: bool = False, reset: bool = False) → None[source]¶
Flush the tracker and setup the session.
Everything after this will be a new table.
Parameters
Everything after this will be a new table.
Parameters
name (Optional[str]) – Name of the performed session so far so it is identifiable
langchain_asset (Optional[Any]) – The langchain asset to save.
finish (bool) – Whether to finish the run.
Returns – None
task_type (Optional[str]) – 
workspace (Optional[str]) – 
project_name (Optional[str]) – 
tags (Optional[Sequence]) – 
visualizations (Optional[List[str]]) – 
complexity_metrics (bool) – 
custom_metrics (Optional[Callable]) – 
reset (bool) – 
Return type
None
get_custom_callback_meta() → Dict[str, Any]¶
Return type
Dict[str, Any]
on_agent_action(action: AgentAction, **kwargs: Any) → Any[source]¶
Run on agent action.
Parameters
action (AgentAction) – 
kwargs (Any) – 
Return type
Any
on_agent_finish(finish: AgentFinish, **kwargs: Any) → None[source]¶
Run when agent ends running.
Parameters
finish (AgentFinish) – 
kwargs (Any) – 
Return type
None
on_chain_end(outputs: Dict[str, Any], **kwargs: Any) → None[source]¶
Run when chain ends running.
Parameters
outputs (Dict[str, Any]) – 
kwargs (Any) – 
Return type
None
on_chain_error(error: BaseException, **kwargs: Any) → None[source]¶
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[source]¶
Run when chain starts running.
Parameters
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]], *, 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
on_llm_end(response: LLMResult, **kwargs: Any) → None[source]¶
Run when LLM ends running.
Parameters
response (LLMResult) – 
kwargs (Any) – 
Return type
None
on_llm_error(error: BaseException, **kwargs: Any) → None[source]¶
Run when LLM errors.
Parameters
error (BaseException) – 
kwargs (Any) – 
Return type
None
on_llm_new_token(token: str, **kwargs: Any) → None[source]¶
Run when LLM generates a new token.
Parameters
token (str) – 
kwargs (Any) – 
Return type
None
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.
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) – 
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) –
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[source]¶
Run when agent is ending.
Parameters
text (str) – 
kwargs (Any) – 
Return type
None
on_tool_end(output: Any, **kwargs: Any) → None[source]¶
Run when tool ends running.
Parameters
output (Any) – 
kwargs (Any) – 
Return type
None
on_tool_error(error: BaseException, **kwargs: Any) → None[source]¶
Run when tool errors.
Parameters
error (BaseException) – 
kwargs (Any) – 
Return type
None
on_tool_start(serialized: Dict[str, Any], input_str: str, **kwargs: Any) → None[source]¶
Run when tool starts running.
Parameters
serialized (Dict[str, Any]) – 
input_str (str) – 
kwargs (Any) – 
Return type
None
reset_callback_meta() → None¶
Reset the callback metadata.
Return type
None
Examples using CometCallbackHandler¶
Comet
langchain_community.callbacks.fiddler_callback.FiddlerCallbackHandler¶
class langchain_community.callbacks.fiddler_callback.FiddlerCallbackHandler(url: str, org: str, project: str, model: str, api_key: str)[source]¶
Initialize Fiddler callback handler.
Parameters
url (str) – Fiddler URL (e.g. https://demo.fiddler.ai).
Make sure to include the protocol (http/https).
org (str) – Fiddler organization id
project (str) – Fiddler project name to publish events to
model (str) – Fiddler model name to publish events to
api_key (str) – Fiddler authentication token
Attributes
custom_features
Define custom features for the model to automatically enrich the data with. Here, we enable the following enrichments: - Automatic Embedding generation for prompt and response - Text Statistics such as:     - Automated Readability Index     - Coleman Liau Index     - Dale Chall Readability Score     - Difficult Words     - Flesch Reading Ease     - Flesch Kincaid Grade     - Gunning Fog     - Linsear Write Formula - PII - Personal Identifiable Information - Sentiment Analysis.
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__(url, org, project, model, api_key)
Initialize Fiddler callback handler.
on_agent_action(action, *, run_id[, ...])
Run on agent action.
on_agent_finish(finish, *, run_id[, ...])