diff --git a/docs/reference/classes/ConsoleLogger.md b/docs/reference/classes/ConsoleLogger.md new file mode 100644 index 000000000..400b565de --- /dev/null +++ b/docs/reference/classes/ConsoleLogger.md @@ -0,0 +1,146 @@ +--- +id: ConsoleLogger +title: ConsoleLogger +--- + +# Class: ConsoleLogger + +Defined in: [packages/typescript/ai/src/logger/console-logger.ts:25](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/console-logger.ts#L25) + +Pluggable logger interface consumed by every `@tanstack/ai` activity when `debug` is enabled. Supply a custom implementation via `debug: { logger }` on `chat()`, `summarize()`, `generateImage()`, etc. The four methods correspond to log levels: use `debug` for chunk-level diagnostic output, `info`/`warn` for notable events, `error` for caught exceptions. + +## Implements + +- [`Logger`](../interfaces/Logger.md) + +## Constructors + +### Constructor + +```ts +new ConsoleLogger(): ConsoleLogger; +``` + +#### Returns + +`ConsoleLogger` + +## Methods + +### debug() + +```ts +debug(message, meta?): void; +``` + +Defined in: [packages/typescript/ai/src/logger/console-logger.ts:27](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/console-logger.ts#L27) + +Log a debug-level message; forwards to `console.debug`. + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +#### Returns + +`void` + +#### Implementation of + +[`Logger`](../interfaces/Logger.md).[`debug`](../interfaces/Logger.md#debug) + +*** + +### error() + +```ts +error(message, meta?): void; +``` + +Defined in: [packages/typescript/ai/src/logger/console-logger.ts:45](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/console-logger.ts#L45) + +Log an error-level message; forwards to `console.error`. + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +#### Returns + +`void` + +#### Implementation of + +[`Logger`](../interfaces/Logger.md).[`error`](../interfaces/Logger.md#error) + +*** + +### info() + +```ts +info(message, meta?): void; +``` + +Defined in: [packages/typescript/ai/src/logger/console-logger.ts:33](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/console-logger.ts#L33) + +Log an info-level message; forwards to `console.info`. + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +#### Returns + +`void` + +#### Implementation of + +[`Logger`](../interfaces/Logger.md).[`info`](../interfaces/Logger.md#info) + +*** + +### warn() + +```ts +warn(message, meta?): void; +``` + +Defined in: [packages/typescript/ai/src/logger/console-logger.ts:39](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/console-logger.ts#L39) + +Log a warning-level message; forwards to `console.warn`. + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +#### Returns + +`void` + +#### Implementation of + +[`Logger`](../interfaces/Logger.md).[`warn`](../interfaces/Logger.md#warn) diff --git a/docs/reference/functions/chat.md b/docs/reference/functions/chat.md index 9d8c7315a..f65c579a8 100644 --- a/docs/reference/functions/chat.md +++ b/docs/reference/functions/chat.md @@ -9,7 +9,7 @@ title: chat function chat(options): TextActivityResult; ``` -Defined in: [packages/typescript/ai/src/activities/chat/index.ts:1451](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/index.ts#L1451) +Defined in: [packages/typescript/ai/src/activities/chat/index.ts:1512](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/index.ts#L1512) Text activity - handles agentic text generation, one-shot text generation, and agentic structured output. diff --git a/docs/reference/functions/createChatOptions.md b/docs/reference/functions/createChatOptions.md index 06f56e2fd..a05f78cf2 100644 --- a/docs/reference/functions/createChatOptions.md +++ b/docs/reference/functions/createChatOptions.md @@ -9,7 +9,7 @@ title: createChatOptions function createChatOptions(options): TextActivityOptions; ``` -Defined in: [packages/typescript/ai/src/activities/chat/index.ts:203](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/index.ts#L203) +Defined in: [packages/typescript/ai/src/activities/chat/index.ts:213](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/index.ts#L213) Create typed options for the chat() function without executing. This is useful for pre-defining configurations with full type inference. diff --git a/docs/reference/functions/createImageOptions.md b/docs/reference/functions/createImageOptions.md index 041ad8dd5..af24183cc 100644 --- a/docs/reference/functions/createImageOptions.md +++ b/docs/reference/functions/createImageOptions.md @@ -9,7 +9,7 @@ title: createImageOptions function createImageOptions(options): ImageActivityOptions; ``` -Defined in: [packages/typescript/ai/src/activities/generateImage/index.ts:244](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateImage/index.ts#L244) +Defined in: [packages/typescript/ai/src/activities/generateImage/index.ts:270](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateImage/index.ts#L270) Create typed options for the generateImage() function without executing. diff --git a/docs/reference/functions/createSpeechOptions.md b/docs/reference/functions/createSpeechOptions.md index e6df25ebb..c28f1d955 100644 --- a/docs/reference/functions/createSpeechOptions.md +++ b/docs/reference/functions/createSpeechOptions.md @@ -9,7 +9,7 @@ title: createSpeechOptions function createSpeechOptions(options): TTSActivityOptions; ``` -Defined in: [packages/typescript/ai/src/activities/generateSpeech/index.ts:181](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateSpeech/index.ts#L181) +Defined in: [packages/typescript/ai/src/activities/generateSpeech/index.ts:213](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateSpeech/index.ts#L213) Create typed options for the generateSpeech() function without executing. diff --git a/docs/reference/functions/createSummarizeOptions.md b/docs/reference/functions/createSummarizeOptions.md index 89ef07c99..4423c9e1b 100644 --- a/docs/reference/functions/createSummarizeOptions.md +++ b/docs/reference/functions/createSummarizeOptions.md @@ -9,7 +9,7 @@ title: createSummarizeOptions function createSummarizeOptions(options): SummarizeActivityOptions; ``` -Defined in: [packages/typescript/ai/src/activities/summarize/index.ts:254](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/summarize/index.ts#L254) +Defined in: [packages/typescript/ai/src/activities/summarize/index.ts:300](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/summarize/index.ts#L300) Create typed options for the summarize() function without executing. diff --git a/docs/reference/functions/createTranscriptionOptions.md b/docs/reference/functions/createTranscriptionOptions.md index 1013de271..bd6fbbc4b 100644 --- a/docs/reference/functions/createTranscriptionOptions.md +++ b/docs/reference/functions/createTranscriptionOptions.md @@ -9,7 +9,7 @@ title: createTranscriptionOptions function createTranscriptionOptions(options): TranscriptionActivityOptions; ``` -Defined in: [packages/typescript/ai/src/activities/generateTranscription/index.ts:199](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateTranscription/index.ts#L199) +Defined in: [packages/typescript/ai/src/activities/generateTranscription/index.ts:231](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateTranscription/index.ts#L231) Create typed options for the generateTranscription() function without executing. diff --git a/docs/reference/functions/createVideoOptions.md b/docs/reference/functions/createVideoOptions.md index 5a022e189..ad322b459 100644 --- a/docs/reference/functions/createVideoOptions.md +++ b/docs/reference/functions/createVideoOptions.md @@ -9,7 +9,7 @@ title: createVideoOptions function createVideoOptions(options): VideoCreateOptions; ``` -Defined in: [packages/typescript/ai/src/activities/generateVideo/index.ts:488](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateVideo/index.ts#L488) +Defined in: [packages/typescript/ai/src/activities/generateVideo/index.ts:547](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateVideo/index.ts#L547) Create typed options for the generateVideo() function without executing. diff --git a/docs/reference/functions/generateImage.md b/docs/reference/functions/generateImage.md index b83ede64c..bd3d002b3 100644 --- a/docs/reference/functions/generateImage.md +++ b/docs/reference/functions/generateImage.md @@ -9,7 +9,7 @@ title: generateImage function generateImage(options): ImageActivityResult; ``` -Defined in: [packages/typescript/ai/src/activities/generateImage/index.ts:167](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateImage/index.ts#L167) +Defined in: [packages/typescript/ai/src/activities/generateImage/index.ts:176](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateImage/index.ts#L176) Image activity - generates images from text prompts. diff --git a/docs/reference/functions/generateSpeech.md b/docs/reference/functions/generateSpeech.md index ccc909cfc..c33d777dc 100644 --- a/docs/reference/functions/generateSpeech.md +++ b/docs/reference/functions/generateSpeech.md @@ -9,7 +9,7 @@ title: generateSpeech function generateSpeech(options): TTSActivityResult; ``` -Defined in: [packages/typescript/ai/src/activities/generateSpeech/index.ts:119](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateSpeech/index.ts#L119) +Defined in: [packages/typescript/ai/src/activities/generateSpeech/index.ts:128](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateSpeech/index.ts#L128) TTS activity - generates speech from text. diff --git a/docs/reference/functions/generateTranscription.md b/docs/reference/functions/generateTranscription.md index 3bf6ec8c7..bfa949fc4 100644 --- a/docs/reference/functions/generateTranscription.md +++ b/docs/reference/functions/generateTranscription.md @@ -9,7 +9,7 @@ title: generateTranscription function generateTranscription(options): TranscriptionActivityResult; ``` -Defined in: [packages/typescript/ai/src/activities/generateTranscription/index.ts:134](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateTranscription/index.ts#L134) +Defined in: [packages/typescript/ai/src/activities/generateTranscription/index.ts:143](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateTranscription/index.ts#L143) Transcription activity - converts audio to text. diff --git a/docs/reference/functions/generateVideo.md b/docs/reference/functions/generateVideo.md index 22cc2693e..f679c5fa6 100644 --- a/docs/reference/functions/generateVideo.md +++ b/docs/reference/functions/generateVideo.md @@ -9,7 +9,7 @@ title: generateVideo function generateVideo(options): TStream extends true ? AsyncIterable : Promise; ``` -Defined in: [packages/typescript/ai/src/activities/generateVideo/index.ts:221](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateVideo/index.ts#L221) +Defined in: [packages/typescript/ai/src/activities/generateVideo/index.ts:230](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateVideo/index.ts#L230) **`Experimental`** diff --git a/docs/reference/functions/getVideoJobStatus.md b/docs/reference/functions/getVideoJobStatus.md index 3e057d759..44247c5b5 100644 --- a/docs/reference/functions/getVideoJobStatus.md +++ b/docs/reference/functions/getVideoJobStatus.md @@ -14,7 +14,7 @@ function getVideoJobStatus(options): Promise<{ }>; ``` -Defined in: [packages/typescript/ai/src/activities/generateVideo/index.ts:388](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateVideo/index.ts#L388) +Defined in: [packages/typescript/ai/src/activities/generateVideo/index.ts:447](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/generateVideo/index.ts#L447) **`Experimental`** diff --git a/docs/reference/functions/summarize.md b/docs/reference/functions/summarize.md index dfa9201fc..e35280189 100644 --- a/docs/reference/functions/summarize.md +++ b/docs/reference/functions/summarize.md @@ -9,7 +9,7 @@ title: summarize function summarize(options): SummarizeActivityResult; ``` -Defined in: [packages/typescript/ai/src/activities/summarize/index.ts:147](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/summarize/index.ts#L147) +Defined in: [packages/typescript/ai/src/activities/summarize/index.ts:156](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/summarize/index.ts#L156) Summarize activity - generates summaries from text. diff --git a/docs/reference/index.md b/docs/reference/index.md index 0a9c3eb8b..d74201b3c 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -9,6 +9,7 @@ title: "@tanstack/ai" - [BatchStrategy](classes/BatchStrategy.md) - [CompositeStrategy](classes/CompositeStrategy.md) +- [ConsoleLogger](classes/ConsoleLogger.md) - [ImmediateStrategy](classes/ImmediateStrategy.md) - [PartialJSONParser](classes/PartialJSONParser.md) - [PunctuationStrategy](classes/PunctuationStrategy.md) @@ -33,6 +34,8 @@ title: "@tanstack/ai" - [ContentPartDataSource](interfaces/ContentPartDataSource.md) - [ContentPartUrlSource](interfaces/ContentPartUrlSource.md) - [CustomEvent](interfaces/CustomEvent.md) +- [DebugCategories](interfaces/DebugCategories.md) +- [DebugConfig](interfaces/DebugConfig.md) - [DefaultMessageMetadataByModality](interfaces/DefaultMessageMetadataByModality.md) - [DocumentPart](interfaces/DocumentPart.md) - [ErrorInfo](interfaces/ErrorInfo.md) @@ -47,6 +50,7 @@ title: "@tanstack/ai" - [IterationInfo](interfaces/IterationInfo.md) - [JSONParser](interfaces/JSONParser.md) - [JSONSchema](interfaces/JSONSchema.md) +- [Logger](interfaces/Logger.md) - [MessagesSnapshotEvent](interfaces/MessagesSnapshotEvent.md) - [ModelMessage](interfaces/ModelMessage.md) - [ProcessorResult](interfaces/ProcessorResult.md) @@ -146,6 +150,7 @@ title: "@tanstack/ai" - [ContentPart](type-aliases/ContentPart.md) - [ContentPartForInputModalitiesTypes](type-aliases/ContentPartForInputModalitiesTypes.md) - [ContentPartSource](type-aliases/ContentPartSource.md) +- [DebugOption](type-aliases/DebugOption.md) - [InferSchemaType](type-aliases/InferSchemaType.md) - [InferToolInput](type-aliases/InferToolInput.md) - [InferToolName](type-aliases/InferToolName.md) diff --git a/docs/reference/interfaces/AgentLoopState.md b/docs/reference/interfaces/AgentLoopState.md index 534d0a714..7135a6645 100644 --- a/docs/reference/interfaces/AgentLoopState.md +++ b/docs/reference/interfaces/AgentLoopState.md @@ -5,7 +5,7 @@ title: AgentLoopState # Interface: AgentLoopState -Defined in: [packages/typescript/ai/src/types.ts:630](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L630) +Defined in: [packages/typescript/ai/src/types.ts:631](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L631) State passed to agent loop strategy for determining whether to continue @@ -17,7 +17,7 @@ State passed to agent loop strategy for determining whether to continue finishReason: string | null; ``` -Defined in: [packages/typescript/ai/src/types.ts:636](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L636) +Defined in: [packages/typescript/ai/src/types.ts:637](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L637) Finish reason from the last response @@ -29,7 +29,7 @@ Finish reason from the last response iterationCount: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:632](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L632) +Defined in: [packages/typescript/ai/src/types.ts:633](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L633) Current iteration count (0-indexed) @@ -44,6 +44,6 @@ messages: ModelMessage< | null>[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:634](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L634) +Defined in: [packages/typescript/ai/src/types.ts:635](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L635) Current messages array diff --git a/docs/reference/interfaces/AudioPart.md b/docs/reference/interfaces/AudioPart.md index e968a1ccc..f9aae479b 100644 --- a/docs/reference/interfaces/AudioPart.md +++ b/docs/reference/interfaces/AudioPart.md @@ -5,7 +5,7 @@ title: AudioPart # Interface: AudioPart\ -Defined in: [packages/typescript/ai/src/types.ts:201](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L201) +Defined in: [packages/typescript/ai/src/types.ts:202](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L202) Audio content part for multimodal messages. @@ -25,7 +25,7 @@ Provider-specific metadata type optional metadata: TMetadata; ``` -Defined in: [packages/typescript/ai/src/types.ts:206](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L206) +Defined in: [packages/typescript/ai/src/types.ts:207](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L207) Provider-specific metadata (e.g., format, sample rate) @@ -37,7 +37,7 @@ Provider-specific metadata (e.g., format, sample rate) source: ContentPartSource; ``` -Defined in: [packages/typescript/ai/src/types.ts:204](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L204) +Defined in: [packages/typescript/ai/src/types.ts:205](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L205) Source of the audio content @@ -49,4 +49,4 @@ Source of the audio content type: "audio"; ``` -Defined in: [packages/typescript/ai/src/types.ts:202](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L202) +Defined in: [packages/typescript/ai/src/types.ts:203](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L203) diff --git a/docs/reference/interfaces/BaseAGUIEvent.md b/docs/reference/interfaces/BaseAGUIEvent.md index 64cec4272..c2d5a5557 100644 --- a/docs/reference/interfaces/BaseAGUIEvent.md +++ b/docs/reference/interfaces/BaseAGUIEvent.md @@ -5,7 +5,7 @@ title: BaseAGUIEvent # Interface: BaseAGUIEvent -Defined in: [packages/typescript/ai/src/types.ts:785](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L785) +Defined in: [packages/typescript/ai/src/types.ts:794](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L794) Base structure for AG-UI events. Extends @ag-ui/core BaseEvent with TanStack AI additions. @@ -31,6 +31,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:787](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L787) +Defined in: [packages/typescript/ai/src/types.ts:796](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L796) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ContentPartDataSource.md b/docs/reference/interfaces/ContentPartDataSource.md index f97479f13..f56a29cbb 100644 --- a/docs/reference/interfaces/ContentPartDataSource.md +++ b/docs/reference/interfaces/ContentPartDataSource.md @@ -5,7 +5,7 @@ title: ContentPartDataSource # Interface: ContentPartDataSource -Defined in: [packages/typescript/ai/src/types.ts:142](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L142) +Defined in: [packages/typescript/ai/src/types.ts:143](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L143) Source specification for inline data content (base64). Requires a mimeType to ensure providers receive proper content type information. @@ -18,7 +18,7 @@ Requires a mimeType to ensure providers receive proper content type information. mimeType: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:155](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L155) +Defined in: [packages/typescript/ai/src/types.ts:156](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L156) The MIME type of the content (e.g., 'image/png', 'audio/wav'). Required for data sources to ensure proper handling by providers. @@ -31,7 +31,7 @@ Required for data sources to ensure proper handling by providers. type: "data"; ``` -Defined in: [packages/typescript/ai/src/types.ts:146](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L146) +Defined in: [packages/typescript/ai/src/types.ts:147](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L147) Indicates this is inline data content. @@ -43,6 +43,6 @@ Indicates this is inline data content. value: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:150](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L150) +Defined in: [packages/typescript/ai/src/types.ts:151](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L151) The base64-encoded content value. diff --git a/docs/reference/interfaces/ContentPartUrlSource.md b/docs/reference/interfaces/ContentPartUrlSource.md index a14d570ac..1c8847777 100644 --- a/docs/reference/interfaces/ContentPartUrlSource.md +++ b/docs/reference/interfaces/ContentPartUrlSource.md @@ -5,7 +5,7 @@ title: ContentPartUrlSource # Interface: ContentPartUrlSource -Defined in: [packages/typescript/ai/src/types.ts:162](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L162) +Defined in: [packages/typescript/ai/src/types.ts:163](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L163) Source specification for URL-based content. mimeType is optional as it can often be inferred from the URL or response headers. @@ -18,7 +18,7 @@ mimeType is optional as it can often be inferred from the URL or response header optional mimeType: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:174](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L174) +Defined in: [packages/typescript/ai/src/types.ts:175](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L175) Optional MIME type hint for cases where providers can't infer it from the URL. @@ -30,7 +30,7 @@ Optional MIME type hint for cases where providers can't infer it from the URL. type: "url"; ``` -Defined in: [packages/typescript/ai/src/types.ts:166](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L166) +Defined in: [packages/typescript/ai/src/types.ts:167](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L167) Indicates this is URL-referenced content. @@ -42,6 +42,6 @@ Indicates this is URL-referenced content. value: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:170](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L170) +Defined in: [packages/typescript/ai/src/types.ts:171](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L171) HTTP(S) URL or data URI pointing to the content. diff --git a/docs/reference/interfaces/CustomEvent.md b/docs/reference/interfaces/CustomEvent.md index 789f6cedf..1b213a7a8 100644 --- a/docs/reference/interfaces/CustomEvent.md +++ b/docs/reference/interfaces/CustomEvent.md @@ -5,7 +5,7 @@ title: CustomEvent # Interface: CustomEvent -Defined in: [packages/typescript/ai/src/types.ts:1033](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1033) +Defined in: [packages/typescript/ai/src/types.ts:1042](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1042) Custom event for extensibility. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1035](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1035) +Defined in: [packages/typescript/ai/src/types.ts:1044](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1044) Model identifier for multi-model support diff --git a/docs/reference/interfaces/DebugCategories.md b/docs/reference/interfaces/DebugCategories.md new file mode 100644 index 000000000..4cc461279 --- /dev/null +++ b/docs/reference/interfaces/DebugCategories.md @@ -0,0 +1,110 @@ +--- +id: DebugCategories +title: DebugCategories +--- + +# Interface: DebugCategories + +Defined in: [packages/typescript/ai/src/logger/types.ts:30](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L30) + +Per-category toggles for debug logging. Each flag enables or disables one class of log message. Unspecified flags default to `true` when `DebugConfig` is partially specified; `undefined` on the `debug` option defaults all flags to `false` except `errors`. + +## Extended by + +- [`DebugConfig`](DebugConfig.md) + +## Properties + +### agentLoop? + +```ts +optional agentLoop: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:50](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L50) + +Iteration markers and phase transitions in the chat agent loop. Chat-only. + +*** + +### config? + +```ts +optional config: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:54](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L54) + +Config transforms returned by middleware `onConfig` hooks. Chat-only. + +*** + +### errors? + +```ts +optional errors: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:58](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L58) + +Caught errors throughout the pipeline. Unlike other categories, defaults to `true` even when `debug` is unspecified. Explicitly set `errors: false` or `debug: false` to silence. + +*** + +### middleware? + +```ts +optional middleware: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:42](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L42) + +Inputs and outputs around each middleware hook invocation. Chat-only. + +*** + +### output? + +```ts +optional output: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:38](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L38) + +Chunks/results yielded to the consumer after all middleware. For streaming activities this fires per chunk; for non-streaming activities it fires once per result. + +*** + +### provider? + +```ts +optional provider: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:34](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L34) + +Raw chunks/frames received from a provider SDK (OpenAI, Anthropic, Gemini, Ollama, Grok, Groq, OpenRouter, fal, ElevenLabs). Emitted inside every streaming adapter's chunk loop. + +*** + +### request? + +```ts +optional request: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:62](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L62) + +Outgoing call metadata (provider, model, message/tool counts) emitted before each adapter SDK call. + +*** + +### tools? + +```ts +optional tools: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:46](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L46) + +Before/after tool-call execution in the chat agent loop. Chat-only. diff --git a/docs/reference/interfaces/DebugConfig.md b/docs/reference/interfaces/DebugConfig.md new file mode 100644 index 000000000..1bfd337ef --- /dev/null +++ b/docs/reference/interfaces/DebugConfig.md @@ -0,0 +1,154 @@ +--- +id: DebugConfig +title: DebugConfig +--- + +# Interface: DebugConfig + +Defined in: [packages/typescript/ai/src/logger/types.ts:68](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L68) + +Granular debug configuration combining per-category toggles with an optional custom logger. Any unspecified category flag defaults to `true`. + +## Extends + +- [`DebugCategories`](DebugCategories.md) + +## Properties + +### agentLoop? + +```ts +optional agentLoop: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:50](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L50) + +Iteration markers and phase transitions in the chat agent loop. Chat-only. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`agentLoop`](DebugCategories.md#agentloop) + +*** + +### config? + +```ts +optional config: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:54](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L54) + +Config transforms returned by middleware `onConfig` hooks. Chat-only. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`config`](DebugCategories.md#config) + +*** + +### errors? + +```ts +optional errors: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:58](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L58) + +Caught errors throughout the pipeline. Unlike other categories, defaults to `true` even when `debug` is unspecified. Explicitly set `errors: false` or `debug: false` to silence. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`errors`](DebugCategories.md#errors) + +*** + +### logger? + +```ts +optional logger: Logger; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:72](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L72) + +Custom `Logger` implementation. When omitted, a default `ConsoleLogger` routes output to `console.debug`/`info`/`warn`/`error`. + +*** + +### middleware? + +```ts +optional middleware: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:42](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L42) + +Inputs and outputs around each middleware hook invocation. Chat-only. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`middleware`](DebugCategories.md#middleware) + +*** + +### output? + +```ts +optional output: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:38](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L38) + +Chunks/results yielded to the consumer after all middleware. For streaming activities this fires per chunk; for non-streaming activities it fires once per result. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`output`](DebugCategories.md#output) + +*** + +### provider? + +```ts +optional provider: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:34](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L34) + +Raw chunks/frames received from a provider SDK (OpenAI, Anthropic, Gemini, Ollama, Grok, Groq, OpenRouter, fal, ElevenLabs). Emitted inside every streaming adapter's chunk loop. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`provider`](DebugCategories.md#provider) + +*** + +### request? + +```ts +optional request: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:62](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L62) + +Outgoing call metadata (provider, model, message/tool counts) emitted before each adapter SDK call. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`request`](DebugCategories.md#request) + +*** + +### tools? + +```ts +optional tools: boolean; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:46](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L46) + +Before/after tool-call execution in the chat agent loop. Chat-only. + +#### Inherited from + +[`DebugCategories`](DebugCategories.md).[`tools`](DebugCategories.md#tools) diff --git a/docs/reference/interfaces/DefaultMessageMetadataByModality.md b/docs/reference/interfaces/DefaultMessageMetadataByModality.md index 508ed7020..d6e52317d 100644 --- a/docs/reference/interfaces/DefaultMessageMetadataByModality.md +++ b/docs/reference/interfaces/DefaultMessageMetadataByModality.md @@ -5,7 +5,7 @@ title: DefaultMessageMetadataByModality # Interface: DefaultMessageMetadataByModality -Defined in: [packages/typescript/ai/src/types.ts:1421](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1421) +Defined in: [packages/typescript/ai/src/types.ts:1457](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1457) Default metadata type for adapters that don't define custom metadata. Uses unknown for all modalities. @@ -18,7 +18,7 @@ Uses unknown for all modalities. audio: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:1424](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1424) +Defined in: [packages/typescript/ai/src/types.ts:1460](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1460) *** @@ -28,7 +28,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1424](https://github.com/TanSta document: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:1426](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1426) +Defined in: [packages/typescript/ai/src/types.ts:1462](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1462) *** @@ -38,7 +38,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1426](https://github.com/TanSta image: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:1423](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1423) +Defined in: [packages/typescript/ai/src/types.ts:1459](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1459) *** @@ -48,7 +48,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1423](https://github.com/TanSta text: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:1422](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1422) +Defined in: [packages/typescript/ai/src/types.ts:1458](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1458) *** @@ -58,4 +58,4 @@ Defined in: [packages/typescript/ai/src/types.ts:1422](https://github.com/TanSta video: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:1425](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1425) +Defined in: [packages/typescript/ai/src/types.ts:1461](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1461) diff --git a/docs/reference/interfaces/DocumentPart.md b/docs/reference/interfaces/DocumentPart.md index 8f452df63..040f058af 100644 --- a/docs/reference/interfaces/DocumentPart.md +++ b/docs/reference/interfaces/DocumentPart.md @@ -5,7 +5,7 @@ title: DocumentPart # Interface: DocumentPart\ -Defined in: [packages/typescript/ai/src/types.ts:225](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L225) +Defined in: [packages/typescript/ai/src/types.ts:226](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L226) Document content part for multimodal messages (e.g., PDFs). @@ -25,7 +25,7 @@ Provider-specific metadata type (e.g., Anthropic's media_type) optional metadata: TMetadata; ``` -Defined in: [packages/typescript/ai/src/types.ts:230](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L230) +Defined in: [packages/typescript/ai/src/types.ts:231](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L231) Provider-specific metadata (e.g., media_type for PDFs) @@ -37,7 +37,7 @@ Provider-specific metadata (e.g., media_type for PDFs) source: ContentPartSource; ``` -Defined in: [packages/typescript/ai/src/types.ts:228](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L228) +Defined in: [packages/typescript/ai/src/types.ts:229](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L229) Source of the document content @@ -49,4 +49,4 @@ Source of the document content type: "document"; ``` -Defined in: [packages/typescript/ai/src/types.ts:226](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L226) +Defined in: [packages/typescript/ai/src/types.ts:227](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L227) diff --git a/docs/reference/interfaces/GeneratedImage.md b/docs/reference/interfaces/GeneratedImage.md index 71e2eaf66..e964d6dcf 100644 --- a/docs/reference/interfaces/GeneratedImage.md +++ b/docs/reference/interfaces/GeneratedImage.md @@ -5,7 +5,7 @@ title: GeneratedImage # Interface: GeneratedImage -Defined in: [packages/typescript/ai/src/types.ts:1206](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1206) +Defined in: [packages/typescript/ai/src/types.ts:1225](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1225) A single generated image @@ -17,7 +17,7 @@ A single generated image optional b64Json: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1208](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1208) +Defined in: [packages/typescript/ai/src/types.ts:1227](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1227) Base64-encoded image data @@ -29,7 +29,7 @@ Base64-encoded image data optional revisedPrompt: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1212](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1212) +Defined in: [packages/typescript/ai/src/types.ts:1231](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1231) Revised prompt used by the model (if applicable) @@ -41,6 +41,6 @@ Revised prompt used by the model (if applicable) optional url: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1210](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1210) +Defined in: [packages/typescript/ai/src/types.ts:1229](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1229) URL to the generated image (may be temporary) diff --git a/docs/reference/interfaces/ImageGenerationOptions.md b/docs/reference/interfaces/ImageGenerationOptions.md index 532cbfb90..b7dca106b 100644 --- a/docs/reference/interfaces/ImageGenerationOptions.md +++ b/docs/reference/interfaces/ImageGenerationOptions.md @@ -5,7 +5,7 @@ title: ImageGenerationOptions # Interface: ImageGenerationOptions\ -Defined in: [packages/typescript/ai/src/types.ts:1187](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1187) +Defined in: [packages/typescript/ai/src/types.ts:1201](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1201) Options for image generation. These are the common options supported across providers. @@ -22,13 +22,26 @@ These are the common options supported across providers. ## Properties +### logger + +```ts +logger: InternalLogger; +``` + +Defined in: [packages/typescript/ai/src/types.ts:1219](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1219) + +Internal logger threaded from the generateImage() entry point. Adapters must +call logger.request() before the SDK call and logger.errors() in catch blocks. + +*** + ### model ```ts model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1192](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1192) +Defined in: [packages/typescript/ai/src/types.ts:1206](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1206) The model to use for image generation @@ -40,7 +53,7 @@ The model to use for image generation optional modelOptions: TProviderOptions; ``` -Defined in: [packages/typescript/ai/src/types.ts:1200](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1200) +Defined in: [packages/typescript/ai/src/types.ts:1214](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1214) Model-specific options for image generation @@ -52,7 +65,7 @@ Model-specific options for image generation optional numberOfImages: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1196](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1196) +Defined in: [packages/typescript/ai/src/types.ts:1210](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1210) Number of images to generate (default: 1) @@ -64,7 +77,7 @@ Number of images to generate (default: 1) prompt: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1194](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1194) +Defined in: [packages/typescript/ai/src/types.ts:1208](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1208) Text description of the desired image(s) @@ -76,6 +89,6 @@ Text description of the desired image(s) optional size: TSize; ``` -Defined in: [packages/typescript/ai/src/types.ts:1198](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1198) +Defined in: [packages/typescript/ai/src/types.ts:1212](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1212) Image size in WIDTHxHEIGHT format (e.g., "1024x1024") diff --git a/docs/reference/interfaces/ImageGenerationResult.md b/docs/reference/interfaces/ImageGenerationResult.md index d40aefa1e..7b4ab34ba 100644 --- a/docs/reference/interfaces/ImageGenerationResult.md +++ b/docs/reference/interfaces/ImageGenerationResult.md @@ -5,7 +5,7 @@ title: ImageGenerationResult # Interface: ImageGenerationResult -Defined in: [packages/typescript/ai/src/types.ts:1218](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1218) +Defined in: [packages/typescript/ai/src/types.ts:1237](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1237) Result of image generation @@ -17,7 +17,7 @@ Result of image generation id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1220](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1220) +Defined in: [packages/typescript/ai/src/types.ts:1239](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1239) Unique identifier for the generation @@ -29,7 +29,7 @@ Unique identifier for the generation images: GeneratedImage[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:1224](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1224) +Defined in: [packages/typescript/ai/src/types.ts:1243](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1243) Array of generated images @@ -41,7 +41,7 @@ Array of generated images model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1222](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1222) +Defined in: [packages/typescript/ai/src/types.ts:1241](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1241) Model used for generation @@ -53,7 +53,7 @@ Model used for generation optional usage: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:1226](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1226) +Defined in: [packages/typescript/ai/src/types.ts:1245](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1245) Token usage information (if available) diff --git a/docs/reference/interfaces/ImagePart.md b/docs/reference/interfaces/ImagePart.md index ddb7a6012..1cf7f928b 100644 --- a/docs/reference/interfaces/ImagePart.md +++ b/docs/reference/interfaces/ImagePart.md @@ -5,7 +5,7 @@ title: ImagePart # Interface: ImagePart\ -Defined in: [packages/typescript/ai/src/types.ts:189](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L189) +Defined in: [packages/typescript/ai/src/types.ts:190](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L190) Image content part for multimodal messages. @@ -25,7 +25,7 @@ Provider-specific metadata type (e.g., OpenAI's detail level) optional metadata: TMetadata; ``` -Defined in: [packages/typescript/ai/src/types.ts:194](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L194) +Defined in: [packages/typescript/ai/src/types.ts:195](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L195) Provider-specific metadata (e.g., OpenAI's detail: 'auto' | 'low' | 'high') @@ -37,7 +37,7 @@ Provider-specific metadata (e.g., OpenAI's detail: 'auto' | 'low' | 'high') source: ContentPartSource; ``` -Defined in: [packages/typescript/ai/src/types.ts:192](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L192) +Defined in: [packages/typescript/ai/src/types.ts:193](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L193) Source of the image content @@ -49,4 +49,4 @@ Source of the image content type: "image"; ``` -Defined in: [packages/typescript/ai/src/types.ts:190](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L190) +Defined in: [packages/typescript/ai/src/types.ts:191](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L191) diff --git a/docs/reference/interfaces/JSONSchema.md b/docs/reference/interfaces/JSONSchema.md index 20d4df6c9..23072a667 100644 --- a/docs/reference/interfaces/JSONSchema.md +++ b/docs/reference/interfaces/JSONSchema.md @@ -5,7 +5,7 @@ title: JSONSchema # Interface: JSONSchema -Defined in: [packages/typescript/ai/src/types.ts:51](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L51) +Defined in: [packages/typescript/ai/src/types.ts:52](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L52) JSON Schema type for defining tool input/output schemas as raw JSON Schema objects. This allows tools to be defined without schema libraries when you have JSON Schema definitions available. @@ -24,7 +24,7 @@ This allows tools to be defined without schema libraries when you have JSON Sche optional $defs: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:61](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L61) +Defined in: [packages/typescript/ai/src/types.ts:62](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L62) *** @@ -34,7 +34,7 @@ Defined in: [packages/typescript/ai/src/types.ts:61](https://github.com/TanStack optional $ref: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:60](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L60) +Defined in: [packages/typescript/ai/src/types.ts:61](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L61) *** @@ -44,7 +44,7 @@ Defined in: [packages/typescript/ai/src/types.ts:60](https://github.com/TanStack optional additionalItems: boolean | JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:82](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L82) +Defined in: [packages/typescript/ai/src/types.ts:83](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L83) *** @@ -54,7 +54,7 @@ Defined in: [packages/typescript/ai/src/types.ts:82](https://github.com/TanStack optional additionalProperties: boolean | JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:81](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L81) +Defined in: [packages/typescript/ai/src/types.ts:82](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L82) *** @@ -64,7 +64,7 @@ Defined in: [packages/typescript/ai/src/types.ts:81](https://github.com/TanStack optional allOf: JSONSchema[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:63](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L63) +Defined in: [packages/typescript/ai/src/types.ts:64](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L64) *** @@ -74,7 +74,7 @@ Defined in: [packages/typescript/ai/src/types.ts:63](https://github.com/TanStack optional anyOf: JSONSchema[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:64](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L64) +Defined in: [packages/typescript/ai/src/types.ts:65](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L65) *** @@ -84,7 +84,7 @@ Defined in: [packages/typescript/ai/src/types.ts:64](https://github.com/TanStack optional const: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:57](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L57) +Defined in: [packages/typescript/ai/src/types.ts:58](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L58) *** @@ -94,7 +94,7 @@ Defined in: [packages/typescript/ai/src/types.ts:57](https://github.com/TanStack optional default: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:59](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L59) +Defined in: [packages/typescript/ai/src/types.ts:60](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L60) *** @@ -104,7 +104,7 @@ Defined in: [packages/typescript/ai/src/types.ts:59](https://github.com/TanStack optional definitions: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:62](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L62) +Defined in: [packages/typescript/ai/src/types.ts:63](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L63) *** @@ -114,7 +114,7 @@ Defined in: [packages/typescript/ai/src/types.ts:62](https://github.com/TanStack optional description: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:58](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L58) +Defined in: [packages/typescript/ai/src/types.ts:59](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L59) *** @@ -124,7 +124,7 @@ Defined in: [packages/typescript/ai/src/types.ts:58](https://github.com/TanStack optional else: JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:69](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L69) +Defined in: [packages/typescript/ai/src/types.ts:70](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L70) *** @@ -134,7 +134,7 @@ Defined in: [packages/typescript/ai/src/types.ts:69](https://github.com/TanStack optional enum: unknown[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:56](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L56) +Defined in: [packages/typescript/ai/src/types.ts:57](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L57) *** @@ -144,7 +144,7 @@ Defined in: [packages/typescript/ai/src/types.ts:56](https://github.com/TanStack optional examples: unknown[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:88](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L88) +Defined in: [packages/typescript/ai/src/types.ts:89](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L89) *** @@ -154,7 +154,7 @@ Defined in: [packages/typescript/ai/src/types.ts:88](https://github.com/TanStack optional exclusiveMaximum: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:73](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L73) +Defined in: [packages/typescript/ai/src/types.ts:74](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L74) *** @@ -164,7 +164,7 @@ Defined in: [packages/typescript/ai/src/types.ts:73](https://github.com/TanStack optional exclusiveMinimum: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:72](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L72) +Defined in: [packages/typescript/ai/src/types.ts:73](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L73) *** @@ -174,7 +174,7 @@ Defined in: [packages/typescript/ai/src/types.ts:72](https://github.com/TanStack optional format: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:77](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L77) +Defined in: [packages/typescript/ai/src/types.ts:78](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L78) *** @@ -184,7 +184,7 @@ Defined in: [packages/typescript/ai/src/types.ts:77](https://github.com/TanStack optional if: JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:67](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L67) +Defined in: [packages/typescript/ai/src/types.ts:68](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L68) *** @@ -194,7 +194,7 @@ Defined in: [packages/typescript/ai/src/types.ts:67](https://github.com/TanStack optional items: JSONSchema | JSONSchema[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:54](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L54) +Defined in: [packages/typescript/ai/src/types.ts:55](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L55) *** @@ -204,7 +204,7 @@ Defined in: [packages/typescript/ai/src/types.ts:54](https://github.com/TanStack optional maximum: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:71](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L71) +Defined in: [packages/typescript/ai/src/types.ts:72](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L72) *** @@ -214,7 +214,7 @@ Defined in: [packages/typescript/ai/src/types.ts:71](https://github.com/TanStack optional maxItems: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:79](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L79) +Defined in: [packages/typescript/ai/src/types.ts:80](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L80) *** @@ -224,7 +224,7 @@ Defined in: [packages/typescript/ai/src/types.ts:79](https://github.com/TanStack optional maxLength: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:75](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L75) +Defined in: [packages/typescript/ai/src/types.ts:76](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L76) *** @@ -234,7 +234,7 @@ Defined in: [packages/typescript/ai/src/types.ts:75](https://github.com/TanStack optional maxProperties: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:86](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L86) +Defined in: [packages/typescript/ai/src/types.ts:87](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L87) *** @@ -244,7 +244,7 @@ Defined in: [packages/typescript/ai/src/types.ts:86](https://github.com/TanStack optional minimum: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:70](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L70) +Defined in: [packages/typescript/ai/src/types.ts:71](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L71) *** @@ -254,7 +254,7 @@ Defined in: [packages/typescript/ai/src/types.ts:70](https://github.com/TanStack optional minItems: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:78](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L78) +Defined in: [packages/typescript/ai/src/types.ts:79](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L79) *** @@ -264,7 +264,7 @@ Defined in: [packages/typescript/ai/src/types.ts:78](https://github.com/TanStack optional minLength: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:74](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L74) +Defined in: [packages/typescript/ai/src/types.ts:75](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L75) *** @@ -274,7 +274,7 @@ Defined in: [packages/typescript/ai/src/types.ts:74](https://github.com/TanStack optional minProperties: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:85](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L85) +Defined in: [packages/typescript/ai/src/types.ts:86](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L86) *** @@ -284,7 +284,7 @@ Defined in: [packages/typescript/ai/src/types.ts:85](https://github.com/TanStack optional not: JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:66](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L66) +Defined in: [packages/typescript/ai/src/types.ts:67](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L67) *** @@ -294,7 +294,7 @@ Defined in: [packages/typescript/ai/src/types.ts:66](https://github.com/TanStack optional oneOf: JSONSchema[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:65](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L65) +Defined in: [packages/typescript/ai/src/types.ts:66](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L66) *** @@ -304,7 +304,7 @@ Defined in: [packages/typescript/ai/src/types.ts:65](https://github.com/TanStack optional pattern: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:76](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L76) +Defined in: [packages/typescript/ai/src/types.ts:77](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L77) *** @@ -314,7 +314,7 @@ Defined in: [packages/typescript/ai/src/types.ts:76](https://github.com/TanStack optional patternProperties: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:83](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L83) +Defined in: [packages/typescript/ai/src/types.ts:84](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L84) *** @@ -324,7 +324,7 @@ Defined in: [packages/typescript/ai/src/types.ts:83](https://github.com/TanStack optional properties: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:53](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L53) +Defined in: [packages/typescript/ai/src/types.ts:54](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L54) *** @@ -334,7 +334,7 @@ Defined in: [packages/typescript/ai/src/types.ts:53](https://github.com/TanStack optional propertyNames: JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:84](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L84) +Defined in: [packages/typescript/ai/src/types.ts:85](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L85) *** @@ -344,7 +344,7 @@ Defined in: [packages/typescript/ai/src/types.ts:84](https://github.com/TanStack optional required: string[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:55](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L55) +Defined in: [packages/typescript/ai/src/types.ts:56](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L56) *** @@ -354,7 +354,7 @@ Defined in: [packages/typescript/ai/src/types.ts:55](https://github.com/TanStack optional then: JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:68](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L68) +Defined in: [packages/typescript/ai/src/types.ts:69](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L69) *** @@ -364,7 +364,7 @@ Defined in: [packages/typescript/ai/src/types.ts:68](https://github.com/TanStack optional title: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:87](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L87) +Defined in: [packages/typescript/ai/src/types.ts:88](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L88) *** @@ -374,7 +374,7 @@ Defined in: [packages/typescript/ai/src/types.ts:87](https://github.com/TanStack optional type: string | string[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:52](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L52) +Defined in: [packages/typescript/ai/src/types.ts:53](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L53) *** @@ -384,4 +384,4 @@ Defined in: [packages/typescript/ai/src/types.ts:52](https://github.com/TanStack optional uniqueItems: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:80](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L80) +Defined in: [packages/typescript/ai/src/types.ts:81](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L81) diff --git a/docs/reference/interfaces/Logger.md b/docs/reference/interfaces/Logger.md new file mode 100644 index 000000000..05463eeba --- /dev/null +++ b/docs/reference/interfaces/Logger.md @@ -0,0 +1,122 @@ +--- +id: Logger +title: Logger +--- + +# Interface: Logger + +Defined in: [packages/typescript/ai/src/logger/types.ts:4](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L4) + +Pluggable logger interface consumed by every `@tanstack/ai` activity when `debug` is enabled. Supply a custom implementation via `debug: { logger }` on `chat()`, `summarize()`, `generateImage()`, etc. The four methods correspond to log levels: use `debug` for chunk-level diagnostic output, `info`/`warn` for notable events, `error` for caught exceptions. + +## Properties + +### debug() + +```ts +debug: (message, meta?) => void; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:9](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L9) + +Called for chunk-level diagnostic output (raw provider chunks, per-chunk output, agent-loop iteration markers). + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +Structured data forwarded to the underlying logger. Loggers like pino will preserve this as a structured record; console-based loggers pass it as the second argument to `console.`. + +#### Returns + +`void` + +*** + +### error() + +```ts +error: (message, meta?) => void; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:24](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L24) + +Called for caught exceptions throughout the pipeline. + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +Structured data forwarded to the underlying logger. Loggers like pino will preserve this as a structured record; console-based loggers pass it as the second argument to `console.`. + +#### Returns + +`void` + +*** + +### info() + +```ts +info: (message, meta?) => void; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:14](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L14) + +Called for notable informational events (outgoing requests, tool invocations, middleware transitions). + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +Structured data forwarded to the underlying logger. Loggers like pino will preserve this as a structured record; console-based loggers pass it as the second argument to `console.`. + +#### Returns + +`void` + +*** + +### warn() + +```ts +warn: (message, meta?) => void; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:19](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L19) + +Called for notable warnings that don't halt execution (deprecations, recoverable anomalies). + +#### Parameters + +##### message + +`string` + +##### meta? + +`Record`\<`string`, `unknown`\> + +Structured data forwarded to the underlying logger. Loggers like pino will preserve this as a structured record; console-based loggers pass it as the second argument to `console.`. + +#### Returns + +`void` diff --git a/docs/reference/interfaces/MessagesSnapshotEvent.md b/docs/reference/interfaces/MessagesSnapshotEvent.md index a97713b08..7a41d6d2c 100644 --- a/docs/reference/interfaces/MessagesSnapshotEvent.md +++ b/docs/reference/interfaces/MessagesSnapshotEvent.md @@ -5,7 +5,7 @@ title: MessagesSnapshotEvent # Interface: MessagesSnapshotEvent -Defined in: [packages/typescript/ai/src/types.ts:995](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L995) +Defined in: [packages/typescript/ai/src/types.ts:1004](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1004) Emitted to provide a snapshot of all messages in a conversation. @@ -36,6 +36,6 @@ Use converters to transform to/from TanStack UIMessage format. optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:997](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L997) +Defined in: [packages/typescript/ai/src/types.ts:1006](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1006) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ModelMessage.md b/docs/reference/interfaces/ModelMessage.md index a1842db18..f1a8187a6 100644 --- a/docs/reference/interfaces/ModelMessage.md +++ b/docs/reference/interfaces/ModelMessage.md @@ -5,7 +5,7 @@ title: ModelMessage # Interface: ModelMessage\ -Defined in: [packages/typescript/ai/src/types.ts:288](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L288) +Defined in: [packages/typescript/ai/src/types.ts:289](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L289) ## Type Parameters @@ -21,7 +21,7 @@ Defined in: [packages/typescript/ai/src/types.ts:288](https://github.com/TanStac content: TContent; ``` -Defined in: [packages/typescript/ai/src/types.ts:295](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L295) +Defined in: [packages/typescript/ai/src/types.ts:296](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L296) *** @@ -31,7 +31,7 @@ Defined in: [packages/typescript/ai/src/types.ts:295](https://github.com/TanStac optional name: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:296](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L296) +Defined in: [packages/typescript/ai/src/types.ts:297](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L297) *** @@ -41,7 +41,7 @@ Defined in: [packages/typescript/ai/src/types.ts:296](https://github.com/TanStac role: "user" | "assistant" | "tool"; ``` -Defined in: [packages/typescript/ai/src/types.ts:294](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L294) +Defined in: [packages/typescript/ai/src/types.ts:295](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L295) *** @@ -51,7 +51,7 @@ Defined in: [packages/typescript/ai/src/types.ts:294](https://github.com/TanStac optional toolCallId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:298](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L298) +Defined in: [packages/typescript/ai/src/types.ts:299](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L299) *** @@ -61,4 +61,4 @@ Defined in: [packages/typescript/ai/src/types.ts:298](https://github.com/TanStac optional toolCalls: ToolCall[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:297](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L297) +Defined in: [packages/typescript/ai/src/types.ts:298](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L298) diff --git a/docs/reference/interfaces/ProviderTool.md b/docs/reference/interfaces/ProviderTool.md index be6015ffc..19a6efc20 100644 --- a/docs/reference/interfaces/ProviderTool.md +++ b/docs/reference/interfaces/ProviderTool.md @@ -65,7 +65,7 @@ Defined in: [packages/typescript/ai/src/tools/provider-tool.ts:24](https://githu description: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:439](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L439) +Defined in: [packages/typescript/ai/src/types.ts:440](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L440) Clear description of what the tool does. @@ -90,7 +90,7 @@ Be specific about what the tool does, what parameters it needs, and what it retu optional execute: (args, context?) => any; ``` -Defined in: [packages/typescript/ai/src/types.ts:519](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L519) +Defined in: [packages/typescript/ai/src/types.ts:520](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L520) Optional function to execute when the model calls this tool. @@ -138,7 +138,7 @@ execute: async (args) => { optional inputSchema: SchemaInput; ``` -Defined in: [packages/typescript/ai/src/types.ts:479](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L479) +Defined in: [packages/typescript/ai/src/types.ts:480](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L480) Schema describing the tool's input parameters. @@ -196,7 +196,7 @@ type({ optional lazy: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:525](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L525) +Defined in: [packages/typescript/ai/src/types.ts:526](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L526) If true, this tool is lazy and will only be sent to the LLM after being discovered via the lazy tool discovery mechanism. Only meaningful when used with chat(). @@ -212,7 +212,7 @@ If true, this tool is lazy and will only be sent to the LLM after being discover optional metadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:528](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L528) +Defined in: [packages/typescript/ai/src/types.ts:529](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L529) Additional metadata for adapters or custom extensions @@ -228,7 +228,7 @@ Additional metadata for adapters or custom extensions name: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:429](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L429) +Defined in: [packages/typescript/ai/src/types.ts:430](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L430) Unique name of the tool (used by the model to call it). @@ -253,7 +253,7 @@ Must be unique within the tools array. optional needsApproval: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:522](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L522) +Defined in: [packages/typescript/ai/src/types.ts:523](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L523) If true, tool execution requires user approval before running. Works with both server and client tools. @@ -269,7 +269,7 @@ If true, tool execution requires user approval before running. Works with both s optional outputSchema: SchemaInput; ``` -Defined in: [packages/typescript/ai/src/types.ts:500](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L500) +Defined in: [packages/typescript/ai/src/types.ts:501](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L501) Optional schema for validating tool output. diff --git a/docs/reference/interfaces/RealtimeSessionConfig.md b/docs/reference/interfaces/RealtimeSessionConfig.md index faa111957..a362658ed 100644 --- a/docs/reference/interfaces/RealtimeSessionConfig.md +++ b/docs/reference/interfaces/RealtimeSessionConfig.md @@ -74,7 +74,7 @@ Provider-specific options ### semanticEagerness? ```ts -optional semanticEagerness: "low" | "high" | "medium"; +optional semanticEagerness: "low" | "medium" | "high"; ``` Defined in: [packages/typescript/ai/src/realtime/types.ts:50](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/realtime/types.ts#L50) diff --git a/docs/reference/interfaces/ReasoningEncryptedValueEvent.md b/docs/reference/interfaces/ReasoningEncryptedValueEvent.md index 2b6742271..85e72381b 100644 --- a/docs/reference/interfaces/ReasoningEncryptedValueEvent.md +++ b/docs/reference/interfaces/ReasoningEncryptedValueEvent.md @@ -5,7 +5,7 @@ title: ReasoningEncryptedValueEvent # Interface: ReasoningEncryptedValueEvent -Defined in: [packages/typescript/ai/src/types.ts:1103](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1103) +Defined in: [packages/typescript/ai/src/types.ts:1112](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1112) Emitted for encrypted reasoning values. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1105](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1105) +Defined in: [packages/typescript/ai/src/types.ts:1114](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1114) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ReasoningEndEvent.md b/docs/reference/interfaces/ReasoningEndEvent.md index dba9ca353..afaa42e4b 100644 --- a/docs/reference/interfaces/ReasoningEndEvent.md +++ b/docs/reference/interfaces/ReasoningEndEvent.md @@ -5,7 +5,7 @@ title: ReasoningEndEvent # Interface: ReasoningEndEvent -Defined in: [packages/typescript/ai/src/types.ts:1092](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1092) +Defined in: [packages/typescript/ai/src/types.ts:1101](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1101) Emitted when reasoning ends for a message. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1094](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1094) +Defined in: [packages/typescript/ai/src/types.ts:1103](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1103) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ReasoningMessageContentEvent.md b/docs/reference/interfaces/ReasoningMessageContentEvent.md index a4fa35d31..7a5b9186d 100644 --- a/docs/reference/interfaces/ReasoningMessageContentEvent.md +++ b/docs/reference/interfaces/ReasoningMessageContentEvent.md @@ -5,7 +5,7 @@ title: ReasoningMessageContentEvent # Interface: ReasoningMessageContentEvent -Defined in: [packages/typescript/ai/src/types.ts:1070](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1070) +Defined in: [packages/typescript/ai/src/types.ts:1079](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1079) Emitted when reasoning message content is generated. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1072](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1072) +Defined in: [packages/typescript/ai/src/types.ts:1081](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1081) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ReasoningMessageEndEvent.md b/docs/reference/interfaces/ReasoningMessageEndEvent.md index f01ce57d4..c08bd1637 100644 --- a/docs/reference/interfaces/ReasoningMessageEndEvent.md +++ b/docs/reference/interfaces/ReasoningMessageEndEvent.md @@ -5,7 +5,7 @@ title: ReasoningMessageEndEvent # Interface: ReasoningMessageEndEvent -Defined in: [packages/typescript/ai/src/types.ts:1081](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1081) +Defined in: [packages/typescript/ai/src/types.ts:1090](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1090) Emitted when a reasoning message ends. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1083](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1083) +Defined in: [packages/typescript/ai/src/types.ts:1092](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1092) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ReasoningMessageStartEvent.md b/docs/reference/interfaces/ReasoningMessageStartEvent.md index 94e730e08..277d1377f 100644 --- a/docs/reference/interfaces/ReasoningMessageStartEvent.md +++ b/docs/reference/interfaces/ReasoningMessageStartEvent.md @@ -5,7 +5,7 @@ title: ReasoningMessageStartEvent # Interface: ReasoningMessageStartEvent -Defined in: [packages/typescript/ai/src/types.ts:1059](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1059) +Defined in: [packages/typescript/ai/src/types.ts:1068](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1068) Emitted when a reasoning message starts. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1061](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1061) +Defined in: [packages/typescript/ai/src/types.ts:1070](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1070) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ReasoningStartEvent.md b/docs/reference/interfaces/ReasoningStartEvent.md index 1c6d5b90d..96805bdd6 100644 --- a/docs/reference/interfaces/ReasoningStartEvent.md +++ b/docs/reference/interfaces/ReasoningStartEvent.md @@ -5,7 +5,7 @@ title: ReasoningStartEvent # Interface: ReasoningStartEvent -Defined in: [packages/typescript/ai/src/types.ts:1048](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1048) +Defined in: [packages/typescript/ai/src/types.ts:1057](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1057) Emitted when reasoning starts for a message. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1050](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1050) +Defined in: [packages/typescript/ai/src/types.ts:1059](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1059) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ResponseFormat.md b/docs/reference/interfaces/ResponseFormat.md index a2806c983..064c60c0f 100644 --- a/docs/reference/interfaces/ResponseFormat.md +++ b/docs/reference/interfaces/ResponseFormat.md @@ -5,7 +5,7 @@ title: ResponseFormat # Interface: ResponseFormat\ -Defined in: [packages/typescript/ai/src/types.ts:546](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L546) +Defined in: [packages/typescript/ai/src/types.ts:547](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L547) Structured output format specification. @@ -33,7 +33,7 @@ TypeScript type of the expected data structure (for type safety) optional __data: TData; ``` -Defined in: [packages/typescript/ai/src/types.ts:624](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L624) +Defined in: [packages/typescript/ai/src/types.ts:625](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L625) **`Internal`** @@ -50,7 +50,7 @@ Allows the SDK to know what type to expect when parsing the response. optional json_schema: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:563](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L563) +Defined in: [packages/typescript/ai/src/types.ts:564](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L564) JSON schema specification (required when type is "json_schema"). @@ -139,7 +139,7 @@ https://platform.openai.com/docs/guides/structured-outputs#strict-mode type: "json_object" | "json_schema"; ``` -Defined in: [packages/typescript/ai/src/types.ts:555](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L555) +Defined in: [packages/typescript/ai/src/types.ts:556](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L556) Type of structured output. diff --git a/docs/reference/interfaces/RunErrorEvent.md b/docs/reference/interfaces/RunErrorEvent.md index eb9f5f1f7..54d136c77 100644 --- a/docs/reference/interfaces/RunErrorEvent.md +++ b/docs/reference/interfaces/RunErrorEvent.md @@ -5,7 +5,7 @@ title: RunErrorEvent # Interface: RunErrorEvent -Defined in: [packages/typescript/ai/src/types.ts:831](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L831) +Defined in: [packages/typescript/ai/src/types.ts:840](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L840) Emitted when an error occurs during a run. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `error?` (deprecated nested form) optional error: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:838](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L838) +Defined in: [packages/typescript/ai/src/types.ts:847](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L847) #### ~~code?~~ @@ -57,6 +57,6 @@ Kept for backward compatibility. optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:833](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L833) +Defined in: [packages/typescript/ai/src/types.ts:842](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L842) Model identifier for multi-model support diff --git a/docs/reference/interfaces/RunFinishedEvent.md b/docs/reference/interfaces/RunFinishedEvent.md index 8fd6bc355..be612fbeb 100644 --- a/docs/reference/interfaces/RunFinishedEvent.md +++ b/docs/reference/interfaces/RunFinishedEvent.md @@ -5,7 +5,7 @@ title: RunFinishedEvent # Interface: RunFinishedEvent -Defined in: [packages/typescript/ai/src/types.ts:812](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L812) +Defined in: [packages/typescript/ai/src/types.ts:821](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L821) Emitted when a run completes successfully. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `finishReason?`, `usage?` optional finishReason: "length" | "stop" | "content_filter" | "tool_calls" | null; ``` -Defined in: [packages/typescript/ai/src/types.ts:816](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L816) +Defined in: [packages/typescript/ai/src/types.ts:825](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L825) Why the generation stopped @@ -42,7 +42,7 @@ Why the generation stopped optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:814](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L814) +Defined in: [packages/typescript/ai/src/types.ts:823](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L823) Model identifier for multi-model support @@ -54,7 +54,7 @@ Model identifier for multi-model support optional usage: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:818](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L818) +Defined in: [packages/typescript/ai/src/types.ts:827](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L827) Token usage statistics diff --git a/docs/reference/interfaces/RunStartedEvent.md b/docs/reference/interfaces/RunStartedEvent.md index 68de5024c..d4f3289ca 100644 --- a/docs/reference/interfaces/RunStartedEvent.md +++ b/docs/reference/interfaces/RunStartedEvent.md @@ -5,7 +5,7 @@ title: RunStartedEvent # Interface: RunStartedEvent -Defined in: [packages/typescript/ai/src/types.ts:801](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L801) +Defined in: [packages/typescript/ai/src/types.ts:810](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L810) Emitted when a run starts. This is the first event in any streaming response. @@ -31,6 +31,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:803](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L803) +Defined in: [packages/typescript/ai/src/types.ts:812](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L812) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ServerTool.md b/docs/reference/interfaces/ServerTool.md index b9febb14e..d3140ed71 100644 --- a/docs/reference/interfaces/ServerTool.md +++ b/docs/reference/interfaces/ServerTool.md @@ -45,7 +45,7 @@ Defined in: [packages/typescript/ai/src/activities/chat/tools/tool-definition.ts description: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:439](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L439) +Defined in: [packages/typescript/ai/src/types.ts:440](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L440) Clear description of what the tool does. @@ -70,7 +70,7 @@ Be specific about what the tool does, what parameters it needs, and what it retu optional execute: (args, context?) => any; ``` -Defined in: [packages/typescript/ai/src/types.ts:519](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L519) +Defined in: [packages/typescript/ai/src/types.ts:520](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L520) Optional function to execute when the model calls this tool. @@ -118,7 +118,7 @@ execute: async (args) => { optional inputSchema: TInput; ``` -Defined in: [packages/typescript/ai/src/types.ts:479](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L479) +Defined in: [packages/typescript/ai/src/types.ts:480](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L480) Schema describing the tool's input parameters. @@ -176,7 +176,7 @@ type({ optional lazy: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:525](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L525) +Defined in: [packages/typescript/ai/src/types.ts:526](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L526) If true, this tool is lazy and will only be sent to the LLM after being discovered via the lazy tool discovery mechanism. Only meaningful when used with chat(). @@ -192,7 +192,7 @@ If true, this tool is lazy and will only be sent to the LLM after being discover optional metadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:528](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L528) +Defined in: [packages/typescript/ai/src/types.ts:529](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L529) Additional metadata for adapters or custom extensions @@ -208,7 +208,7 @@ Additional metadata for adapters or custom extensions name: TName; ``` -Defined in: [packages/typescript/ai/src/types.ts:429](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L429) +Defined in: [packages/typescript/ai/src/types.ts:430](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L430) Unique name of the tool (used by the model to call it). @@ -233,7 +233,7 @@ Must be unique within the tools array. optional needsApproval: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:522](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L522) +Defined in: [packages/typescript/ai/src/types.ts:523](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L523) If true, tool execution requires user approval before running. Works with both server and client tools. @@ -249,7 +249,7 @@ If true, tool execution requires user approval before running. Works with both s optional outputSchema: TOutput; ``` -Defined in: [packages/typescript/ai/src/types.ts:500](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L500) +Defined in: [packages/typescript/ai/src/types.ts:501](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L501) Optional schema for validating tool output. diff --git a/docs/reference/interfaces/StateDeltaEvent.md b/docs/reference/interfaces/StateDeltaEvent.md index eb563726b..0692ca789 100644 --- a/docs/reference/interfaces/StateDeltaEvent.md +++ b/docs/reference/interfaces/StateDeltaEvent.md @@ -5,7 +5,7 @@ title: StateDeltaEvent # Interface: StateDeltaEvent -Defined in: [packages/typescript/ai/src/types.ts:1022](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1022) +Defined in: [packages/typescript/ai/src/types.ts:1031](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1031) Emitted to provide an incremental state update. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1024](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1024) +Defined in: [packages/typescript/ai/src/types.ts:1033](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1033) Model identifier for multi-model support diff --git a/docs/reference/interfaces/StateSnapshotEvent.md b/docs/reference/interfaces/StateSnapshotEvent.md index 2e63e7238..c350f72f8 100644 --- a/docs/reference/interfaces/StateSnapshotEvent.md +++ b/docs/reference/interfaces/StateSnapshotEvent.md @@ -5,7 +5,7 @@ title: StateSnapshotEvent # Interface: StateSnapshotEvent -Defined in: [packages/typescript/ai/src/types.ts:1006](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1006) +Defined in: [packages/typescript/ai/src/types.ts:1015](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1015) Emitted to provide a full state snapshot. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `state?` (deprecated alias for snapshot) optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1008](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1008) +Defined in: [packages/typescript/ai/src/types.ts:1017](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1017) Model identifier for multi-model support @@ -42,7 +42,7 @@ Model identifier for multi-model support optional state: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:1013](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1013) +Defined in: [packages/typescript/ai/src/types.ts:1022](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1022) #### Deprecated diff --git a/docs/reference/interfaces/StepFinishedEvent.md b/docs/reference/interfaces/StepFinishedEvent.md index b2e6e1592..d62b12367 100644 --- a/docs/reference/interfaces/StepFinishedEvent.md +++ b/docs/reference/interfaces/StepFinishedEvent.md @@ -5,7 +5,7 @@ title: StepFinishedEvent # Interface: StepFinishedEvent -Defined in: [packages/typescript/ai/src/types.ts:969](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L969) +Defined in: [packages/typescript/ai/src/types.ts:978](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L978) Emitted when a thinking/reasoning step finishes. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `stepId?` (deprecated alias), `delta?`, `content?` optional content: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:980](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L980) +Defined in: [packages/typescript/ai/src/types.ts:989](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L989) Full accumulated thinking content (TanStack AI internal) @@ -42,7 +42,7 @@ Full accumulated thinking content (TanStack AI internal) optional delta: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:978](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L978) +Defined in: [packages/typescript/ai/src/types.ts:987](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L987) Incremental thinking content (TanStack AI internal) @@ -54,7 +54,7 @@ Incremental thinking content (TanStack AI internal) optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:971](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L971) +Defined in: [packages/typescript/ai/src/types.ts:980](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L980) Model identifier for multi-model support @@ -66,7 +66,7 @@ Model identifier for multi-model support optional stepId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:976](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L976) +Defined in: [packages/typescript/ai/src/types.ts:985](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L985) #### Deprecated diff --git a/docs/reference/interfaces/StepStartedEvent.md b/docs/reference/interfaces/StepStartedEvent.md index 6c2b202c1..8eda593c1 100644 --- a/docs/reference/interfaces/StepStartedEvent.md +++ b/docs/reference/interfaces/StepStartedEvent.md @@ -5,7 +5,7 @@ title: StepStartedEvent # Interface: StepStartedEvent -Defined in: [packages/typescript/ai/src/types.ts:951](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L951) +Defined in: [packages/typescript/ai/src/types.ts:960](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L960) Emitted when a thinking/reasoning step starts. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `stepId?` (deprecated alias), `stepType?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:953](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L953) +Defined in: [packages/typescript/ai/src/types.ts:962](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L962) Model identifier for multi-model support @@ -42,7 +42,7 @@ Model identifier for multi-model support optional stepId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:958](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L958) +Defined in: [packages/typescript/ai/src/types.ts:967](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L967) #### Deprecated @@ -57,6 +57,6 @@ Kept for backward compatibility. optional stepType: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:960](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L960) +Defined in: [packages/typescript/ai/src/types.ts:969](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L969) Type of step (e.g., 'thinking', 'planning') diff --git a/docs/reference/interfaces/SummarizationOptions.md b/docs/reference/interfaces/SummarizationOptions.md index 505f92adb..7851fefba 100644 --- a/docs/reference/interfaces/SummarizationOptions.md +++ b/docs/reference/interfaces/SummarizationOptions.md @@ -5,7 +5,7 @@ title: SummarizationOptions # Interface: SummarizationOptions -Defined in: [packages/typescript/ai/src/types.ts:1160](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1160) +Defined in: [packages/typescript/ai/src/types.ts:1169](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1169) ## Properties @@ -15,7 +15,20 @@ Defined in: [packages/typescript/ai/src/types.ts:1160](https://github.com/TanSta optional focus: string[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:1165](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1165) +Defined in: [packages/typescript/ai/src/types.ts:1174](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1174) + +*** + +### logger + +```ts +logger: InternalLogger; +``` + +Defined in: [packages/typescript/ai/src/types.ts:1179](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1179) + +Internal logger threaded from the summarize() entry point. Adapters must +call logger.request() before the SDK call and logger.errors() in catch blocks. *** @@ -25,7 +38,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1165](https://github.com/TanSta optional maxLength: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1163](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1163) +Defined in: [packages/typescript/ai/src/types.ts:1172](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1172) *** @@ -35,7 +48,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1163](https://github.com/TanSta model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1161](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1161) +Defined in: [packages/typescript/ai/src/types.ts:1170](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1170) *** @@ -45,7 +58,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1161](https://github.com/TanSta optional style: "bullet-points" | "paragraph" | "concise"; ``` -Defined in: [packages/typescript/ai/src/types.ts:1164](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1164) +Defined in: [packages/typescript/ai/src/types.ts:1173](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1173) *** @@ -55,4 +68,4 @@ Defined in: [packages/typescript/ai/src/types.ts:1164](https://github.com/TanSta text: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1162](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1162) +Defined in: [packages/typescript/ai/src/types.ts:1171](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1171) diff --git a/docs/reference/interfaces/SummarizationResult.md b/docs/reference/interfaces/SummarizationResult.md index 21380920f..87f5d7aef 100644 --- a/docs/reference/interfaces/SummarizationResult.md +++ b/docs/reference/interfaces/SummarizationResult.md @@ -5,7 +5,7 @@ title: SummarizationResult # Interface: SummarizationResult -Defined in: [packages/typescript/ai/src/types.ts:1168](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1168) +Defined in: [packages/typescript/ai/src/types.ts:1182](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1182) ## Properties @@ -15,7 +15,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1168](https://github.com/TanSta id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1169](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1169) +Defined in: [packages/typescript/ai/src/types.ts:1183](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1183) *** @@ -25,7 +25,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1169](https://github.com/TanSta model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1170](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1170) +Defined in: [packages/typescript/ai/src/types.ts:1184](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1184) *** @@ -35,7 +35,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1170](https://github.com/TanSta summary: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1171](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1171) +Defined in: [packages/typescript/ai/src/types.ts:1185](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1185) *** @@ -45,7 +45,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1171](https://github.com/TanSta usage: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:1172](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1172) +Defined in: [packages/typescript/ai/src/types.ts:1186](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1186) #### completionTokens diff --git a/docs/reference/interfaces/TTSOptions.md b/docs/reference/interfaces/TTSOptions.md index 0585150f1..d5983f2b8 100644 --- a/docs/reference/interfaces/TTSOptions.md +++ b/docs/reference/interfaces/TTSOptions.md @@ -5,7 +5,7 @@ title: TTSOptions # Interface: TTSOptions\ -Defined in: [packages/typescript/ai/src/types.ts:1309](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1309) +Defined in: [packages/typescript/ai/src/types.ts:1333](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1333) Options for text-to-speech generation. These are the common options supported across providers. @@ -24,19 +24,33 @@ These are the common options supported across providers. optional format: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm"; ``` -Defined in: [packages/typescript/ai/src/types.ts:1317](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1317) +Defined in: [packages/typescript/ai/src/types.ts:1341](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1341) The output audio format *** +### logger + +```ts +logger: InternalLogger; +``` + +Defined in: [packages/typescript/ai/src/types.ts:1351](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1351) + +Internal logger threaded from the generateSpeech() entry point. Adapters +must call logger.request() before the SDK call and logger.errors() in +catch blocks. + +*** + ### model ```ts model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1311](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1311) +Defined in: [packages/typescript/ai/src/types.ts:1335](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1335) The model to use for TTS generation @@ -48,7 +62,7 @@ The model to use for TTS generation optional modelOptions: TProviderOptions; ``` -Defined in: [packages/typescript/ai/src/types.ts:1321](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1321) +Defined in: [packages/typescript/ai/src/types.ts:1345](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1345) Model-specific options for TTS generation @@ -60,7 +74,7 @@ Model-specific options for TTS generation optional speed: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1319](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1319) +Defined in: [packages/typescript/ai/src/types.ts:1343](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1343) The speed of the generated audio (0.25 to 4.0) @@ -72,7 +86,7 @@ The speed of the generated audio (0.25 to 4.0) text: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1313](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1313) +Defined in: [packages/typescript/ai/src/types.ts:1337](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1337) The text to convert to speech @@ -84,6 +98,6 @@ The text to convert to speech optional voice: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1315](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1315) +Defined in: [packages/typescript/ai/src/types.ts:1339](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1339) The voice to use for generation diff --git a/docs/reference/interfaces/TTSResult.md b/docs/reference/interfaces/TTSResult.md index 09eecd418..26e0c55e9 100644 --- a/docs/reference/interfaces/TTSResult.md +++ b/docs/reference/interfaces/TTSResult.md @@ -5,7 +5,7 @@ title: TTSResult # Interface: TTSResult -Defined in: [packages/typescript/ai/src/types.ts:1327](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1327) +Defined in: [packages/typescript/ai/src/types.ts:1357](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1357) Result of text-to-speech generation. @@ -17,7 +17,7 @@ Result of text-to-speech generation. audio: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1333](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1333) +Defined in: [packages/typescript/ai/src/types.ts:1363](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1363) Base64-encoded audio data @@ -29,7 +29,7 @@ Base64-encoded audio data optional contentType: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1339](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1339) +Defined in: [packages/typescript/ai/src/types.ts:1369](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1369) Content type of the audio (e.g., 'audio/mp3') @@ -41,7 +41,7 @@ Content type of the audio (e.g., 'audio/mp3') optional duration: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1337](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1337) +Defined in: [packages/typescript/ai/src/types.ts:1367](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1367) Duration of the audio in seconds, if available @@ -53,7 +53,7 @@ Duration of the audio in seconds, if available format: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1335](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1335) +Defined in: [packages/typescript/ai/src/types.ts:1365](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1365) Audio format of the generated audio @@ -65,7 +65,7 @@ Audio format of the generated audio id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1329](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1329) +Defined in: [packages/typescript/ai/src/types.ts:1359](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1359) Unique identifier for the generation @@ -77,6 +77,6 @@ Unique identifier for the generation model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1331](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1331) +Defined in: [packages/typescript/ai/src/types.ts:1361](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1361) Model used for generation diff --git a/docs/reference/interfaces/TextAdapter.md b/docs/reference/interfaces/TextAdapter.md index 9146c032a..507a26e4b 100644 --- a/docs/reference/interfaces/TextAdapter.md +++ b/docs/reference/interfaces/TextAdapter.md @@ -5,7 +5,7 @@ title: TextAdapter # Interface: TextAdapter\ -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:53](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L53) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:58](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L58) Text adapter interface with pre-resolved generics. @@ -49,7 +49,7 @@ Generic parameters: ~types: object; ``` -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:70](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L70) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:75](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L75) **`Internal`** @@ -87,7 +87,7 @@ toolCapabilities: TToolCapabilities; chatStream: (options) => AsyncIterable; ``` -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:80](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L80) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:85](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L85) Stream text completions from the model @@ -109,7 +109,7 @@ Stream text completions from the model readonly kind: "text"; ``` -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:61](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L61) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:66](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L66) Discriminator for adapter kind @@ -121,7 +121,7 @@ Discriminator for adapter kind readonly model: TModel; ``` -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:65](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L65) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:70](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L70) The model this adapter is configured for @@ -133,7 +133,7 @@ The model this adapter is configured for readonly name: string; ``` -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:63](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L63) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:68](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L68) Provider name identifier (e.g., 'openai', 'anthropic') @@ -145,7 +145,7 @@ Provider name identifier (e.g., 'openai', 'anthropic') structuredOutput: (options) => Promise>; ``` -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:92](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L92) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:97](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L97) Generate structured output using the provider's native structured output API. This method uses stream: false and sends the JSON schema to the provider diff --git a/docs/reference/interfaces/TextCompletionChunk.md b/docs/reference/interfaces/TextCompletionChunk.md index 94dee8567..d6c788d9b 100644 --- a/docs/reference/interfaces/TextCompletionChunk.md +++ b/docs/reference/interfaces/TextCompletionChunk.md @@ -5,7 +5,7 @@ title: TextCompletionChunk # Interface: TextCompletionChunk -Defined in: [packages/typescript/ai/src/types.ts:1147](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1147) +Defined in: [packages/typescript/ai/src/types.ts:1156](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1156) ## Properties @@ -15,7 +15,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1147](https://github.com/TanSta content: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1150](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1150) +Defined in: [packages/typescript/ai/src/types.ts:1159](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1159) *** @@ -25,7 +25,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1150](https://github.com/TanSta optional finishReason: "length" | "stop" | "content_filter" | null; ``` -Defined in: [packages/typescript/ai/src/types.ts:1152](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1152) +Defined in: [packages/typescript/ai/src/types.ts:1161](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1161) *** @@ -35,7 +35,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1152](https://github.com/TanSta id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1148](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1148) +Defined in: [packages/typescript/ai/src/types.ts:1157](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1157) *** @@ -45,7 +45,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1148](https://github.com/TanSta model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1149](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1149) +Defined in: [packages/typescript/ai/src/types.ts:1158](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1158) *** @@ -55,7 +55,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1149](https://github.com/TanSta optional role: "assistant"; ``` -Defined in: [packages/typescript/ai/src/types.ts:1151](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1151) +Defined in: [packages/typescript/ai/src/types.ts:1160](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1160) *** @@ -65,7 +65,7 @@ Defined in: [packages/typescript/ai/src/types.ts:1151](https://github.com/TanSta optional usage: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:1153](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1153) +Defined in: [packages/typescript/ai/src/types.ts:1162](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1162) #### completionTokens diff --git a/docs/reference/interfaces/TextMessageContentEvent.md b/docs/reference/interfaces/TextMessageContentEvent.md index cfd78a93f..5e254bfca 100644 --- a/docs/reference/interfaces/TextMessageContentEvent.md +++ b/docs/reference/interfaces/TextMessageContentEvent.md @@ -5,7 +5,7 @@ title: TextMessageContentEvent # Interface: TextMessageContentEvent -Defined in: [packages/typescript/ai/src/types.ts:861](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L861) +Defined in: [packages/typescript/ai/src/types.ts:870](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L870) Emitted when text content is generated (streaming tokens). @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `content?` (accumulated) optional content: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:865](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L865) +Defined in: [packages/typescript/ai/src/types.ts:874](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L874) Full accumulated content so far (TanStack AI internal, for debugging) @@ -42,6 +42,6 @@ Full accumulated content so far (TanStack AI internal, for debugging) optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:863](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L863) +Defined in: [packages/typescript/ai/src/types.ts:872](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L872) Model identifier for multi-model support diff --git a/docs/reference/interfaces/TextMessageEndEvent.md b/docs/reference/interfaces/TextMessageEndEvent.md index 1a276b962..1cfbed6dc 100644 --- a/docs/reference/interfaces/TextMessageEndEvent.md +++ b/docs/reference/interfaces/TextMessageEndEvent.md @@ -5,7 +5,7 @@ title: TextMessageEndEvent # Interface: TextMessageEndEvent -Defined in: [packages/typescript/ai/src/types.ts:874](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L874) +Defined in: [packages/typescript/ai/src/types.ts:883](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L883) Emitted when a text message completes. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:876](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L876) +Defined in: [packages/typescript/ai/src/types.ts:885](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L885) Model identifier for multi-model support diff --git a/docs/reference/interfaces/TextMessageStartEvent.md b/docs/reference/interfaces/TextMessageStartEvent.md index e8f4dd5fa..22fb7998e 100644 --- a/docs/reference/interfaces/TextMessageStartEvent.md +++ b/docs/reference/interfaces/TextMessageStartEvent.md @@ -5,7 +5,7 @@ title: TextMessageStartEvent # Interface: TextMessageStartEvent -Defined in: [packages/typescript/ai/src/types.ts:850](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L850) +Defined in: [packages/typescript/ai/src/types.ts:859](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L859) Emitted when a text message starts. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:852](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L852) +Defined in: [packages/typescript/ai/src/types.ts:861](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L861) Model identifier for multi-model support diff --git a/docs/reference/interfaces/TextOptions.md b/docs/reference/interfaces/TextOptions.md index a8984e59a..803bdd8f0 100644 --- a/docs/reference/interfaces/TextOptions.md +++ b/docs/reference/interfaces/TextOptions.md @@ -5,7 +5,7 @@ title: TextOptions # Interface: TextOptions\ -Defined in: [packages/typescript/ai/src/types.ts:656](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L656) +Defined in: [packages/typescript/ai/src/types.ts:657](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L657) Options passed into the SDK and further piped to the AI provider. @@ -27,7 +27,7 @@ Options passed into the SDK and further piped to the AI provider. optional abortController: AbortController; ``` -Defined in: [packages/typescript/ai/src/types.ts:740](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L740) +Defined in: [packages/typescript/ai/src/types.ts:741](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L741) AbortController for request cancellation. @@ -54,7 +54,7 @@ https://developer.mozilla.org/en-US/docs/Web/API/AbortController optional agentLoopStrategy: AgentLoopStrategy; ``` -Defined in: [packages/typescript/ai/src/types.ts:664](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L664) +Defined in: [packages/typescript/ai/src/types.ts:665](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L665) *** @@ -64,20 +64,34 @@ Defined in: [packages/typescript/ai/src/types.ts:664](https://github.com/TanStac optional conversationId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:726](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L726) +Defined in: [packages/typescript/ai/src/types.ts:727](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L727) Conversation ID for correlating client and server-side devtools events. When provided, server-side events will be linked to the client conversation in devtools. *** +### logger + +```ts +logger: InternalLogger; +``` + +Defined in: [packages/typescript/ai/src/types.ts:748](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L748) + +Internal logger threaded from the chat entry point. Adapter implementations +must call `logger.request()` before SDK calls, `logger.provider()` for each +chunk received, and `logger.errors()` in catch blocks. + +*** + ### maxTokens? ```ts optional maxTokens: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:699](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L699) +Defined in: [packages/typescript/ai/src/types.ts:700](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L700) The maximum number of tokens to generate in the response. @@ -97,7 +111,7 @@ messages: ModelMessage< | null>[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:661](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L661) +Defined in: [packages/typescript/ai/src/types.ts:662](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L662) *** @@ -107,7 +121,7 @@ Defined in: [packages/typescript/ai/src/types.ts:661](https://github.com/TanStac optional metadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:710](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L710) +Defined in: [packages/typescript/ai/src/types.ts:711](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L711) Additional metadata to attach to the request. Can be used for tracking, debugging, or passing custom information. @@ -126,7 +140,7 @@ Provider usage: model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:660](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L660) +Defined in: [packages/typescript/ai/src/types.ts:661](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L661) *** @@ -136,7 +150,7 @@ Defined in: [packages/typescript/ai/src/types.ts:660](https://github.com/TanStac optional modelOptions: TProviderOptionsForModel; ``` -Defined in: [packages/typescript/ai/src/types.ts:711](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L711) +Defined in: [packages/typescript/ai/src/types.ts:712](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L712) *** @@ -146,7 +160,7 @@ Defined in: [packages/typescript/ai/src/types.ts:711](https://github.com/TanStac optional outputSchema: SchemaInput; ``` -Defined in: [packages/typescript/ai/src/types.ts:721](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L721) +Defined in: [packages/typescript/ai/src/types.ts:722](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L722) Schema for structured output. When provided, the adapter should use the provider's native structured output API @@ -162,7 +176,7 @@ Supports any Standard JSON Schema compliant library (Zod, ArkType, Valibot, etc. optional request: Request | RequestInit; ``` -Defined in: [packages/typescript/ai/src/types.ts:712](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L712) +Defined in: [packages/typescript/ai/src/types.ts:713](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L713) *** @@ -172,7 +186,7 @@ Defined in: [packages/typescript/ai/src/types.ts:712](https://github.com/TanStac optional runId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:751](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L751) +Defined in: [packages/typescript/ai/src/types.ts:760](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L760) Run ID for AG-UI protocol run correlation. When provided, this will be used in RunStartedEvent and RunFinishedEvent. @@ -186,7 +200,7 @@ If not provided, a unique ID will be generated. optional systemPrompts: string[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:663](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L663) +Defined in: [packages/typescript/ai/src/types.ts:664](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L664) *** @@ -196,7 +210,7 @@ Defined in: [packages/typescript/ai/src/types.ts:663](https://github.com/TanStac optional temperature: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:677](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L677) +Defined in: [packages/typescript/ai/src/types.ts:678](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L678) Controls the randomness of the output. Higher values (e.g., 0.8) make output more random, lower values (e.g., 0.2) make it more focused and deterministic. @@ -217,7 +231,7 @@ Provider usage: optional threadId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:745](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L745) +Defined in: [packages/typescript/ai/src/types.ts:754](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L754) Thread ID for AG-UI protocol run correlation. When provided, this will be used in RunStartedEvent and RunFinishedEvent. @@ -230,7 +244,7 @@ When provided, this will be used in RunStartedEvent and RunFinishedEvent. optional tools: Tool[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:662](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L662) +Defined in: [packages/typescript/ai/src/types.ts:663](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L663) *** @@ -240,7 +254,7 @@ Defined in: [packages/typescript/ai/src/types.ts:662](https://github.com/TanStac optional topP: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:690](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L690) +Defined in: [packages/typescript/ai/src/types.ts:691](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L691) Nucleus sampling parameter. An alternative to temperature sampling. The model considers the results of tokens with topP probability mass. diff --git a/docs/reference/interfaces/TextPart.md b/docs/reference/interfaces/TextPart.md index 08b251aec..f2d33db71 100644 --- a/docs/reference/interfaces/TextPart.md +++ b/docs/reference/interfaces/TextPart.md @@ -5,7 +5,7 @@ title: TextPart # Interface: TextPart\ -Defined in: [packages/typescript/ai/src/types.ts:304](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L304) +Defined in: [packages/typescript/ai/src/types.ts:305](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L305) Message parts - building blocks of UIMessage @@ -23,7 +23,7 @@ Message parts - building blocks of UIMessage content: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:306](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L306) +Defined in: [packages/typescript/ai/src/types.ts:307](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L307) *** @@ -33,7 +33,7 @@ Defined in: [packages/typescript/ai/src/types.ts:306](https://github.com/TanStac optional metadata: TMetadata; ``` -Defined in: [packages/typescript/ai/src/types.ts:307](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L307) +Defined in: [packages/typescript/ai/src/types.ts:308](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L308) *** @@ -43,4 +43,4 @@ Defined in: [packages/typescript/ai/src/types.ts:307](https://github.com/TanStac type: "text"; ``` -Defined in: [packages/typescript/ai/src/types.ts:305](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L305) +Defined in: [packages/typescript/ai/src/types.ts:306](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L306) diff --git a/docs/reference/interfaces/ThinkingPart.md b/docs/reference/interfaces/ThinkingPart.md index 9bdce16c4..2a0eac96e 100644 --- a/docs/reference/interfaces/ThinkingPart.md +++ b/docs/reference/interfaces/ThinkingPart.md @@ -5,7 +5,7 @@ title: ThinkingPart # Interface: ThinkingPart -Defined in: [packages/typescript/ai/src/types.ts:334](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L334) +Defined in: [packages/typescript/ai/src/types.ts:335](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L335) ## Properties @@ -15,7 +15,7 @@ Defined in: [packages/typescript/ai/src/types.ts:334](https://github.com/TanStac content: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:336](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L336) +Defined in: [packages/typescript/ai/src/types.ts:337](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L337) *** @@ -25,4 +25,4 @@ Defined in: [packages/typescript/ai/src/types.ts:336](https://github.com/TanStac type: "thinking"; ``` -Defined in: [packages/typescript/ai/src/types.ts:335](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L335) +Defined in: [packages/typescript/ai/src/types.ts:336](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L336) diff --git a/docs/reference/interfaces/Tool.md b/docs/reference/interfaces/Tool.md index 8f06dc565..fa7071cb3 100644 --- a/docs/reference/interfaces/Tool.md +++ b/docs/reference/interfaces/Tool.md @@ -5,7 +5,7 @@ title: Tool # Interface: Tool\ -Defined in: [packages/typescript/ai/src/types.ts:416](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L416) +Defined in: [packages/typescript/ai/src/types.ts:417](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L417) Tool/Function definition for function calling. @@ -49,7 +49,7 @@ or plain JSON Schema objects for runtime validation and type safety. description: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:439](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L439) +Defined in: [packages/typescript/ai/src/types.ts:440](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L440) Clear description of what the tool does. @@ -70,7 +70,7 @@ Be specific about what the tool does, what parameters it needs, and what it retu optional execute: (args, context?) => any; ``` -Defined in: [packages/typescript/ai/src/types.ts:519](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L519) +Defined in: [packages/typescript/ai/src/types.ts:520](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L520) Optional function to execute when the model calls this tool. @@ -114,7 +114,7 @@ execute: async (args) => { optional inputSchema: TInput; ``` -Defined in: [packages/typescript/ai/src/types.ts:479](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L479) +Defined in: [packages/typescript/ai/src/types.ts:480](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L480) Schema describing the tool's input parameters. @@ -168,7 +168,7 @@ type({ optional lazy: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:525](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L525) +Defined in: [packages/typescript/ai/src/types.ts:526](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L526) If true, this tool is lazy and will only be sent to the LLM after being discovered via the lazy tool discovery mechanism. Only meaningful when used with chat(). @@ -180,7 +180,7 @@ If true, this tool is lazy and will only be sent to the LLM after being discover optional metadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:528](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L528) +Defined in: [packages/typescript/ai/src/types.ts:529](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L529) Additional metadata for adapters or custom extensions @@ -192,7 +192,7 @@ Additional metadata for adapters or custom extensions name: TName; ``` -Defined in: [packages/typescript/ai/src/types.ts:429](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L429) +Defined in: [packages/typescript/ai/src/types.ts:430](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L430) Unique name of the tool (used by the model to call it). @@ -213,7 +213,7 @@ Must be unique within the tools array. optional needsApproval: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:522](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L522) +Defined in: [packages/typescript/ai/src/types.ts:523](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L523) If true, tool execution requires user approval before running. Works with both server and client tools. @@ -225,7 +225,7 @@ If true, tool execution requires user approval before running. Works with both s optional outputSchema: TOutput; ``` -Defined in: [packages/typescript/ai/src/types.ts:500](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L500) +Defined in: [packages/typescript/ai/src/types.ts:501](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L501) Optional schema for validating tool output. diff --git a/docs/reference/interfaces/ToolCall.md b/docs/reference/interfaces/ToolCall.md index 123d0109a..9ca298739 100644 --- a/docs/reference/interfaces/ToolCall.md +++ b/docs/reference/interfaces/ToolCall.md @@ -5,7 +5,7 @@ title: ToolCall # Interface: ToolCall -Defined in: [packages/typescript/ai/src/types.ts:113](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L113) +Defined in: [packages/typescript/ai/src/types.ts:114](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L114) ## Properties @@ -15,7 +15,7 @@ Defined in: [packages/typescript/ai/src/types.ts:113](https://github.com/TanStac function: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:116](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L116) +Defined in: [packages/typescript/ai/src/types.ts:117](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L117) #### arguments @@ -37,7 +37,7 @@ name: string; id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:114](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L114) +Defined in: [packages/typescript/ai/src/types.ts:115](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L115) *** @@ -47,7 +47,7 @@ Defined in: [packages/typescript/ai/src/types.ts:114](https://github.com/TanStac optional providerMetadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:121](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L121) +Defined in: [packages/typescript/ai/src/types.ts:122](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L122) Provider-specific metadata to carry through the tool call lifecycle @@ -59,4 +59,4 @@ Provider-specific metadata to carry through the tool call lifecycle type: "function"; ``` -Defined in: [packages/typescript/ai/src/types.ts:115](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L115) +Defined in: [packages/typescript/ai/src/types.ts:116](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L116) diff --git a/docs/reference/interfaces/ToolCallArgsEvent.md b/docs/reference/interfaces/ToolCallArgsEvent.md index f81665ba2..78065958c 100644 --- a/docs/reference/interfaces/ToolCallArgsEvent.md +++ b/docs/reference/interfaces/ToolCallArgsEvent.md @@ -5,7 +5,7 @@ title: ToolCallArgsEvent # Interface: ToolCallArgsEvent -Defined in: [packages/typescript/ai/src/types.ts:905](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L905) +Defined in: [packages/typescript/ai/src/types.ts:914](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L914) Emitted when tool call arguments are streaming. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `args?` (accumulated) optional args: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:909](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L909) +Defined in: [packages/typescript/ai/src/types.ts:918](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L918) Full accumulated arguments so far (TanStack AI internal) @@ -42,6 +42,6 @@ Full accumulated arguments so far (TanStack AI internal) optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:907](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L907) +Defined in: [packages/typescript/ai/src/types.ts:916](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L916) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ToolCallEndEvent.md b/docs/reference/interfaces/ToolCallEndEvent.md index 2070ddf70..151d22e12 100644 --- a/docs/reference/interfaces/ToolCallEndEvent.md +++ b/docs/reference/interfaces/ToolCallEndEvent.md @@ -5,7 +5,7 @@ title: ToolCallEndEvent # Interface: ToolCallEndEvent -Defined in: [packages/typescript/ai/src/types.ts:918](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L918) +Defined in: [packages/typescript/ai/src/types.ts:927](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L927) Emitted when a tool call completes. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `toolCallName?`, `toolName?` (deprecated), `input?`, optional input: unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:929](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L929) +Defined in: [packages/typescript/ai/src/types.ts:938](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L938) Final parsed input arguments (TanStack AI internal) @@ -42,7 +42,7 @@ Final parsed input arguments (TanStack AI internal) optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:920](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L920) +Defined in: [packages/typescript/ai/src/types.ts:929](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L929) Model identifier for multi-model support @@ -54,7 +54,7 @@ Model identifier for multi-model support optional result: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:931](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L931) +Defined in: [packages/typescript/ai/src/types.ts:940](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L940) Tool execution result (TanStack AI internal) @@ -66,7 +66,7 @@ Tool execution result (TanStack AI internal) optional toolCallName: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:922](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L922) +Defined in: [packages/typescript/ai/src/types.ts:931](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L931) Name of the tool that completed @@ -78,7 +78,7 @@ Name of the tool that completed optional toolName: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:927](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L927) +Defined in: [packages/typescript/ai/src/types.ts:936](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L936) #### Deprecated diff --git a/docs/reference/interfaces/ToolCallPart.md b/docs/reference/interfaces/ToolCallPart.md index 61794bd5b..587147737 100644 --- a/docs/reference/interfaces/ToolCallPart.md +++ b/docs/reference/interfaces/ToolCallPart.md @@ -5,7 +5,7 @@ title: ToolCallPart # Interface: ToolCallPart -Defined in: [packages/typescript/ai/src/types.ts:310](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L310) +Defined in: [packages/typescript/ai/src/types.ts:311](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L311) ## Properties @@ -15,7 +15,7 @@ Defined in: [packages/typescript/ai/src/types.ts:310](https://github.com/TanStac optional approval: object; ``` -Defined in: [packages/typescript/ai/src/types.ts:317](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L317) +Defined in: [packages/typescript/ai/src/types.ts:318](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L318) Approval metadata if tool requires user approval @@ -45,7 +45,7 @@ needsApproval: boolean; arguments: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:314](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L314) +Defined in: [packages/typescript/ai/src/types.ts:315](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L315) *** @@ -55,7 +55,7 @@ Defined in: [packages/typescript/ai/src/types.ts:314](https://github.com/TanStac id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:312](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L312) +Defined in: [packages/typescript/ai/src/types.ts:313](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L313) *** @@ -65,7 +65,7 @@ Defined in: [packages/typescript/ai/src/types.ts:312](https://github.com/TanStac name: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:313](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L313) +Defined in: [packages/typescript/ai/src/types.ts:314](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L314) *** @@ -75,7 +75,7 @@ Defined in: [packages/typescript/ai/src/types.ts:313](https://github.com/TanStac optional output: any; ``` -Defined in: [packages/typescript/ai/src/types.ts:323](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L323) +Defined in: [packages/typescript/ai/src/types.ts:324](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L324) Tool execution output (for client tools or after approval) @@ -87,7 +87,7 @@ Tool execution output (for client tools or after approval) state: ToolCallState; ``` -Defined in: [packages/typescript/ai/src/types.ts:315](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L315) +Defined in: [packages/typescript/ai/src/types.ts:316](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L316) *** @@ -97,4 +97,4 @@ Defined in: [packages/typescript/ai/src/types.ts:315](https://github.com/TanStac type: "tool-call"; ``` -Defined in: [packages/typescript/ai/src/types.ts:311](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L311) +Defined in: [packages/typescript/ai/src/types.ts:312](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L312) diff --git a/docs/reference/interfaces/ToolCallResultEvent.md b/docs/reference/interfaces/ToolCallResultEvent.md index f262ae1dc..d30915c7c 100644 --- a/docs/reference/interfaces/ToolCallResultEvent.md +++ b/docs/reference/interfaces/ToolCallResultEvent.md @@ -5,7 +5,7 @@ title: ToolCallResultEvent # Interface: ToolCallResultEvent -Defined in: [packages/typescript/ai/src/types.ts:940](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L940) +Defined in: [packages/typescript/ai/src/types.ts:949](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L949) Emitted when a tool call result is available. @@ -30,6 +30,6 @@ TanStack AI adds: `model?` optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:942](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L942) +Defined in: [packages/typescript/ai/src/types.ts:951](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L951) Model identifier for multi-model support diff --git a/docs/reference/interfaces/ToolCallStartEvent.md b/docs/reference/interfaces/ToolCallStartEvent.md index 94c3f13e3..910719f6e 100644 --- a/docs/reference/interfaces/ToolCallStartEvent.md +++ b/docs/reference/interfaces/ToolCallStartEvent.md @@ -5,7 +5,7 @@ title: ToolCallStartEvent # Interface: ToolCallStartEvent -Defined in: [packages/typescript/ai/src/types.ts:885](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L885) +Defined in: [packages/typescript/ai/src/types.ts:894](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L894) Emitted when a tool call starts. @@ -30,7 +30,7 @@ TanStack AI adds: `model?`, `toolName` (deprecated alias), `index?`, `providerMe optional index: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:894](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L894) +Defined in: [packages/typescript/ai/src/types.ts:903](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L903) Index for parallel tool calls @@ -42,7 +42,7 @@ Index for parallel tool calls optional model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:887](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L887) +Defined in: [packages/typescript/ai/src/types.ts:896](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L896) Model identifier for multi-model support @@ -54,7 +54,7 @@ Model identifier for multi-model support optional providerMetadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:896](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L896) +Defined in: [packages/typescript/ai/src/types.ts:905](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L905) Provider-specific metadata to carry into the ToolCall @@ -66,7 +66,7 @@ Provider-specific metadata to carry into the ToolCall toolName: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:892](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L892) +Defined in: [packages/typescript/ai/src/types.ts:901](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L901) #### Deprecated diff --git a/docs/reference/interfaces/ToolConfig.md b/docs/reference/interfaces/ToolConfig.md index eb56d9a6b..8536a21e8 100644 --- a/docs/reference/interfaces/ToolConfig.md +++ b/docs/reference/interfaces/ToolConfig.md @@ -5,7 +5,7 @@ title: ToolConfig # Interface: ToolConfig -Defined in: [packages/typescript/ai/src/types.ts:531](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L531) +Defined in: [packages/typescript/ai/src/types.ts:532](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L532) ## Indexable diff --git a/docs/reference/interfaces/ToolDefinition.md b/docs/reference/interfaces/ToolDefinition.md index f8d69290f..bd1443841 100644 --- a/docs/reference/interfaces/ToolDefinition.md +++ b/docs/reference/interfaces/ToolDefinition.md @@ -73,7 +73,7 @@ Create a client-side tool with optional execute function description: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:439](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L439) +Defined in: [packages/typescript/ai/src/types.ts:440](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L440) Clear description of what the tool does. @@ -98,7 +98,7 @@ Be specific about what the tool does, what parameters it needs, and what it retu optional execute: (args, context?) => any; ``` -Defined in: [packages/typescript/ai/src/types.ts:519](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L519) +Defined in: [packages/typescript/ai/src/types.ts:520](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L520) Optional function to execute when the model calls this tool. @@ -146,7 +146,7 @@ execute: async (args) => { optional inputSchema: TInput; ``` -Defined in: [packages/typescript/ai/src/types.ts:479](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L479) +Defined in: [packages/typescript/ai/src/types.ts:480](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L480) Schema describing the tool's input parameters. @@ -204,7 +204,7 @@ type({ optional lazy: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:525](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L525) +Defined in: [packages/typescript/ai/src/types.ts:526](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L526) If true, this tool is lazy and will only be sent to the LLM after being discovered via the lazy tool discovery mechanism. Only meaningful when used with chat(). @@ -220,7 +220,7 @@ If true, this tool is lazy and will only be sent to the LLM after being discover optional metadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:528](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L528) +Defined in: [packages/typescript/ai/src/types.ts:529](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L529) Additional metadata for adapters or custom extensions @@ -236,7 +236,7 @@ Additional metadata for adapters or custom extensions name: TName; ``` -Defined in: [packages/typescript/ai/src/types.ts:429](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L429) +Defined in: [packages/typescript/ai/src/types.ts:430](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L430) Unique name of the tool (used by the model to call it). @@ -261,7 +261,7 @@ Must be unique within the tools array. optional needsApproval: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:522](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L522) +Defined in: [packages/typescript/ai/src/types.ts:523](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L523) If true, tool execution requires user approval before running. Works with both server and client tools. @@ -277,7 +277,7 @@ If true, tool execution requires user approval before running. Works with both s optional outputSchema: TOutput; ``` -Defined in: [packages/typescript/ai/src/types.ts:500](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L500) +Defined in: [packages/typescript/ai/src/types.ts:501](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L501) Optional schema for validating tool output. diff --git a/docs/reference/interfaces/ToolDefinitionInstance.md b/docs/reference/interfaces/ToolDefinitionInstance.md index 3b3f2e14f..397adaa71 100644 --- a/docs/reference/interfaces/ToolDefinitionInstance.md +++ b/docs/reference/interfaces/ToolDefinitionInstance.md @@ -49,7 +49,7 @@ Defined in: [packages/typescript/ai/src/activities/chat/tools/tool-definition.ts description: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:439](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L439) +Defined in: [packages/typescript/ai/src/types.ts:440](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L440) Clear description of what the tool does. @@ -74,7 +74,7 @@ Be specific about what the tool does, what parameters it needs, and what it retu optional execute: (args, context?) => any; ``` -Defined in: [packages/typescript/ai/src/types.ts:519](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L519) +Defined in: [packages/typescript/ai/src/types.ts:520](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L520) Optional function to execute when the model calls this tool. @@ -122,7 +122,7 @@ execute: async (args) => { optional inputSchema: TInput; ``` -Defined in: [packages/typescript/ai/src/types.ts:479](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L479) +Defined in: [packages/typescript/ai/src/types.ts:480](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L480) Schema describing the tool's input parameters. @@ -180,7 +180,7 @@ type({ optional lazy: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:525](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L525) +Defined in: [packages/typescript/ai/src/types.ts:526](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L526) If true, this tool is lazy and will only be sent to the LLM after being discovered via the lazy tool discovery mechanism. Only meaningful when used with chat(). @@ -196,7 +196,7 @@ If true, this tool is lazy and will only be sent to the LLM after being discover optional metadata: Record; ``` -Defined in: [packages/typescript/ai/src/types.ts:528](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L528) +Defined in: [packages/typescript/ai/src/types.ts:529](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L529) Additional metadata for adapters or custom extensions @@ -212,7 +212,7 @@ Additional metadata for adapters or custom extensions name: TName; ``` -Defined in: [packages/typescript/ai/src/types.ts:429](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L429) +Defined in: [packages/typescript/ai/src/types.ts:430](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L430) Unique name of the tool (used by the model to call it). @@ -237,7 +237,7 @@ Must be unique within the tools array. optional needsApproval: boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:522](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L522) +Defined in: [packages/typescript/ai/src/types.ts:523](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L523) If true, tool execution requires user approval before running. Works with both server and client tools. @@ -253,7 +253,7 @@ If true, tool execution requires user approval before running. Works with both s optional outputSchema: TOutput; ``` -Defined in: [packages/typescript/ai/src/types.ts:500](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L500) +Defined in: [packages/typescript/ai/src/types.ts:501](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L501) Optional schema for validating tool output. diff --git a/docs/reference/interfaces/ToolExecutionContext.md b/docs/reference/interfaces/ToolExecutionContext.md index f34f90025..6b06c4ead 100644 --- a/docs/reference/interfaces/ToolExecutionContext.md +++ b/docs/reference/interfaces/ToolExecutionContext.md @@ -5,7 +5,7 @@ title: ToolExecutionContext # Interface: ToolExecutionContext -Defined in: [packages/typescript/ai/src/types.ts:379](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L379) +Defined in: [packages/typescript/ai/src/types.ts:380](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L380) Context passed to tool execute functions, providing capabilities like emitting custom events during execution. @@ -18,7 +18,7 @@ emitting custom events during execution. emitCustomEvent: (eventName, value) => void; ``` -Defined in: [packages/typescript/ai/src/types.ts:400](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L400) +Defined in: [packages/typescript/ai/src/types.ts:401](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L401) Emit a custom event during tool execution. Events are streamed to the client in real-time as AG-UI CUSTOM events. @@ -61,6 +61,6 @@ const tool = toolDefinition({ ... }).server(async (args, context) => { optional toolCallId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:381](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L381) +Defined in: [packages/typescript/ai/src/types.ts:382](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L382) The ID of the tool call being executed diff --git a/docs/reference/interfaces/ToolResultPart.md b/docs/reference/interfaces/ToolResultPart.md index 1137710ad..6d800be69 100644 --- a/docs/reference/interfaces/ToolResultPart.md +++ b/docs/reference/interfaces/ToolResultPart.md @@ -5,7 +5,7 @@ title: ToolResultPart # Interface: ToolResultPart -Defined in: [packages/typescript/ai/src/types.ts:326](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L326) +Defined in: [packages/typescript/ai/src/types.ts:327](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L327) ## Properties @@ -15,7 +15,7 @@ Defined in: [packages/typescript/ai/src/types.ts:326](https://github.com/TanStac content: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:329](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L329) +Defined in: [packages/typescript/ai/src/types.ts:330](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L330) *** @@ -25,7 +25,7 @@ Defined in: [packages/typescript/ai/src/types.ts:329](https://github.com/TanStac optional error: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:331](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L331) +Defined in: [packages/typescript/ai/src/types.ts:332](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L332) *** @@ -35,7 +35,7 @@ Defined in: [packages/typescript/ai/src/types.ts:331](https://github.com/TanStac state: ToolResultState; ``` -Defined in: [packages/typescript/ai/src/types.ts:330](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L330) +Defined in: [packages/typescript/ai/src/types.ts:331](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L331) *** @@ -45,7 +45,7 @@ Defined in: [packages/typescript/ai/src/types.ts:330](https://github.com/TanStac toolCallId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:328](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L328) +Defined in: [packages/typescript/ai/src/types.ts:329](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L329) *** @@ -55,4 +55,4 @@ Defined in: [packages/typescript/ai/src/types.ts:328](https://github.com/TanStac type: "tool-result"; ``` -Defined in: [packages/typescript/ai/src/types.ts:327](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L327) +Defined in: [packages/typescript/ai/src/types.ts:328](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L328) diff --git a/docs/reference/interfaces/TranscriptionOptions.md b/docs/reference/interfaces/TranscriptionOptions.md index 22eee6b10..a91271464 100644 --- a/docs/reference/interfaces/TranscriptionOptions.md +++ b/docs/reference/interfaces/TranscriptionOptions.md @@ -5,7 +5,7 @@ title: TranscriptionOptions # Interface: TranscriptionOptions\ -Defined in: [packages/typescript/ai/src/types.ts:1350](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1350) +Defined in: [packages/typescript/ai/src/types.ts:1380](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1380) Options for audio transcription. These are the common options supported across providers. @@ -24,7 +24,7 @@ These are the common options supported across providers. audio: string | File | Blob | ArrayBuffer; ``` -Defined in: [packages/typescript/ai/src/types.ts:1356](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1356) +Defined in: [packages/typescript/ai/src/types.ts:1386](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1386) The audio data to transcribe - can be base64 string, File, Blob, or Buffer @@ -36,19 +36,33 @@ The audio data to transcribe - can be base64 string, File, Blob, or Buffer optional language: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1358](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1358) +Defined in: [packages/typescript/ai/src/types.ts:1388](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1388) The language of the audio in ISO-639-1 format (e.g., 'en') *** +### logger + +```ts +logger: InternalLogger; +``` + +Defined in: [packages/typescript/ai/src/types.ts:1400](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1400) + +Internal logger threaded from the generateTranscription() entry point. +Adapters must call logger.request() before the SDK call and logger.errors() +in catch blocks. + +*** + ### model ```ts model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1354](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1354) +Defined in: [packages/typescript/ai/src/types.ts:1384](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1384) The model to use for transcription @@ -60,7 +74,7 @@ The model to use for transcription optional modelOptions: TProviderOptions; ``` -Defined in: [packages/typescript/ai/src/types.ts:1364](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1364) +Defined in: [packages/typescript/ai/src/types.ts:1394](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1394) Model-specific options for transcription @@ -72,7 +86,7 @@ Model-specific options for transcription optional prompt: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1360](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1360) +Defined in: [packages/typescript/ai/src/types.ts:1390](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1390) An optional prompt to guide the transcription @@ -84,6 +98,6 @@ An optional prompt to guide the transcription optional responseFormat: "text" | "json" | "srt" | "verbose_json" | "vtt"; ``` -Defined in: [packages/typescript/ai/src/types.ts:1362](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1362) +Defined in: [packages/typescript/ai/src/types.ts:1392](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1392) The format of the transcription output diff --git a/docs/reference/interfaces/TranscriptionResult.md b/docs/reference/interfaces/TranscriptionResult.md index 264b93e83..37b1adf96 100644 --- a/docs/reference/interfaces/TranscriptionResult.md +++ b/docs/reference/interfaces/TranscriptionResult.md @@ -5,7 +5,7 @@ title: TranscriptionResult # Interface: TranscriptionResult -Defined in: [packages/typescript/ai/src/types.ts:1400](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1400) +Defined in: [packages/typescript/ai/src/types.ts:1436](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1436) Result of audio transcription. @@ -17,7 +17,7 @@ Result of audio transcription. optional duration: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1410](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1410) +Defined in: [packages/typescript/ai/src/types.ts:1446](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1446) Duration of the audio in seconds @@ -29,7 +29,7 @@ Duration of the audio in seconds id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1402](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1402) +Defined in: [packages/typescript/ai/src/types.ts:1438](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1438) Unique identifier for the transcription @@ -41,7 +41,7 @@ Unique identifier for the transcription optional language: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1408](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1408) +Defined in: [packages/typescript/ai/src/types.ts:1444](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1444) Language detected or specified @@ -53,7 +53,7 @@ Language detected or specified model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1404](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1404) +Defined in: [packages/typescript/ai/src/types.ts:1440](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1440) Model used for transcription @@ -65,7 +65,7 @@ Model used for transcription optional segments: TranscriptionSegment[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:1412](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1412) +Defined in: [packages/typescript/ai/src/types.ts:1448](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1448) Detailed segments with timing, if available @@ -77,7 +77,7 @@ Detailed segments with timing, if available text: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1406](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1406) +Defined in: [packages/typescript/ai/src/types.ts:1442](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1442) The full transcribed text @@ -89,6 +89,6 @@ The full transcribed text optional words: TranscriptionWord[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:1414](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1414) +Defined in: [packages/typescript/ai/src/types.ts:1450](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1450) Word-level timestamps, if available diff --git a/docs/reference/interfaces/TranscriptionSegment.md b/docs/reference/interfaces/TranscriptionSegment.md index 4b1dbc807..5d5764aaf 100644 --- a/docs/reference/interfaces/TranscriptionSegment.md +++ b/docs/reference/interfaces/TranscriptionSegment.md @@ -5,7 +5,7 @@ title: TranscriptionSegment # Interface: TranscriptionSegment -Defined in: [packages/typescript/ai/src/types.ts:1370](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1370) +Defined in: [packages/typescript/ai/src/types.ts:1406](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1406) A single segment of transcribed audio with timing information. @@ -17,7 +17,7 @@ A single segment of transcribed audio with timing information. optional confidence: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1380](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1380) +Defined in: [packages/typescript/ai/src/types.ts:1416](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1416) Confidence score (0-1), if available @@ -29,7 +29,7 @@ Confidence score (0-1), if available end: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1376](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1376) +Defined in: [packages/typescript/ai/src/types.ts:1412](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1412) End time of the segment in seconds @@ -41,7 +41,7 @@ End time of the segment in seconds id: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1372](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1372) +Defined in: [packages/typescript/ai/src/types.ts:1408](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1408) Unique identifier for the segment @@ -53,7 +53,7 @@ Unique identifier for the segment optional speaker: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1382](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1382) +Defined in: [packages/typescript/ai/src/types.ts:1418](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1418) Speaker identifier, if diarization is enabled @@ -65,7 +65,7 @@ Speaker identifier, if diarization is enabled start: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1374](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1374) +Defined in: [packages/typescript/ai/src/types.ts:1410](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1410) Start time of the segment in seconds @@ -77,6 +77,6 @@ Start time of the segment in seconds text: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1378](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1378) +Defined in: [packages/typescript/ai/src/types.ts:1414](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1414) Transcribed text for this segment diff --git a/docs/reference/interfaces/TranscriptionWord.md b/docs/reference/interfaces/TranscriptionWord.md index 7dab967f9..1b035a377 100644 --- a/docs/reference/interfaces/TranscriptionWord.md +++ b/docs/reference/interfaces/TranscriptionWord.md @@ -5,7 +5,7 @@ title: TranscriptionWord # Interface: TranscriptionWord -Defined in: [packages/typescript/ai/src/types.ts:1388](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1388) +Defined in: [packages/typescript/ai/src/types.ts:1424](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1424) A single word with timing information. @@ -17,7 +17,7 @@ A single word with timing information. end: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1394](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1394) +Defined in: [packages/typescript/ai/src/types.ts:1430](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1430) End time in seconds @@ -29,7 +29,7 @@ End time in seconds start: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1392](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1392) +Defined in: [packages/typescript/ai/src/types.ts:1428](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1428) Start time in seconds @@ -41,6 +41,6 @@ Start time in seconds word: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1390](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1390) +Defined in: [packages/typescript/ai/src/types.ts:1426](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1426) The transcribed word diff --git a/docs/reference/interfaces/UIMessage.md b/docs/reference/interfaces/UIMessage.md index 20aec0dc0..a309de54d 100644 --- a/docs/reference/interfaces/UIMessage.md +++ b/docs/reference/interfaces/UIMessage.md @@ -5,7 +5,7 @@ title: UIMessage # Interface: UIMessage -Defined in: [packages/typescript/ai/src/types.ts:353](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L353) +Defined in: [packages/typescript/ai/src/types.ts:354](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L354) UIMessage - Domain-specific message format optimized for building chat UIs Contains parts that can be text, tool calls, or tool results @@ -18,7 +18,7 @@ Contains parts that can be text, tool calls, or tool results optional createdAt: Date; ``` -Defined in: [packages/typescript/ai/src/types.ts:357](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L357) +Defined in: [packages/typescript/ai/src/types.ts:358](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L358) *** @@ -28,7 +28,7 @@ Defined in: [packages/typescript/ai/src/types.ts:357](https://github.com/TanStac id: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:354](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L354) +Defined in: [packages/typescript/ai/src/types.ts:355](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L355) *** @@ -38,7 +38,7 @@ Defined in: [packages/typescript/ai/src/types.ts:354](https://github.com/TanStac parts: MessagePart[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:356](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L356) +Defined in: [packages/typescript/ai/src/types.ts:357](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L357) *** @@ -48,4 +48,4 @@ Defined in: [packages/typescript/ai/src/types.ts:356](https://github.com/TanStac role: "user" | "assistant" | "system"; ``` -Defined in: [packages/typescript/ai/src/types.ts:355](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L355) +Defined in: [packages/typescript/ai/src/types.ts:356](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L356) diff --git a/docs/reference/interfaces/VideoGenerationOptions.md b/docs/reference/interfaces/VideoGenerationOptions.md index d6c51cd62..88bcb72ee 100644 --- a/docs/reference/interfaces/VideoGenerationOptions.md +++ b/docs/reference/interfaces/VideoGenerationOptions.md @@ -5,7 +5,7 @@ title: VideoGenerationOptions # Interface: VideoGenerationOptions\ -Defined in: [packages/typescript/ai/src/types.ts:1243](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1243) +Defined in: [packages/typescript/ai/src/types.ts:1262](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1262) **`Experimental`** @@ -32,7 +32,7 @@ These are the common options supported across providers. optional duration: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1254](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1254) +Defined in: [packages/typescript/ai/src/types.ts:1273](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1273) **`Experimental`** @@ -40,13 +40,28 @@ Video duration in seconds *** +### logger + +```ts +logger: InternalLogger; +``` + +Defined in: [packages/typescript/ai/src/types.ts:1280](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1280) + +**`Experimental`** + +Internal logger threaded from the generateVideo() entry point. Adapters must +call logger.request() before the SDK call and logger.errors() in catch blocks. + +*** + ### model ```ts model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1248](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1248) +Defined in: [packages/typescript/ai/src/types.ts:1267](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1267) **`Experimental`** @@ -60,7 +75,7 @@ The model to use for video generation optional modelOptions: TProviderOptions; ``` -Defined in: [packages/typescript/ai/src/types.ts:1256](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1256) +Defined in: [packages/typescript/ai/src/types.ts:1275](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1275) **`Experimental`** @@ -74,7 +89,7 @@ Model-specific options for video generation prompt: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1250](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1250) +Defined in: [packages/typescript/ai/src/types.ts:1269](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1269) **`Experimental`** @@ -88,7 +103,7 @@ Text description of the desired video optional size: TSize; ``` -Defined in: [packages/typescript/ai/src/types.ts:1252](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1252) +Defined in: [packages/typescript/ai/src/types.ts:1271](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1271) **`Experimental`** diff --git a/docs/reference/interfaces/VideoJobResult.md b/docs/reference/interfaces/VideoJobResult.md index c414f4da8..09a9518f7 100644 --- a/docs/reference/interfaces/VideoJobResult.md +++ b/docs/reference/interfaces/VideoJobResult.md @@ -5,7 +5,7 @@ title: VideoJobResult # Interface: VideoJobResult -Defined in: [packages/typescript/ai/src/types.ts:1264](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1264) +Defined in: [packages/typescript/ai/src/types.ts:1288](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1288) **`Experimental`** @@ -21,7 +21,7 @@ Result of creating a video generation job. jobId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1266](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1266) +Defined in: [packages/typescript/ai/src/types.ts:1290](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1290) **`Experimental`** @@ -35,7 +35,7 @@ Unique job identifier for polling status model: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1268](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1268) +Defined in: [packages/typescript/ai/src/types.ts:1292](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1292) **`Experimental`** diff --git a/docs/reference/interfaces/VideoPart.md b/docs/reference/interfaces/VideoPart.md index 5ad10c831..e2829886e 100644 --- a/docs/reference/interfaces/VideoPart.md +++ b/docs/reference/interfaces/VideoPart.md @@ -5,7 +5,7 @@ title: VideoPart # Interface: VideoPart\ -Defined in: [packages/typescript/ai/src/types.ts:213](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L213) +Defined in: [packages/typescript/ai/src/types.ts:214](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L214) Video content part for multimodal messages. @@ -25,7 +25,7 @@ Provider-specific metadata type optional metadata: TMetadata; ``` -Defined in: [packages/typescript/ai/src/types.ts:218](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L218) +Defined in: [packages/typescript/ai/src/types.ts:219](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L219) Provider-specific metadata (e.g., duration, resolution) @@ -37,7 +37,7 @@ Provider-specific metadata (e.g., duration, resolution) source: ContentPartSource; ``` -Defined in: [packages/typescript/ai/src/types.ts:216](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L216) +Defined in: [packages/typescript/ai/src/types.ts:217](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L217) Source of the video content @@ -49,4 +49,4 @@ Source of the video content type: "video"; ``` -Defined in: [packages/typescript/ai/src/types.ts:214](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L214) +Defined in: [packages/typescript/ai/src/types.ts:215](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L215) diff --git a/docs/reference/interfaces/VideoStatusResult.md b/docs/reference/interfaces/VideoStatusResult.md index 93733db14..522149991 100644 --- a/docs/reference/interfaces/VideoStatusResult.md +++ b/docs/reference/interfaces/VideoStatusResult.md @@ -5,7 +5,7 @@ title: VideoStatusResult # Interface: VideoStatusResult -Defined in: [packages/typescript/ai/src/types.ts:1276](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1276) +Defined in: [packages/typescript/ai/src/types.ts:1300](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1300) **`Experimental`** @@ -21,7 +21,7 @@ Status of a video generation job. optional error: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1284](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1284) +Defined in: [packages/typescript/ai/src/types.ts:1308](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1308) **`Experimental`** @@ -35,7 +35,7 @@ Error message if status is 'failed' jobId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1278](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1278) +Defined in: [packages/typescript/ai/src/types.ts:1302](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1302) **`Experimental`** @@ -49,7 +49,7 @@ Job identifier optional progress: number; ``` -Defined in: [packages/typescript/ai/src/types.ts:1282](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1282) +Defined in: [packages/typescript/ai/src/types.ts:1306](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1306) **`Experimental`** @@ -63,7 +63,7 @@ Progress percentage (0-100), if available status: "pending" | "processing" | "completed" | "failed"; ``` -Defined in: [packages/typescript/ai/src/types.ts:1280](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1280) +Defined in: [packages/typescript/ai/src/types.ts:1304](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1304) **`Experimental`** diff --git a/docs/reference/interfaces/VideoUrlResult.md b/docs/reference/interfaces/VideoUrlResult.md index e299e9b45..c2fbca191 100644 --- a/docs/reference/interfaces/VideoUrlResult.md +++ b/docs/reference/interfaces/VideoUrlResult.md @@ -5,7 +5,7 @@ title: VideoUrlResult # Interface: VideoUrlResult -Defined in: [packages/typescript/ai/src/types.ts:1292](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1292) +Defined in: [packages/typescript/ai/src/types.ts:1316](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1316) **`Experimental`** @@ -21,7 +21,7 @@ Result containing the URL to a generated video. optional expiresAt: Date; ``` -Defined in: [packages/typescript/ai/src/types.ts:1298](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1298) +Defined in: [packages/typescript/ai/src/types.ts:1322](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1322) **`Experimental`** @@ -35,7 +35,7 @@ When the URL expires, if applicable jobId: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1294](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1294) +Defined in: [packages/typescript/ai/src/types.ts:1318](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1318) **`Experimental`** @@ -49,7 +49,7 @@ Job identifier url: string; ``` -Defined in: [packages/typescript/ai/src/types.ts:1296](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1296) +Defined in: [packages/typescript/ai/src/types.ts:1320](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1320) **`Experimental`** diff --git a/docs/reference/type-aliases/AGUIEvent.md b/docs/reference/type-aliases/AGUIEvent.md index 6c53bedaa..a6fd82eff 100644 --- a/docs/reference/type-aliases/AGUIEvent.md +++ b/docs/reference/type-aliases/AGUIEvent.md @@ -31,6 +31,6 @@ type AGUIEvent = | ReasoningEncryptedValueEvent; ``` -Defined in: [packages/typescript/ai/src/types.ts:1115](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1115) +Defined in: [packages/typescript/ai/src/types.ts:1124](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1124) Union of all AG-UI events. diff --git a/docs/reference/type-aliases/AGUIEventType.md b/docs/reference/type-aliases/AGUIEventType.md index ec78ef587..032e2d387 100644 --- a/docs/reference/type-aliases/AGUIEventType.md +++ b/docs/reference/type-aliases/AGUIEventType.md @@ -9,7 +9,7 @@ title: AGUIEventType type AGUIEventType = `${EventType}`; ``` -Defined in: [packages/typescript/ai/src/types.ts:770](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L770) +Defined in: [packages/typescript/ai/src/types.ts:779](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L779) AG-UI Protocol event types. diff --git a/docs/reference/type-aliases/AgentLoopStrategy.md b/docs/reference/type-aliases/AgentLoopStrategy.md index 823b930b6..769e181aa 100644 --- a/docs/reference/type-aliases/AgentLoopStrategy.md +++ b/docs/reference/type-aliases/AgentLoopStrategy.md @@ -9,7 +9,7 @@ title: AgentLoopStrategy type AgentLoopStrategy = (state) => boolean; ``` -Defined in: [packages/typescript/ai/src/types.ts:651](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L651) +Defined in: [packages/typescript/ai/src/types.ts:652](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L652) Strategy function that determines whether the agent loop should continue diff --git a/docs/reference/type-aliases/AnyTextAdapter.md b/docs/reference/type-aliases/AnyTextAdapter.md index e1720be81..5420432b6 100644 --- a/docs/reference/type-aliases/AnyTextAdapter.md +++ b/docs/reference/type-aliases/AnyTextAdapter.md @@ -9,7 +9,7 @@ title: AnyTextAdapter type AnyTextAdapter = TextAdapter; ``` -Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:101](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L101) +Defined in: [packages/typescript/ai/src/activities/chat/adapter.ts:106](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/activities/chat/adapter.ts#L106) A TextAdapter with any/unknown type parameters. Useful as a constraint in generic functions and interfaces. diff --git a/docs/reference/type-aliases/ConstrainedContent.md b/docs/reference/type-aliases/ConstrainedContent.md index e46882030..0d6427edd 100644 --- a/docs/reference/type-aliases/ConstrainedContent.md +++ b/docs/reference/type-aliases/ConstrainedContent.md @@ -12,7 +12,7 @@ type ConstrainedContent = | ContentPartForInputModalitiesTypes[]; ``` -Defined in: [packages/typescript/ai/src/types.ts:281](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L281) +Defined in: [packages/typescript/ai/src/types.ts:282](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L282) Type for message content constrained by supported modalities. When modalities is ['text', 'image'], only TextPart and ImagePart are allowed in the array. diff --git a/docs/reference/type-aliases/ConstrainedModelMessage.md b/docs/reference/type-aliases/ConstrainedModelMessage.md index 1c95fd418..ae9a6eec7 100644 --- a/docs/reference/type-aliases/ConstrainedModelMessage.md +++ b/docs/reference/type-aliases/ConstrainedModelMessage.md @@ -9,7 +9,7 @@ title: ConstrainedModelMessage type ConstrainedModelMessage = Omit & object; ``` -Defined in: [packages/typescript/ai/src/types.ts:369](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L369) +Defined in: [packages/typescript/ai/src/types.ts:370](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L370) A ModelMessage with content constrained to only allow content parts matching the specified input modalities. diff --git a/docs/reference/type-aliases/ContentPart.md b/docs/reference/type-aliases/ContentPart.md index 2678fd098..a4139b2b0 100644 --- a/docs/reference/type-aliases/ContentPart.md +++ b/docs/reference/type-aliases/ContentPart.md @@ -14,7 +14,7 @@ type ContentPart = | DocumentPart; ``` -Defined in: [packages/typescript/ai/src/types.ts:240](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L240) +Defined in: [packages/typescript/ai/src/types.ts:241](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L241) Union type for all multimodal content parts. diff --git a/docs/reference/type-aliases/ContentPartForInputModalitiesTypes.md b/docs/reference/type-aliases/ContentPartForInputModalitiesTypes.md index 884f43c0d..7b707e3c7 100644 --- a/docs/reference/type-aliases/ContentPartForInputModalitiesTypes.md +++ b/docs/reference/type-aliases/ContentPartForInputModalitiesTypes.md @@ -11,7 +11,7 @@ type ContentPartForInputModalitiesTypes = Extract; ``` -Defined in: [packages/typescript/ai/src/types.ts:257](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L257) +Defined in: [packages/typescript/ai/src/types.ts:258](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L258) Helper type to filter ContentPart union to only include specific modalities. Used to constrain message content based on model capabilities. diff --git a/docs/reference/type-aliases/ContentPartSource.md b/docs/reference/type-aliases/ContentPartSource.md index c11bdee3b..d7b5b3bc3 100644 --- a/docs/reference/type-aliases/ContentPartSource.md +++ b/docs/reference/type-aliases/ContentPartSource.md @@ -11,7 +11,7 @@ type ContentPartSource = | ContentPartUrlSource; ``` -Defined in: [packages/typescript/ai/src/types.ts:183](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L183) +Defined in: [packages/typescript/ai/src/types.ts:184](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L184) Source specification for multimodal content. Discriminated union supporting both inline data (base64) and URL-based content. diff --git a/docs/reference/type-aliases/DebugOption.md b/docs/reference/type-aliases/DebugOption.md new file mode 100644 index 000000000..10ea542db --- /dev/null +++ b/docs/reference/type-aliases/DebugOption.md @@ -0,0 +1,14 @@ +--- +id: DebugOption +title: DebugOption +--- + +# Type Alias: DebugOption + +```ts +type DebugOption = boolean | DebugConfig; +``` + +Defined in: [packages/typescript/ai/src/logger/types.ts:78](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/logger/types.ts#L78) + +The shape accepted by the `debug` option on every `@tanstack/ai` activity. Pass `true` to enable all categories with the default console logger; `false` to silence everything including errors; an object for granular control. diff --git a/docs/reference/type-aliases/InferSchemaType.md b/docs/reference/type-aliases/InferSchemaType.md index d5a50de4f..7e64f3734 100644 --- a/docs/reference/type-aliases/InferSchemaType.md +++ b/docs/reference/type-aliases/InferSchemaType.md @@ -9,7 +9,7 @@ title: InferSchemaType type InferSchemaType = T extends StandardJSONSchemaV1 ? TInput : unknown; ``` -Defined in: [packages/typescript/ai/src/types.ts:110](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L110) +Defined in: [packages/typescript/ai/src/types.ts:111](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L111) Infer the TypeScript type from a schema. For Standard JSON Schema compliant schemas, extracts the input type. diff --git a/docs/reference/type-aliases/InputModalitiesTypes.md b/docs/reference/type-aliases/InputModalitiesTypes.md index 2c231dab5..aaa24e219 100644 --- a/docs/reference/type-aliases/InputModalitiesTypes.md +++ b/docs/reference/type-aliases/InputModalitiesTypes.md @@ -9,7 +9,7 @@ title: InputModalitiesTypes type InputModalitiesTypes = object; ``` -Defined in: [packages/typescript/ai/src/types.ts:360](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L360) +Defined in: [packages/typescript/ai/src/types.ts:361](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L361) ## Properties @@ -19,7 +19,7 @@ Defined in: [packages/typescript/ai/src/types.ts:360](https://github.com/TanStac inputModalities: ReadonlyArray; ``` -Defined in: [packages/typescript/ai/src/types.ts:361](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L361) +Defined in: [packages/typescript/ai/src/types.ts:362](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L362) *** @@ -29,4 +29,4 @@ Defined in: [packages/typescript/ai/src/types.ts:361](https://github.com/TanStac messageMetadataByModality: DefaultMessageMetadataByModality; ``` -Defined in: [packages/typescript/ai/src/types.ts:362](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L362) +Defined in: [packages/typescript/ai/src/types.ts:363](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L363) diff --git a/docs/reference/type-aliases/MessagePart.md b/docs/reference/type-aliases/MessagePart.md index f9f76d293..fc4f90228 100644 --- a/docs/reference/type-aliases/MessagePart.md +++ b/docs/reference/type-aliases/MessagePart.md @@ -17,4 +17,4 @@ type MessagePart = | ThinkingPart; ``` -Defined in: [packages/typescript/ai/src/types.ts:339](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L339) +Defined in: [packages/typescript/ai/src/types.ts:340](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L340) diff --git a/docs/reference/type-aliases/ModalitiesArrayToUnion.md b/docs/reference/type-aliases/ModalitiesArrayToUnion.md index 8bd30a11a..5f9d2ee58 100644 --- a/docs/reference/type-aliases/ModalitiesArrayToUnion.md +++ b/docs/reference/type-aliases/ModalitiesArrayToUnion.md @@ -9,7 +9,7 @@ title: ModalitiesArrayToUnion type ModalitiesArrayToUnion = T[number]; ``` -Defined in: [packages/typescript/ai/src/types.ts:274](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L274) +Defined in: [packages/typescript/ai/src/types.ts:275](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L275) Helper type to convert a readonly array of modalities to a union type. e.g., readonly ['text', 'image'] -> 'text' | 'image' diff --git a/docs/reference/type-aliases/Modality.md b/docs/reference/type-aliases/Modality.md index c240a2fb7..1a164036b 100644 --- a/docs/reference/type-aliases/Modality.md +++ b/docs/reference/type-aliases/Modality.md @@ -9,7 +9,7 @@ title: Modality type Modality = "text" | "image" | "audio" | "video" | "document"; ``` -Defined in: [packages/typescript/ai/src/types.ts:136](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L136) +Defined in: [packages/typescript/ai/src/types.ts:137](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L137) Supported input modality types for multimodal content. - 'text': Plain text content diff --git a/docs/reference/type-aliases/SchemaInput.md b/docs/reference/type-aliases/SchemaInput.md index 8cc81b120..c496352e4 100644 --- a/docs/reference/type-aliases/SchemaInput.md +++ b/docs/reference/type-aliases/SchemaInput.md @@ -11,7 +11,7 @@ type SchemaInput = | JSONSchema; ``` -Defined in: [packages/typescript/ai/src/types.ts:103](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L103) +Defined in: [packages/typescript/ai/src/types.ts:104](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L104) Union type for schema input - can be any Standard JSON Schema compliant schema or a plain JSONSchema object. diff --git a/docs/reference/type-aliases/StreamChunk.md b/docs/reference/type-aliases/StreamChunk.md index d223e68e3..0fe7fe8d7 100644 --- a/docs/reference/type-aliases/StreamChunk.md +++ b/docs/reference/type-aliases/StreamChunk.md @@ -9,7 +9,7 @@ title: StreamChunk type StreamChunk = AGUIEvent; ``` -Defined in: [packages/typescript/ai/src/types.ts:1143](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1143) +Defined in: [packages/typescript/ai/src/types.ts:1152](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L1152) Chunk returned by the SDK during streaming chat completions. Uses the AG-UI protocol event format. diff --git a/docs/reference/type-aliases/StreamChunkType.md b/docs/reference/type-aliases/StreamChunkType.md index 5cdc6bb1f..418daa220 100644 --- a/docs/reference/type-aliases/StreamChunkType.md +++ b/docs/reference/type-aliases/StreamChunkType.md @@ -9,7 +9,7 @@ title: StreamChunkType type StreamChunkType = AGUIEventType; ``` -Defined in: [packages/typescript/ai/src/types.ts:776](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L776) +Defined in: [packages/typescript/ai/src/types.ts:785](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L785) Stream chunk/event types (AG-UI protocol). diff --git a/docs/reference/type-aliases/ToolCallState.md b/docs/reference/type-aliases/ToolCallState.md index 34d82935d..a72ff5d68 100644 --- a/docs/reference/type-aliases/ToolCallState.md +++ b/docs/reference/type-aliases/ToolCallState.md @@ -14,6 +14,6 @@ type ToolCallState = | "approval-responded"; ``` -Defined in: [packages/typescript/ai/src/types.ts:32](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L32) +Defined in: [packages/typescript/ai/src/types.ts:33](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L33) Tool call states - track the lifecycle of a tool call diff --git a/docs/reference/type-aliases/ToolResultState.md b/docs/reference/type-aliases/ToolResultState.md index ce47f609b..0a76173d2 100644 --- a/docs/reference/type-aliases/ToolResultState.md +++ b/docs/reference/type-aliases/ToolResultState.md @@ -9,6 +9,6 @@ title: ToolResultState type ToolResultState = "streaming" | "complete" | "error"; ``` -Defined in: [packages/typescript/ai/src/types.ts:42](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L42) +Defined in: [packages/typescript/ai/src/types.ts:43](https://github.com/TanStack/ai/blob/main/packages/typescript/ai/src/types.ts#L43) Tool result states - track the lifecycle of a tool result