Skip to content
Source
Sign inSign up
TanStack/ai

fix(ai-client): include metadata on tool-call part types #2299

Openwillnie9(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/2299/headopened View on GitHub

Showing 2 changed files with 48 additions and 0 deletions.

x
0 of 2 viewed, 2 left
4 additions and 0 deletionspackages/ai-client/src/types.tsModified
View file
@@ -592,6 +592,7 @@
state: ToolCallState
output?: InferToolOutput<T>
resultMetadata?: InferToolResultMetadata<T>
+ metadata?: unknown
​
/**
@@ -612,6 +613,8 @@
output?: InferToolOutput<T>
/** App data the server tool set with `setResultMetadata` (typed from resultMetadataSchema) */
resultMetadata?: InferToolResultMetadata<T>
+ /** Provider-specific metadata that round-trips with the tool call */
+ metadata?: unknown
} & (NonNullable<T['needsApproval']> extends true
? {
/**
@@ -652,6 +655,7 @@
output?: any
resultMetadata?: unknown
+ metadata?: unknown
​
/**
44 additions and 0 deletionspackages/ai-client/tests/tool-types.test.tsModified
View file