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
MetadataStore
Defined in: packages/ai/src/activities/chat/middleware/metadata.ts:9
Namespaced key/value store for app and middleware metadata.
(namespace, key) is the composite identity. Keep both values separate; joining them with a delimiter can create collisions.
Properties#
delete#
delete: (namespace, key) => Promise<void>;Defined in: packages/ai/src/activities/chat/middleware/metadata.ts:15
Delete (namespace, key). Do nothing when it is absent.
Parameters#
namespace#
string
key#
string
Returns#
Promise<void>
get#
get: (namespace, key) => Promise<unknown>;Defined in: packages/ai/src/activities/chat/middleware/metadata.ts:11
Return the value for (namespace, key), or null when it is absent.
Parameters#
namespace#
string
key#
string
Returns#
Promise<unknown>
getVersioned?#
optional getVersioned?: (namespace, key) => Promise<
| {
revision: string;
value: unknown;
}
| null>;Defined in: packages/ai/src/activities/chat/middleware/metadata.ts:22
Optional. The value with a revision, or null when it is absent. Pair it with setIf for compare-and-set writes: implement both or neither. Every write (also a plain set) gives the key a new revision, and a revision does not come back after a delete.
Parameters#
namespace#
string
key#
string
Returns#
Promise< | { revision: string; value: unknown; } | null>
set#
set: (namespace, key, value) => Promise<void>;Defined in: packages/ai/src/activities/chat/middleware/metadata.ts:13
Insert or replace the value for (namespace, key).
Parameters#
namespace#
string
key#
string
value#
unknown
Returns#
Promise<void>
setIf?#
optional setIf?: (namespace, key, value, expectedRevision) => Promise<
| {
ok: true;
revision: string;
}
| {
ok: false;
reason: "conflict";
}>;Defined in: packages/ai/src/activities/chat/middleware/metadata.ts:31
Optional. Write only when the current revision is expectedRevision (null means the key is absent). Success is { ok: true, revision }. A different revision returns { ok: false, reason: 'conflict' }.
Parameters#
namespace#
string
key#
string
value#
unknown
expectedRevision#
string | null
Returns#
Promise< | { ok: true; revision: string; } | { ok: false; reason: "conflict"; }>