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
TTSOptions
Defined in: packages/ai/src/types.ts:2882
Options for text-to-speech generation. These are the common options supported across providers.
Type Parameters#
TProviderOptions#
TProviderOptions extends object = object
Properties#
abortSignal?#
optional abortSignal?: AbortSignal;Defined in: packages/ai/src/types.ts:2922
Effective abort signal composed by the activity from caller abortSignal and/or timeout. Adapters should forward this to the provider SDK when supported. Request-specific — never store on a global client config.
format?#
optional format?: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";Defined in: packages/ai/src/types.ts:2906
The output audio format
logger#
logger: InternalLogger;Defined in: packages/ai/src/types.ts:2916
Internal logger threaded from the generateSpeech() entry point. Adapters must call logger.request() before the SDK call and logger.errors() in catch blocks.
model#
model: string;Defined in: packages/ai/src/types.ts:2884
The model to use for TTS generation
modelOptions?#
optional modelOptions?: TProviderOptions;Defined in: packages/ai/src/types.ts:2910
Model-specific options for TTS generation
speed?#
optional speed?: number;Defined in: packages/ai/src/types.ts:2908
The speed of the generated audio (0.25 to 4.0)
text#
text: string;Defined in: packages/ai/src/types.ts:2890
The text to convert to speech. When the caller passed turns, the activity fills this with the turn texts joined by newlines so adapters that only read text still receive the full script.
timestamps?#
optional timestamps?: boolean;Defined in: packages/ai/src/types.ts:2902
Ask for alignment / segments on the result. Rejected by the activity unless the adapter declares capabilities.timestamps, because on some providers this is a different endpoint rather than free metadata.
turns?#
optional turns?: TTSTurn[];Defined in: packages/ai/src/types.ts:2896
Multi-voice dialogue turns, when the caller asked for dialogue. Only adapters that declare capabilities.maxSpeakers ever see this — the activity rejects turns for the rest.
voice?#
optional voice?: string;Defined in: packages/ai/src/types.ts:2904
The voice to use for generation