Skip to content

Vercel.AI.Provider

API reference

Language model, embedding, image, and other model contracts.

Type Summary
AiSdkException Base exception for the community .NET port of the Vercel AI SDK.
ApiConnectionException The connection to the provider failed.
ApiException The provider returned a non-success HTTP status after retries.
ApiTimeoutException The provider call timed out.
ApiUserAbortException The call was cancelled through a CancellationToken. It derives from OperationCanceledException, so catch (OperationCanceledException) handles every caller cancel. It is not an AiSdkException.
AssistantContentPart One part of an assistant message, kept in the order the model produced it.
AssistantCustomPart A provider-specific part, identified by Kind.
AssistantFilePart A file in an assistant message. Maps to the assistant file part.
AssistantModelMessage An assistant message.
AssistantReasoningFilePart A file the model produced as part of its reasoning. Maps to the assistant reasoning-file part.
AssistantReasoningPart Reasoning in an assistant message.
AssistantTextPart Text in an assistant message.
AssistantToolApprovalRequestPart A request to approve a tool call, kept in an assistant message.
AssistantToolCallPart A tool call in an assistant message.
AssistantToolResultPart A provider-executed tool result in an assistant message.
AudioInput Audio sent to a transcription or translation model.
AudioUsage Numeric usage from a speech or transcription call. A count stays unset when the provider does not report that unit.
AuthenticationException HTTP 401.
BadRequestException HTTP 400.
BatchJob A submitted batch job.
CallWarning A warning produced while calling a model.
Citation A reference that supports generated text: the source it points at, plus the optional range of the text it supports and the cited passage. It is not a second copy of the retrieved sources.
CustomStreamPart A provider-specific part, identified by Kind.
DocumentSourceStreamPart A retrieved document, such as a file a search tool returned.
EmbeddingCallOptions Per-call embedding settings. Maps to the options of doEmbed.
EmbeddingResponseInfo Raw HTTP response of an embedding call. Maps to response of doEmbed.
EmbeddingResult Embedding vector result.
ErrorMessage Formats an unknown thrown value the way getErrorMessage does.
ErrorStreamPart A stream error from the provider.
EvaluationResult Deprecated name of RubricResult.
FileContentPart A file or image in a user message.
FinishReasons Maps provider finish-reason strings onto FinishReason.
FinishStreamPart The stream finished.
GeneratedContent Content the model generated.
GeneratedCustom A provider-specific content part, identified by Kind. It carries no data of its own; the provider keeps it in ProviderMetadata.
GeneratedDocumentSource A document source, such as a retrieved file or a cited document.
GeneratedFile A generated file.
GeneratedImage One generated image.
GeneratedReasoning Reasoning text kept separate from the answer.
GeneratedSource A URL source cited by the model.
GeneratedText Generated text.
GeneratedToolApprovalRequest A request to approve a tool call, such as one a provider-executed MCP tool needs. A model returns it with ToolCallId only; the generation loop fills in ToolCall.
GeneratedToolCall A function tool call.
GeneratedToolResult A tool result: one the provider produced itself, such as a web or file search, or one the generation loop produced by running a client tool.
ImageCallOptions Image call settings.
ImageGenerationResult Image generation result.
ImageResponseInfo Response metadata of an image call. Maps to response of doGenerate on an image model.
InternalServerException HTTP 500-599.
JsError JavaScript Error analog whose ToString() omits the stack.
JsRangeError JavaScript RangeError analog.
JsTypeError JavaScript TypeError analog.
LanguageModelCallOptions Settings for one language-model call. Property names follow the V4 call options.
LanguageModelGenerateResult Result of CancellationToken).
LanguageModelStreamPart One part of a language-model stream.
LanguageModelStreamRequest Request info for a stream call. Maps to the request field of doStream.
LanguageModelStreamResponse Response info for a stream call. Maps to the response field of doStream.
LanguageModelStreamResult What CancellationToken) returns: the stream plus the request and response info. Maps to the { stream, request, response } object returned by doStream. Enumerating the result enumerates Stream. A provider opens the HTTP response in DoStreamAsync. Dispose the result to release that response when you stop without enumerating the stream, or while you enumerate it. Disposing is safe to repeat, and it does nothing after the stream has ended.
LanguageModelTool A function tool definition sent to the model.
LanguageModelUsage Token counts for a model call.
MessageConversionException A UI message could not be converted to a model message. Maps to MessageConversionError.
ModelMessage A prompt message.
NotFoundException HTTP 404.
PermissionDeniedException HTTP 403.
ProviderBase Provider factory. Maps to ProviderV4. Modalities a provider does not implement throw AiSdkException.
RateLimitException HTTP 429.
RawStreamPart One raw provider stream event.
ReasoningDeltaStreamPart A reasoning delta.
ReasoningEndStreamPart Marks the end of one reasoning block.
ReasoningStartStreamPart Marks the start of one reasoning block.
RerankItem One reranked document.
RerankResult Rerank result.
ResponseMetadataStreamPart Identifies the provider response.
RubricModels Helpers for IRubricModel.
RubricResult Score of a candidate against a rubric. Returned by IRubricModel.
SourceStreamPart A cited URL.
SpeechCallOptions Speech call settings.
SpeechResult Speech synthesis result.
StreamStartStreamPart Marks the start of a stream and carries call warnings.
SystemModelMessage System instructions.
TextContentPart Text in a user message.
TextDeltaStreamPart A text delta.
TextEndStreamPart Marks the end of one text block.
TextStartStreamPart Marks the start of one text block.
ToolApprovalRequestStreamPart A request to approve a tool call.
ToolApprovalResponseModelMessage The caller’s answer to a GeneratedToolApprovalRequest. Only a response with ProviderExecuted reaches the model; the generation loop drops the others from the prompt.
ToolCallStreamPart A completed tool call.
ToolChoice How the model should choose tools. Maps to toolChoice.
ToolChoice.NamedChoice A named tool choice.
ToolInputDeltaStreamPart A streamed tool-argument fragment.
ToolInputEndStreamPart Marks the end of streamed tool input.
ToolInputStartStreamPart Marks the start of streamed tool input.
ToolModelMessage A tool result fed back to the model.
ToolResultStreamPart A tool result the provider reported.
TranscriptionResult Transcription result.
UnprocessableEntityException HTTP 422.
UploadedFile An uploaded file.
UploadedSkill An uploaded skill.
UserContentPart A user content part.
UserModelMessage A user message.
VideoCallOptions Video call settings.
VideoResult Video generation result.
Type Summary
IBatchModel Batch model specification.
IEmbeddingModel Embedding model specification.
IEvaluationModel Deprecated name of IRubricModel. Pass it to EvaluationModel or IEvaluationModel).
IFileStore File store used by uploadFile.
IImageModel Image model specification.
ILanguageModel Language model specification V4. doGenerate is CancellationToken) and doStream is CancellationToken).
IRealtimeModel Realtime model specification.
IRealtimeSession A realtime session.
IRerankingModel Reranking model specification.
IRubricModel A model that scores a candidate against a rubric. Used by CancellationToken).
ISkillStore Skill store used by uploadSkill.
ISpeechModel Speech model specification.
ISpeechTranslationModel Speech translation model specification.
ITranscriptionModel Transcription model specification.
IVideoModel Video model specification.
Type Summary
FinishReason Why a language-model call stopped.
ToolInputEncoding Encoding of the deltas that follow a tool-input-start part.

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