append_to_last_tokens(token: str) → None[source]¶
check_if_answer_reached() → bool[source]¶
on_agent_action(action: AgentAction, **kwargs: Any) → Any¶
Run on agent action.
on_agent_finish(finish: AgentFinish, **kwargs: Any) → None¶
Run on agent end.
on_chain_end(outputs: Dict[str, Any], **kwargs: Any) → None¶
Run when chain ends running.
on_chain_error(error: BaseException, **kwargs: Any) → None¶
Run when chain errors.
on_chain_start(serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any) → None¶
Run when chain starts running.
on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], **kwargs: Any) → None¶
Run when LLM starts running.
on_llm_end(response: LLMResult, **kwargs: Any) → None¶
Run when LLM ends running.
on_llm_error(error: BaseException, **kwargs: Any) → None¶
Run when LLM errors.
on_llm_new_token(token: str, **kwargs: Any) → None[source]¶
Run on new LLM token. Only available when streaming is enabled.
on_llm_start(serialized: Dict[str, Any], prompts: List[str], **kwargs: Any) → None[source]¶
Run when LLM starts running.
on_retriever_end(documents: Sequence[Document], *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶
Run when Retriever ends running.
on_retriever_error(error: BaseException, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶