AI Docs
API
Class References
Function References
- text
- textOptions
- combineStrategies
- convertMessagesToModelMessages
- convertZodToJsonSchema
- createReplayStream
- embedding
- generateMessageId
- maxIterations
- messages
- modelMessageToUIMessage
- modelMessagesToUIMessages
- normalizeToUIMessage
- parsePartialJSON
- summarize
- toServerSentEventsStream
- toServerSentEventsResponse
- toolDefinition
- uiMessageToModelMessages
- realtimeToken
- untilFinishReason
Interface References
- AIAdapter
- AIAdapterConfig
- AgentLoopState
- ApprovalRequestedStreamChunk
- AudioPart
- AudioVisualization
- BaseStreamChunk
- TextCompletionChunk
- TextOptions
- ChunkRecording
- ChunkStrategy
- ClientTool
- ContentPartSource
- ContentStreamChunk
- DefaultMessageMetadataByModality
- DocumentPart
- DoneStreamChunk
- EmbeddingOptions
- EmbeddingResult
- ErrorStreamChunk
- ImagePart
- InternalToolCallState
- JSONParser
- ModelMessage
- ProcessorResult
- ProcessorState
- RealtimeAdapter
- RealtimeClientOptions
- RealtimeConnection
- RealtimeMessage
- RealtimeSessionConfig
- RealtimeToken
- RealtimeTokenAdapter
- RealtimeTokenOptions
- ResponseFormat
- ServerTool
- StreamProcessorEvents
- StreamProcessorHandlers
- StreamProcessorOptions
- SummarizationOptions
- SummarizationResult
- TextPart
- ThinkingPart
- ThinkingStreamChunk
- Tool
- ToolCall
- ToolCallPart
- ToolCallStreamChunk
- ToolConfig
- ToolDefinition
- ToolDefinitionConfig
- ToolDefinitionInstance
- ToolInputAvailableStreamChunk
- ToolResultPart
- ToolResultStreamChunk
- UIMessage
- VideoPart
Type Alias References
- AgentLoopStrategy
- AnyClientTool
- TextStreamOptionsForModel
- TextStreamOptionsUnion
- ConstrainedContent
- ConstrainedModelMessage
- ContentPart
- ContentPartForModalities
- ExtractModalitiesForModel
- ExtractModelsFromAdapter
- InferToolInput
- InferToolName
- InferToolOutput
- MessagePart
- RealtimeEvent
- RealtimeMessagePart
- RealtimeMode
- RealtimeStatus
- ModalitiesArrayToUnion
- Modality
- StreamChunk
- StreamChunkType
- ToolCallState
- ToolResultState
Variable References
AI/LLM: This documentation page is available in plain markdown format at/ai/latest/docs/reference/interfaces/RunFinishedEvent.md
RunFinishedEvent
Defined in: packages/ai/src/types.ts:1590
Emitted when a run completes successfully.
@ag-ui/core provides: threadId, runId, result?, outcome? Spec usage[] is provider/model token counts. TanStack leftovers live in metadata.tanstack.
Extends#
- Pick<AGUIRunFinishedEvent, "threadId" | "runId" | "result" | "outcome" | "timestamp" | "rawEvent">
Properties#
finishReason?#
ts
optional finishReason?: "length" | "stop" | "content_filter" | "tool_calls" | null;Defined in: packages/ai/src/types.ts:1601
Restored on the client from metadata.tanstack.
metadata?#
ts
optional metadata?: object & Record<string, any>;Defined in: packages/ai/src/types.ts:1602
Type Declaration#
tanstack?#
ts
optional tanstack?: TanStackRunMetadata;model?#
ts
optional model?: string;Defined in: packages/ai/src/types.ts:1597
Restored on the client from metadata.tanstack.
responseId?#
ts
optional responseId?: string;Defined in: packages/ai/src/types.ts:1599
Provider generation ID. Restored from metadata.tanstack.
type#
ts
type: RUN_FINISHED;Defined in: packages/ai/src/types.ts:1594
usage?#
ts
optional usage?: TokenUsage<ProviderUsageDetails> | TokenUsage[];Defined in: packages/ai/src/types.ts:1595