{
  "$defs": {
    "Step": {
      "description": "One step of an agent's reasoning trace.\n\nAttributes:\n    index: Zero-based step number.\n    kind: Step kind (``thought``, ``action``, ``observation``, ``plan``,\n        ``reflection``, ``critique``, ``final``).\n    text: Free-text content for this step (thought/plan/critique/answer).\n    tool_call: The tool call made in this step, if any.",
      "properties": {
        "index": {
          "title": "Index",
          "type": "integer"
        },
        "kind": {
          "title": "Kind",
          "type": "string"
        },
        "text": {
          "default": "",
          "title": "Text",
          "type": "string"
        },
        "tool_call": {
          "anyOf": [
            {
              "$ref": "#/$defs/ToolCall"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "index",
        "kind"
      ],
      "title": "Step",
      "type": "object"
    },
    "ToolCall": {
      "description": "A single tool invocation within an agent step.\n\nAttributes:\n    tool: Tool name.\n    arguments: Arguments passed to the tool.\n    ok: Whether the call succeeded.\n    output: The tool's (possibly truncated) string output.",
      "properties": {
        "tool": {
          "title": "Tool",
          "type": "string"
        },
        "arguments": {
          "additionalProperties": true,
          "title": "Arguments",
          "type": "object"
        },
        "ok": {
          "default": true,
          "title": "Ok",
          "type": "boolean"
        },
        "output": {
          "default": "",
          "title": "Output",
          "type": "string"
        }
      },
      "required": [
        "tool"
      ],
      "title": "ToolCall",
      "type": "object"
    },
    "Usage": {
      "description": "Token accounting for a single request, normalised across providers.",
      "properties": {
        "prompt_tokens": {
          "default": 0,
          "title": "Prompt Tokens",
          "type": "integer"
        },
        "completion_tokens": {
          "default": 0,
          "title": "Completion Tokens",
          "type": "integer"
        },
        "total_tokens": {
          "default": 0,
          "title": "Total Tokens",
          "type": "integer"
        }
      },
      "title": "Usage",
      "type": "object"
    }
  },
  "description": "The outcome of an agent run.\n\nAttributes:\n    agent: The agent type that produced this.\n    task: The input task.\n    output: The final answer.\n    steps: The full reasoning/tool trace.\n    iterations: Number of reasoning iterations used.\n    usage: Aggregated token usage across LLM calls.\n    trace_id: Langfuse trace id, if tracing exported successfully.\n    provider: Resolved LLM provider that served the run (reproducibility;\n        set on the first LLM call, reflects the last call made).\n    model: Resolved chat model that served the run.\n    temperature: Effective sampling temperature of the run's LLM calls.",
  "properties": {
    "agent": {
      "title": "Agent",
      "type": "string"
    },
    "task": {
      "title": "Task",
      "type": "string"
    },
    "output": {
      "default": "",
      "title": "Output",
      "type": "string"
    },
    "steps": {
      "items": {
        "$ref": "#/$defs/Step"
      },
      "title": "Steps",
      "type": "array"
    },
    "iterations": {
      "default": 0,
      "title": "Iterations",
      "type": "integer"
    },
    "usage": {
      "$ref": "#/$defs/Usage"
    },
    "trace_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Trace Id"
    },
    "provider": {
      "default": "",
      "title": "Provider",
      "type": "string"
    },
    "model": {
      "default": "",
      "title": "Model",
      "type": "string"
    },
    "temperature": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Temperature"
    }
  },
  "required": [
    "agent",
    "task"
  ],
  "title": "AgentResult",
  "type": "object"
}
