Skip to main content

agrag.eval.answer.final_answer

final_answer(result:AgentRunResult) -> str

Return the text of the last assistant message in an agent run.

Handles message dicts and LangChain message objects, and content that is a string or a list of blocks. Only text blocks count.

Parameters:

Raises:

  • ValueError – The run holds no assistant message.