langchain.callbacks.infino_callback.InfinoCallbackHandler¶
class langchain.callbacks.infino_callback.InfinoCallbackHandler(model_id: Optional[str] = None, model_version: Optional[str] = None, verbose: bool = False)[source]¶
Callback Handler that logs to Infino.
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__([model_id, model_version, verbose])
on_agent_action(action, **kwargs)
Do nothing when agent takes a specific action.
on_agent_finish(finish, **kwargs)
Do nothing.
on_chain_end(outputs, **kwargs)
Do nothing when LLM chain ends.
on_chain_error(error, **kwargs)
Need to log the error.
on_chain_start(serialized, inputs, **kwargs)
Do nothing when LLM chain starts.
on_chat_model_start(serialized, messages, *, ...)
Run when a chat model starts running.
on_llm_end(response, **kwargs)
Log the latency, error, token usage, and response to Infino.
on_llm_error(error, **kwargs)
Set the error flag.
on_llm_new_token(token, **kwargs)
Do nothing when a new token is generated.
on_llm_start(serialized, prompts, **kwargs)
Log the prompts to Infino, and set start time and error flag.
on_retriever_end(documents, *, run_id[, ...])
Run when Retriever ends running.