Class References
Function References
- text
- textOptions
- combineStrategies
- convertMessagesToModelMessages
- convertZodToJsonSchema
- createReplayStream
- embedding
- generateMessageId
- maxIterations
- messages
- modelMessageToUIMessage
- modelMessagesToUIMessages
- normalizeToUIMessage
- parsePartialJSON
- summarize
- toServerSentEventsStream
- toServerSentEventsResponse
- toolDefinition
- uiMessageToModelMessages
- realtimeToken
- untilFinishReason
Interface References
- AIAdapter
- AIAdapterConfig
- AgentLoopState
- AudioPart
- AudioVisualization
- BaseStreamChunk
- TextCompletionChunk
- TextOptions
- ChunkRecording
- ChunkStrategy
- ClientTool
- ContentPartSource
- ContentStreamChunk
- DefaultMessageMetadataByModality
- DocumentPart
- DoneStreamChunk
- EmbeddingOptions
- EmbeddingResult
- ErrorStreamChunk
- ImagePart
- InternalToolCallState
- JSONParser
- ModelMessage
- ProcessorResult
- ProcessorState
- RealtimeAdapter
- RealtimeClientOptions
- RealtimeConnection
- RealtimeMessage
- RealtimeSessionConfig
- RealtimeToken
- RealtimeTokenAdapter
- RealtimeTokenOptions
- ResponseFormat
- ServerTool
- StreamProcessorEvents
- StreamProcessorHandlers
- StreamProcessorOptions
- SummarizationOptions
- SummarizationResult
- TextPart
- ThinkingPart
- ThinkingStreamChunk
- Tool
- ToolCall
- ToolCallPart
- ToolCallStreamChunk
- ToolConfig
- ToolDefinition
- ToolDefinitionConfig
- ToolDefinitionInstance
- ToolInputAvailableStreamChunk
- ToolResultPart
- ToolResultStreamChunk
- UIMessage
- VideoPart
Type Alias References
- AgentLoopStrategy
- AnyClientTool
- TextStreamOptionsForModel
- TextStreamOptionsUnion
- ConstrainedContent
- ConstrainedModelMessage
- ContentPart
- ContentPartForModalities
- ExtractModalitiesForModel
- ExtractModelsFromAdapter
- InferToolInput
- InferToolName
- InferToolOutput
- MessagePart
- RealtimeEvent
- RealtimeMessagePart
- RealtimeMode
- RealtimeStatus
- ModalitiesArrayToUnion
- Modality
- StreamChunk
- ToolCallState
- ToolResultState
Variable References
Logger
Defined in: packages/ai/src/logger/types.ts:4
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#
debug: (message, meta?) => void;Defined in: packages/ai/src/logger/types.ts:9
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; the default ConsoleLogger renders it with a runtime-appropriate strategy (depth-unlimited console.dir on Node, JSON appended to the message on Cloudflare Workers, a second console.<level> argument elsewhere).
Returns#
void
error#
error: (message, meta?) => void;Defined in: packages/ai/src/logger/types.ts:24
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; the default ConsoleLogger renders it with a runtime-appropriate strategy (depth-unlimited console.dir on Node, JSON appended to the message on Cloudflare Workers, a second console.<level> argument elsewhere).
Returns#
void
info#
info: (message, meta?) => void;Defined in: packages/ai/src/logger/types.ts:14
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; the default ConsoleLogger renders it with a runtime-appropriate strategy (depth-unlimited console.dir on Node, JSON appended to the message on Cloudflare Workers, a second console.<level> argument elsewhere).
Returns#
void
warn#
warn: (message, meta?) => void;Defined in: packages/ai/src/logger/types.ts:19
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; the default ConsoleLogger renders it with a runtime-appropriate strategy (depth-unlimited console.dir on Node, JSON appended to the message on Cloudflare Workers, a second console.<level> argument elsewhere).
Returns#
void