On LLM end, send data to Arthur.
on_llm_error(error, **kwargs)
Do nothing when LLM outputs an error.
on_llm_new_token(token, **kwargs)
On new token, pass.
on_llm_start(serialized, prompts, **kwargs)
On LLM start, save the input prompts
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)
Do nothing
on_tool_end(output[, observation_prefix, ...])
Do nothing when tool ends.
on_tool_error(error, **kwargs)
Do nothing when tool outputs an error.
on_tool_start(serialized, input_str, **kwargs)
Do nothing when tool starts.
__init__(arthur_model: ArthurModel) → None[source]¶
Initialize callback handler.
classmethod from_credentials(model_id: str, arthur_url: Optional[str] = 'https://app.arthur.ai', arthur_login: Optional[str] = None, arthur_password: Optional[str] = None) → ArthurCallbackHandler[source]¶
Initialize callback handler from Arthur credentials.
Parameters
model_id (str) – The ID of the arthur model to log to.
arthur_url (str, optional) – The URL of the Arthur instance to log to.
Defaults to “https://app.arthur.ai”.