Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

TanStackRunMetadata.md

254 lines4.9 KB

Defined in: packages/ai/src/types.ts:801

Shape of metadata.tanstack on run events.

Properties

args?

optional args?: string;

Defined in: packages/ai/src/types.ts:837

The raw tool argument string on TOOL_CALL_END, as the provider sent it.


errorType?

optional errorType?: string;

Defined in: packages/ai/src/types.ts:830

On a RUN_ERROR. See RunErrorEvent.errorType.


finishReason?

optional finishReason?: "length" | "stop" | "content_filter" | "tool_calls" | null;

Defined in: packages/ai/src/types.ts:809


index?

optional index?: number;

Defined in: packages/ai/src/types.ts:824


input?

optional input?: unknown;

Defined in: packages/ai/src/types.ts:835

Parsed TOOL_CALL_END input. Spec TOOL_CALL_END has no top-level input.


interruptErrors?

optional interruptErrors?: readonly InterruptSubmissionError[];

Defined in: packages/ai/src/types.ts:820


loopStopped?

optional loopStopped?: boolean;

Defined in: packages/ai/src/types.ts:817

true on the last RUN_FINISHED of a run that the agent loop stopped before the model was done: agentLoopStrategy (for example maxIterations) or a middleware onShouldContinue returned false while tool results waited for the next model call. finishReason stays the reason of the last model call.


model?

optional model?: string;

Defined in: packages/ai/src/types.ts:803


rawText?

optional rawText?: string;

Defined in: packages/ai/src/types.ts:828

On a RUN_ERROR. See RunErrorEvent.rawText.


reasoningItem?

optional reasoningItem?: boolean;

Defined in: packages/ai/src/types.ts:808

See TanStackMessageMetadata.reasoningItem.


requestId?

optional requestId?: string;

Defined in: packages/ai/src/types.ts:832

On a RUN_ERROR. See RunErrorEvent.requestId.


responseId?

optional responseId?: string;

Defined in: packages/ai/src/types.ts:804


responseItems?

optional responseItems?: object[];

Defined in: packages/ai/src/types.ts:806

The answer items of this model call. See TanStackMessageMetadata.responseItems.

id

id: string;

phase?

optional phase?: string;

textLength?

optional textLength?: number;

UTF-16 text length, retaining item boundaries when adjacent text is merged.


retryAfterMs?

optional retryAfterMs?: number;

Defined in: packages/ai/src/types.ts:826

On a RUN_ERROR. See RunErrorEvent.retryAfterMs.


runId?

optional runId?: string;

Defined in: packages/ai/src/types.ts:822


sessionId?

optional sessionId?: string;

Defined in: packages/ai/src/types.ts:823


source?

optional source?: MessageSource;

Defined in: packages/ai/src/types.ts:802


state?

optional state?: ToolOutputState;

Defined in: packages/ai/src/types.ts:833


threadId?

optional threadId?: string;

Defined in: packages/ai/src/types.ts:821


usage?

optional usage?: TokenUsageLeftover;

Defined in: packages/ai/src/types.ts:819

TokenUsage fields that have no AG-UI usage[] equivalent.