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
ToolDefinitionConfig
type ToolDefinitionConfig<TInput, TOutput, TName, TNeedsApproval, TApprovalSchema, TResultMetadataSchema> = object & ApprovalConfig<TNeedsApproval, TApprovalSchema>;Defined in: packages/ai/src/activities/chat/tools/tool-definition.ts:236
Tool definition configuration
Type Parameters#
TInput#
TInput extends SchemaInput | undefined = undefined
TOutput#
TOutput extends SchemaInput | undefined = undefined
TName#
TName extends string = string
TNeedsApproval#
TNeedsApproval extends boolean = false
TApprovalSchema#
TApprovalSchema extends ApprovalSchemaConfig | undefined = undefined
TResultMetadataSchema#
TResultMetadataSchema extends SchemaInput | undefined = undefined
Type Declaration#
description#
description: string;execution?#
optional execution?: "task";inputSchema?#
optional inputSchema?: TInput;lazy?#
optional lazy?: boolean;metadata?#
optional metadata?: Record<string, unknown>;name#
name: TName;outputSchema?#
optional outputSchema?: TOutput;replay?#
optional replay?: "safe" | "never";Whether a host may run this tool again after a crash cut the run between the call and its result. 'safe' runs it again. Omit the field, or set 'never', when a second run is not safe. The host writes the model note. chat() does not read this field.
resultMetadataSchema?#
optional resultMetadataSchema?: TResultMetadataSchema;Schema for the app-only metadata that the tool sets with context.setResultMetadata. It types the setter and the client part.resultMetadata. The model never sees the metadata.