Skip to main content
from definable.agent.run.agent import RunOutput, RunOutputEvent
from definable.agent.run import RunStatus

RunOutput

FieldTypeDescription
contentstrAgent’s text response.
content_typestr"text", "json", etc.
parsedBaseModel | NoneParsed structured output (when output_schema used).
run_idstrUnique run identifier.
agent_idstrAgent that produced this.
modelstrModel used.
statusRunStatusCompletion status.
messagesList[Message]Full conversation history.
metricsRunMetricsToken usage and timing.
imagesList[Image]Output images.
audioList[Audio]Output audio.
reasoning_stepsList[ReasoningStep]Thinking phase steps.

RunStatus

ValueDescription
COMPLETEDRun finished successfully.
ERRORRun failed with error.
BLOCKEDBlocked by guardrail.
CANCELLEDRun was cancelled.
MAX_ITERATIONSHit max iteration limit.

RunMetrics

FieldTypeDescription
total_tokensintTotal tokens used.
input_tokensintPrompt tokens.
output_tokensintCompletion tokens.
costfloatEstimated cost in USD.
durationfloatTotal duration in ms.

RunOutputEvent (Streaming)

FieldTypeDescription
eventstrEvent type name.
contentstr | NoneText chunk (for RunContent).
toolToolCallInfo | NoneTool call info (for ToolCall events).
metricsRunMetrics | NoneFinal metrics (for RunCompleted).
outputRunOutput | NoneFinal output (for RunCompleted).

Event Types

EventDescription
RunStartedExecution began.
RunContentText chunk.
RunContentCompletedContent generation done.
ToolCallStartedTool about to execute.
ToolCallCompletedTool finished.
ToolCallErrorTool failed.
ReasoningStartedThinking began.
ReasoningStepA reasoning step.
ReasoningCompletedThinking done.
KnowledgeRetrievalStartedRAG retrieval began.
KnowledgeRetrievalCompletedRAG retrieval done.
MemoryRecallStartedMemory recall began.
MemoryRecallCompletedMemory recall done.
RunCompletedEntire run finished.
RunErrorRun failed.