Skip to content

Vercel.AI.Operations

API reference

Speech, image, video, embeddings, transcription, and other operations.

Type Summary
AiSdkVersion Package version used in the ai/ user-agent suffix.
AudioChunkStream Audio the model may take ownership of.
Batch Batch operations. Maps to startBatch, getBatchStatus, getBatchResults, listBatches, and cancelBatch.
BatchCancelResult Cancellation result.
BatchContentPart One content part inside a batch text result.
BatchImageGeneration A provider image generation inside a batch item.
BatchItem One raw batch item.
BatchItemResult Normalized batch item.
BatchListResult A page of batches.
BatchModels Default provider used when a batch call omits one.
BatchModelUsage Provider token usage before it is reshaped.
BatchOperationCall Arguments for a batch operation.
BatchReference A version-2 batch reference.
BatchRequest One request in a batch.
BatchRequestCounts Request counts.
BatchRequestOptions Options for batch operations.
BatchRequestWarning A warning tied to a request.
BatchStartResult Start acknowledgement.
BatchStatus Status fields shared by start, list, and status calls.
BatchTextGeneration A provider text generation inside a batch item.
BatchTool A tool definition forwarded to a batch without being executed.
BatchUsage Usage returned to batch callers.
Decide Decides typed questions. Maps to experimentaldecide.
DecideEvent Lifecycle event for decide.
DecideRequest Options for CancellationToken).
DecideTelemetry Telemetry callbacks. Generic onStart and onEnd are not invoked.
DecisionAnswer One model answer. Numbers are returned unchanged.
DecisionBooleanCriteria Optional descriptions of the true and false outcomes of a boolean question. A side that is never set is left out of the wire request. A side set to null is sent as null.
DecisionBox Edges in [0, 1], measured from the image’s top-left corner.
DecisionCaller Helpers for IDecisionCaller.
DecisionChoiceCriteria Criteria of a choice question: a nonempty map of option names to descriptions. A null description means none.
DecisionCriteria Criteria of a decision question. Maps to the criteria member of DecisionModelV4Question.
DecisionFilePart A file part of decision state. A URL is downloaded before the model call.
DecisionInput Content for decision instructions and criteria descriptions: a string, a JSON object, or a JSON array. Maps to DecisionModelV4Input.
DecisionJsonPart A JSON part of decision state.
DecisionLanguageModel Adapts structured language-model output to Choice, Score, and Boolean decisions. Maps to DecisionLanguageModel.
DecisionLanguageModelOptions The wrapped model and provider id that cross a workflow boundary for DecisionLanguageModel.
DecisionModelCall Arguments for doDecide.
DecisionModelEvent Model-call telemetry event.
DecisionModelFilePart A file part the model receives. Maps to LanguageModelV4FilePart.
DecisionModelJsonPart A JSON part the model receives.
DecisionModelResult Model response for doDecide.
DecisionModels Resolves decision models, including string model ids. Maps to resolveDecisionModel.
DecisionModelStatePart A part of decision state as the model receives it. Maps to DecisionModelV4StatePart.
DecisionModelTextPart A text part the model receives.
DecisionQuestion One decision question. Maps to DecisionModelV4Question.
DecisionResult Decision result.
DecisionRounding Declared rounding precision.
DecisionScoreCriteria Criteria of a score question: at least two ordered levels, indexed from zero. A null description means none.
DecisionState Shared state of a decision: text, a JSON object, or ordered parts. Maps to DecisionState. A JSON array is not valid state. Wrap it in an object or in a DecisionJsonPart. CancellationToken) maps to prepareDecisionState.
DecisionStatePart A part of decision state as the caller passes it. Maps to DecisionStatePart.
DecisionTextPart A text part of decision state.
DecisionUnsupportedQuestionTypeException The decision model does not support a question type. It carries the ErrorMarker marker, so IsInstance(object) recognizes it.
DownloadedMedia Downloaded media.
DownloadException Downloading generated media failed.
Embed Embeds one value. Maps to embed.
EmbeddingModelCall Arguments for one doEmbed call.
EmbeddingModelCallEvent One inner doEmbed telemetry event.
EmbeddingModelResponse One embedding returned by a model call.
EmbedEndEvent End event for embed and embedMany.
EmbedMany Embeds many values, splitting on count and UTF-8 byte limits. Maps to embedMany.
EmbedManyRequest Options for CancellationToken).
EmbedManyResult Result of CancellationToken).
EmbedRequest Options for CancellationToken).
EmbedResult Result of CancellationToken).
EmbedStartEvent Start event for embed and embedMany.
EmbedTelemetry Telemetry callbacks for an embedding operation.
Evaluate Deprecated alias of Decide.
EvaluateEvent Deprecated alias of DecideEvent.
EvaluateModelEvent Deprecated alias of DecisionModelEvent.
EvaluateRequest Deprecated alias of DecideRequest.
EvaluateResult Deprecated alias of DecisionResult.
EvaluateTelemetry Deprecated alias of DecideTelemetry.
EvaluationAnswer Deprecated alias of DecisionAnswer.
EvaluationModelCall Deprecated alias of DecisionModelCall.
EvaluationModelResult Deprecated alias of DecisionModelResult.
EvaluationQuestion Deprecated alias of DecisionQuestion.
EvaluationRounding Deprecated alias of DecisionRounding.
EvaluationUnsupportedQuestionTypeException Deprecated alias of DecisionUnsupportedQuestionTypeException.
GeneratedAudio Generated speech audio.
GeneratedImage A generated image file.
GeneratedVideo A generated video file.
GenerateImage Generates images. Maps to generateImage.
GenerateImageRequest Options for CancellationToken).
GenerateImageResult Result of CancellationToken).
GenerateSpeech Generates speech. Maps to generateSpeech.
GenerateSpeechRequest Options for CancellationToken).
GenerateSpeechResult Result of CancellationToken).
GenerateVideo Generates videos. Maps to experimentalgenerateVideo.
GenerateVideoRequest Options shared by generate and start.
GenerateVideoResult Result of CancellationToken).
GetVideoStatus Reads video operation status. Maps to experimentalgetVideoStatus.
GetVideoStatusRequest Options for CancellationToken).
GoogleMultimodalEmbedding Gemini embedding caller used by EmbedMany. Splits multimodal google.content to the chunk that is about to be sent and posts embedContent or batchEmbedContents.
ImageCallResult One provider call preserved on the result.
ImageModelCall Arguments for one image model call.
ImageModelFile An image sent to doGenerate as a file or URL.
ImageModelResult One doGenerate result.
ImagePrompt A string prompt or an image edit prompt.
ImagePromptParts Normalized image prompt fields.
InvalidArgumentException Invalid caller argument. Maps to InvalidArgumentError.
InvalidResponseDataException The provider response did not match the expected shape.
ListedBatch One listed batch.
MediaTypeDetector Detects media types from file signatures.
ModelPartStream Model stream that stays open until Cancel() when Completes is false.
ModelStreamPart A part emitted by a transcription or translation model stream.
NoImageGeneratedException No image was produced after retries.
NormalizedBatchRequest Normalized request sent to doStartBatch.
NoSpeechGeneratedException No speech audio was produced.
NoTranscriptGeneratedException No transcript text was produced.
NoTranslationGeneratedException No translation text or audio was produced.
NoVideoGeneratedException No video was produced.
OperationCallbacks Invokes callbacks and swallows their exceptions.
OperationFullStream<T> A single-consumer stream with an explicit Cancel.
OperationHeaders Header and retry helpers shared by the operation types.
OperationJson JSON helpers used while normalizing provider options.
OperationRequest Shared request fields for an operation call.
OperationRetry Retries a provider call the way prepareRetries does.
OperationRetryException Retries were exhausted. LastError is the final attempt.
OperationUsage Token counts for an image or evaluation call.
OperationWarning A warning returned by a model call.
PartQueue<T> Async queue used to hand stream parts to one consumer.
PendingPromise<T> A promise that can be resolved once.
ProviderFileReference A provider file reference.
ProviderResponse Headers and body returned by one provider call.
RankedDocument One document in the reranked order.
Rerank Reranks documents. Maps to rerank.
RerankEndEvent End event for rerank.
RerankModelCall Arguments for doRerank.
RerankModelCallEvent Inner rerank telemetry event.
RerankModelDocuments Documents sent to a reranking model.
RerankModelRank One ranked index from the model.
RerankModelResponse Model response for doRerank.
RerankRequest Options for CancellationToken).
RerankResponseInfo Response metadata for a rerank call.
RerankResult Result of CancellationToken).
RerankStartEvent Start event for rerank.
RerankTelemetry Telemetry callbacks for rerank.
RetryableCallException A provider HTTP failure that may be retried.
SearchableTool A tool the search step can hide until it is discovered.
SkillFile One file inside a skill upload.
SkillFilePayload Normalized skill file passed to the provider.
SpeechAudioFormat Audio format of a speech stream, such as audio/pcm at 24000 Hz or audio/mpeg.
SpeechModelCall Arguments for doGenerate on a speech model.
SpeechModelResult Speech model response.
SpeechModels Resolves string speech model ids.
SpeechModelStreamCall Arguments for doStream on a speech model. Maps to SpeechModelV4StreamOptions.
SpeechModelStreamPart A part emitted by a streaming speech model. Maps to SpeechModelV4StreamPart.
SpeechModelStreamResponse Response data returned by doStream.
SpeechModelStreamResult The result of a speech model doStream call. Maps to SpeechModelV4StreamResult.
SpeechStreamPart A part of FullStream.
SpeechStreamUsage Usage of a speech stream call. Every field is optional because providers bill speech in different units.
SpeechTextPart One piece of streamed input text. Consecutive parts are synthesized in order as one continuous script. Maps to SpeechTextPart and SpeechModelV4StreamTextPart.
SpeechTextStream The text a speech model reads. The provider owns it once doStream is called: it must enumerate it to the end or dispose its enumerator on every terminal path.
SpeechTranslationModels Resolves string speech-translation model ids.
StartVideo Starts a video generation. Maps to experimentalstartVideo.
StartVideoResult Result of CancellationToken).
StreamSpeech Streams speech audio. Maps to experimentalstreamSpeech.
StreamSpeechRequest Options for CancellationToken).
StreamSpeechResult Result of CancellationToken). Maps to StreamSpeechResult.
StreamTranscribe Streams a transcript. Maps to streamTranscribe.
StreamTranscribeRequest Options for CancellationToken).
StreamTranscribeResult Streaming transcription result.
StreamTranslate Streams a speech translation. Maps to streamTranslate.
StreamTranslateRequest Options for CancellationToken).
StreamTranslateResult Streaming translation result.
ToolCallerBinding How a tool may be called.
ToolCallers Direct tool invocation. An omitted routing entry permits this caller.
ToolSearch Creates the search tool. Maps to toolSearch.
ToolSearchCall A planned model tool call.
ToolSearchGeneration Runs the tool-search step loop used by generateText, streamText, and the tool-loop agent. The model tool list, execution timing, and catalog messages match across those modes.
ToolSearchMatch One discovered tool. Schemas are not included.
ToolSearchMatchList Tools returned by one search.
ToolSearchRun The outcome of a tool-search generation.
ToolSearchState Per-generation discovery state. Maps to createToolSearchState.
ToolSearchStepItem A tool result or tool error from one step.
ToolSearchStepRecord One model step produced by ToolSearchGeneration.
Transcribe Transcribes audio. Maps to transcribe.
TranscribeRequest Options for CancellationToken).
TranscribeResult Transcription result.
TranscriptionModelCall Arguments for a transcription doGenerate.
TranscriptionModelResult Transcription model response.
TranscriptionModels Resolves string transcription model ids.
TranscriptionStreamCall Arguments for streaming transcription.
TranscriptionStreamStart A started transcription stream.
TranscriptSegment One timed transcript segment.
TranslationStreamCall Arguments for a speech-translation stream.
TranslationStreamStart A started translation stream.
UnsupportedFunctionalityException The provider does not implement the requested operation.
UnsupportedModelVersionException The model specification version is not supported.
UploadData Tagged file bytes, text, or a stream.
UploadFile Uploads a file. Maps to uploadFile.
UploadFileCall Arguments forwarded to a files API.
UploadFileModelResult Provider upload result.
UploadFileRequest Options for CancellationToken).
UploadFileResult Result of CancellationToken).
UploadSkill Uploads a skill. Maps to uploadSkill.
UploadSkillCall Arguments for a skill upload.
UploadSkillRequest Options for CancellationToken).
UploadSkillResult Skill upload result.
UploadStream A stream the provider may take ownership of.
VideoCallInputs Normalized prompt, frames, and references.
VideoFrameFile A normalized frame image.
VideoFrameImage A role-tagged frame image.
VideoModelCall Arguments shared by generate, start, and status.
VideoModelFile A file or URL passed to a video model.
VideoModelResult Synchronous doGenerate result or a completed status payload.
VideoOutput One generated video payload from the model.
VideoPrompt Text prompt or a prompt with a start image.
VideoReference Reference media, either raw content or an object with a media type.
VideoStartResult Result of doStart.
VideoStatusResult Result of doStatus.
VideoWebhook Webhook notification.
WarningLog Warning logger. Observer sees every call, including empty warning lists. Logger maps to globalThis.AISDKLOGWARNINGS.
WarningLogContext Arguments passed to the warning logger.
Type Summary
IBatchApi Batch API.
IBatchProvider Provider that exposes experimentalbatch().
IDecisionCaller Decision model used by Decide.
IDecisionProvider A provider that returns decision models. ProviderRegistry and CustomProvider resolve decision models through it. Maps to the optional decisionModel factory of a provider.
IEmbeddingCaller Embedding model used by Embed and EmbedMany.
IEvaluationCaller Deprecated decision model contract. Implement IDecisionCaller instead.
IEvaluationDecisionCaller A decision model that also has the deprecated CancellationToken). Returned by the deprecated EvaluationModel accessors of ProviderRegistry and CustomProvider. Both methods decide the same way.
IEvaluationProvider Deprecated provider factory for decision models. Implement IDecisionProvider instead. A provider that implements both is asked through IDecisionProvider only.
IFileStore Files API.
IFileStoreProvider Provider that can expose a files API.
IImageCaller Image model used by GenerateImage.
IRerankCaller Reranking model used by Rerank.
ISkillStore Skills API.
ISkillStoreProvider Provider that can expose a skills API.
ISpeechCaller Speech model used by GenerateSpeech.
ISpeechTranslationCaller Speech translation model used by StreamTranslate.
IStreamingSpeechCaller A speech model that can also stream speech audio for streamed text input. Maps to ExperimentalStreamingSpeechModelV4.
ITranscriptionCaller Transcription model used by Transcribe.
IVideoCaller Video model used by generate, start, and status.

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product