Response Structure
Therun.result object contains:
The Answer Field
Theanswer field contains the agent’s final response. Depending on your use case:
- Without structured output: A natural language string
- With structured output: A parsed object matching your schema (no JSON parsing needed)
Accessing Structured Answers
When usinganswerFormat, the answer is already a parsed object. See Structured Output for schema examples.
Understanding the Reasoning Field
Thereasoning field provides visibility into how the agent arrived at its answer. Each task in the array represents a step in the reasoning process.
Task Structure
Example Reasoning Trace
Extracting Tool Call Information
Loop through the reasoning to extract tool usage:Usage Information
Theusage field provides metrics about the run: