Skip to content

E2E.Decision.Sdk

API reference

Public types in the E2E.Decision.Sdk namespace.

Type Summary
ApiCallException The AI SDK’s APICallError: a provider call that failed. RunAsync retries it when IsRetryable, waiting for the provider’s retry-after-ms or retry-after header when it is reasonable.
Channel A named channel that delivers each published message to its subscribers (diagnosticsChannel.channel).
CreateDefaultDownloadFunction The AI SDK’s createDefaultDownloadFunction (util/download/download-function.ts).
CreateDownload The AI SDK’s createDownload (util/download/create-download.ts).
CreateDownloadOptions What Create(CreateDownloadOptions) takes (the options of the AI SDK’s createDownload).
CustomProvider The decision models of the AI SDK’s customProvider (custom-provider.ts): a provider that serves its own models and falls back to another provider.
CustomProviderOptions The decision members of the arguments of the AI SDK’s customProvider (ai/src/registry/custom-provider.ts).
DecideEndEvent The event passed to OnEnd (the AI SDK’s DecideEndEvent), when the operation completes successfully. The result’s response is flattened as on DecisionResult.
DecideOptions What RunAsync takes (the arguments of the AI SDK’s experimental_decide).
DecideStartEvent The event passed to OnStart (the AI SDK’s DecideStartEvent), when the operation begins, before the decision model is called.
DecisionAnswer One model answer (the AI SDK’s DecisionAnswer). Numbers are returned as the provider sent them. Type is the question’s type, or refusal when the model declined the question.
DecisionBox Edges in [0, 1], measured from the image’s top-left corner.
DecisionCapabilities Upstream’s ModelCapabilities.decision.
DecisionChoice One option of a choice question.
DecisionFilePart A file, such as a screenshot, as bytes with its media type (the AI SDK’s file part). The data is the bytes, or the same bytes as base64 text in Base64; DataType names another kind (url, reference, or text) a provider may reject.
DecisionFileUrlPart A file at a URL (the AI SDK’s FilePart with URL data). ExperimentalDecide downloads it through ExperimentalDownload and hands the model a DecisionFilePart with the bytes. .NET-only name: C# has no union of bytes and a URL, so the URL form is its own part.
DecisionInput An instruction or a criterion description (the AI SDK’s DecisionModelV4Input): text, or a JSON value the provider serializes into the prompt. A string converts implicitly.
DecisionInputCapabilities The decision inputs of ModelCapabilities.decision.inputs.
DecisionJsonPart A JSON value the model reads as data.
DecisionModelCall What DecisionModelCall hands a decision model (the AI SDK’s DecisionModelV4CallOptions).
DecisionModelCallEndEvent The event fired after the decision model response has been validated (the AI SDK’s DecisionModelCallEndEvent): the result of the logical model call, including any retries.
DecisionModelCallStartEvent The event fired when the decision model call begins (the AI SDK’s DecisionModelCallStartEvent). The logical model call includes any provider retries.
DecisionModelResult What a decision model answers a call with (the AI SDK’s DecisionModelV4Result).
DecisionQuestion One decision question (the AI SDK’s DecisionModelV4Question). A choice question carries its options, a score question its ordered levels, and a boolean question instructions or at least one criterion.
DecisionQuestionTypeCapabilities The decision question types of ModelCapabilities.decision.questionTypes.
DecisionRefusalException The AI SDK’s Experimental_DecisionRefusalError: the model refused to answer some questions.
DecisionResult What RunAsync returns (the AI SDK’s DecisionResult).
DecisionRounding Declared rounding precision of the numbers a model returns (decimal places, 0 through 15).
DecisionStatePart A part of the state every question of a decision call shares (the AI SDK’s DecisionModelV4State).
DecisionTextPart Plain text.
DecisionUnsupportedQuestionTypeException The AI SDK’s Experimental_DecisionUnsupportedQuestionTypeError: the model cannot answer a question’s type.
DecisionUsage Tokens a decision call used.
DiagnosticsChannel .NET-only stand-in for Node’s node:diagnostics_channel, which the AI SDK’s tracing channel publishes to (tracing-channel-publisher.ts). A tracing channel is found by name, and every caller that asks for a name gets the same one.
Download The AI SDK’s Download type: the function Create(CreateDownloadOptions) returns. Called with a single URL, it downloads that URL. Called with an array of requests, it behaves like the default experimental_download of decide: URLs the model supports are passed through (null), all others are downloaded. A Download converts to a DownloadFunction, so it can be passed as ExperimentalDownload.
DownloadedFile A file a DownloadFunction downloaded.
DownloadException The AI SDK’s DownloadError (@ai-sdk/provider-utils): a file the SDK could not download.
DownloadRequest One URL a DownloadFunction is asked for (an element of the options array of upstream’s DownloadFunction).
EvaluationDecisionModel A decision model that also has the deprecated doEvaluate (upstream’s DecisionModelV4 & { doEvaluate }, what asEvaluationModel returns). .NET-only: C# needs a named type for the intersection.
ExperimentalDecide The AI SDK’s experimental_decide (ai/src/decide/decide.ts) and its input and answer validation (validate-decision.ts), which the SDK keeps in its ai package and the port has no such package for. .NET-only home.
ExtractionUnsupportedFieldTypeException The AI SDK’s Experimental_ExtractionUnsupportedFieldTypeError: the extraction model does not support the type of a requested field.
InvalidArgumentException The AI SDK’s InvalidArgumentError: a call argument the SDK rejects before any request.
InvalidResponseDataException The AI SDK’s InvalidResponseDataError: the provider’s answers break the contract of the questions.
JsonParseException The AI SDK’s JSONParseError: text that is not valid JSON.
LanguageModelV4AssistantMessage An assistant message: text, file, custom, reasoning, reasoning file, tool call, and tool result parts.
LanguageModelV4CallOptions The AI SDK’s LanguageModelV4CallOptions (language-model-v4-call-options.ts). Upstream’s abortSignal is the CancellationToken of DoGenerateAsync and DoStreamAsync.
LanguageModelV4CustomPart Provider-specific content part of a prompt, with no standardized payload beyond provider options.
LanguageModelV4FilePart File content part of a prompt.
LanguageModelV4FunctionTool A tool that has a name, a description, and a JSON schema for its input (LanguageModelV4FunctionTool).
LanguageModelV4GenerateResult The AI SDK’s LanguageModelV4GenerateResult (language-model-v4-generate-result.ts) of the Gateway. The Gateway passes the response through z.any(), so Content, FinishReason, Usage, and ProviderMetadata are the JSON the Gateway sent, unvalidated, and any other member of the response is in AdditionalProperties.
LanguageModelV4Message The AI SDK’s LanguageModelV4Message (language-model/v4/language-model-v4-prompt.ts). A prompt (LanguageModelV4Prompt) is a list of messages. This is not the user-facing prompt: it is the standardized format a language model takes.
LanguageModelV4PromptPart A content part of a prompt message.
LanguageModelV4ProviderTool A tool that is built into a provider (LanguageModelV4ProviderTool).
LanguageModelV4ReasoningFilePart Reasoning file content part of a prompt: a file generated as part of reasoning.
LanguageModelV4ReasoningPart Reasoning content part of a prompt.
LanguageModelV4RequestMetadata The request of a language model result: the request information, for telemetry and debugging.
LanguageModelV4ResponseFormat The responseFormat of LanguageModelV4CallOptions: text, or JSON with an optional schema.
LanguageModelV4ResponseMetadata The AI SDK’s LanguageModelV4ResponseMetadata (language-model-v4-response-metadata.ts) with the headers and body of a result’s response.
LanguageModelV4StreamPart The AI SDK’s LanguageModelV4StreamPart (language-model-v4-stream-part.ts) of the Gateway. The Gateway passes each part through z.any(), so Json is the part as the Gateway sent it, unvalidated.
LanguageModelV4StreamResult The AI SDK’s LanguageModelV4StreamResult (language-model-v4-stream-result.ts). The stream owns the HTTP response: it is released when the stream is read to its end, when its enumeration is disposed, or when it fails.
LanguageModelV4SystemMessage A system message.
LanguageModelV4TextPart Text content part of a prompt.
LanguageModelV4Tool A tool of a call: a LanguageModelV4FunctionTool or a LanguageModelV4ProviderTool.
LanguageModelV4ToolApprovalResponsePart Tool approval response content part of a prompt: the user’s decision to approve or deny a provider-executed tool call.
LanguageModelV4ToolCallPart Tool call content part of a prompt: a tool call, usually generated by the model.
LanguageModelV4ToolChoice How the tool is selected (LanguageModelV4ToolChoice): automatic, none, required, or a specific tool.
LanguageModelV4ToolMessage A tool message: tool result and tool approval response parts.
LanguageModelV4ToolResultContentCustom Custom content, for provider-specific content parts.
LanguageModelV4ToolResultContentFile File content.
LanguageModelV4ToolResultContentPart A part of a LanguageModelV4ToolResultOutputContent.
LanguageModelV4ToolResultContentText Text content.
LanguageModelV4ToolResultOutput The AI SDK’s LanguageModelV4ToolResultOutput: the result of a tool call. One of LanguageModelV4ToolResultOutputText, LanguageModelV4ToolResultOutputJson, LanguageModelV4ToolResultOutputExecutionDenied, LanguageModelV4ToolResultOutputErrorText, LanguageModelV4ToolResultOutputErrorJson, or LanguageModelV4ToolResultOutputContent.
LanguageModelV4ToolResultOutputContent Tool output made of content parts: text, files, and custom content.
LanguageModelV4ToolResultOutputErrorJson A tool error as JSON.
LanguageModelV4ToolResultOutputErrorText A tool error as text.
LanguageModelV4ToolResultOutputExecutionDenied The user denied the execution of the tool call.
LanguageModelV4ToolResultOutputJson JSON tool output.
LanguageModelV4ToolResultOutputText Text tool output that is sent directly to the API.
LanguageModelV4ToolResultPart Tool result content part of a prompt: the result of the tool call with the matching ID.
LanguageModelV4UserMessage A user message: text and file parts.
LoadApiKeyException The AI SDK’s LoadAPIKeyError: the provider has no API key.
LogWarnings The AI SDK’s logWarnings (logger/log-warnings.ts).
LogWarningsOptions What the warning logger receives (the options of the AI SDK’s LogWarningsFunction).
ModelCapabilities Upstream’s ModelCapabilities. Only the decision section exists in the port.
ModelCapability The AI SDK’s ModelCapability: true, false, ‘unknown’, or { condition }. A condition is documentation, not an expression to execute.
ModelEntry Upstream’s ModelEntry: one provider-owned model record.
ModelProviderOptions Upstream’s ModelProviderOptions: per-model support for a provider’s options, keyed by section and option name.
NoSuchModelException The AI SDK’s NoSuchModelError: no model of that type has that id.
NoSuchProviderException The AI SDK’s NoSuchProviderError: the registry has no provider with that id.
OpenAIDecisionModel Answers questions through the OpenAI Decisions API, POST /decisions (the AI SDK’s OpenAIDecisionModel in @ai-sdk/openai). It answers choice, score, and boolean questions, and the answers carry the model’s probabilities.
OpenAIDecisionModelOptions Settings of an OpenAIDecisionModel (the AI SDK’s createOpenAI settings it reads).
ProviderOptionDefinition A provider option, declared once at the provider level. Upstream’s ProviderOptionDefinition.
ProviderOptionDefinitions Upstream’s ProviderOptionDefinitions: the provider options a provider accepts, grouped by operation.
ProviderRegistry The AI SDK’s createProviderRegistry and DefaultProviderRegistry (provider-registry.ts), for decision models.
ProviderRegistryOptions The decision members of the options of the AI SDK’s createProviderRegistry (ai/src/registry/provider-registry.ts).
ResolveModel The AI SDK’s packages/ai/src/model/resolve-model.ts (resolveDecisionModel, asEvaluationModel).
SharedV4FileData The AI SDK’s SharedV4FileData (shared/v4/shared-v4-file-data.ts): file data as a tagged union, a SharedV4FileDataData, SharedV4FileDataUrl, SharedV4FileDataReference, or SharedV4FileDataText.
SharedV4FileDataData File data holding raw bytes (upstream’s Uint8Array) or a base64-encoded string.
SharedV4FileDataReference File data holding a provider reference ({ [provider]: id }).
SharedV4FileDataText File data holding inline text content, such as an inline text document.
SharedV4FileDataUrl File data holding a URL that points to the file.
SharedV4Warning The AI SDK’s SharedV4Warning (shared/v4/shared-v4-warning.ts): a warning from the model, for example that a feature is unsupported or that a compatibility mode is used. Type is unsupported, compatibility, deprecated, or other; the fields that type does not have are null.
TelemetryErrorEvent The event a telemetry integration’s OnErrorAsync(TelemetryErrorEvent) receives when the operation fails.
TelemetryEvent What a telemetry integration adds to every event it receives (the AI SDK’s augmentEvent of create-telemetry-dispatcher.ts): the call’s telemetry settings and the SDK version. Null on an event a caller’s OnStart or OnEnd callback receives.
TelemetryOptions Telemetry configuration (the AI SDK’s TelemetryOptions, telemetry/telemetry-options.ts).
TelemetryRegistry The AI SDK’s global telemetry integration registry (telemetry/telemetry-registry.ts). A decide call that sets no Integrations uses the integrations registered here.
TelemetryTracingChannel The AI SDK’s tracing channel definitions (telemetry/tracing-channel.ts).
TelemetryTracingChannelMessage TelemetryTracingChannelMessage: what a tracing channel publishes. Result and Error are set, as Node does on the message, before asyncEnd (and error) are published.
TelemetryTracingEventType TelemetryTracingEventType: the type of a TelemetryTracingChannelMessage.
TracingChannel The five channels of a tracing channel (diagnosticsChannel.TracingChannel): start, end, asyncStart, asyncEnd and error. Each is a Channel named tracing:{name}:{event}, as in Node.
TracingChannelSubscribers The subscribers of a TracingChannel (TracingChannelSubscribers). Each one is optional.
UnsupportedFunctionalityException The AI SDK’s UnsupportedFunctionalityError: the provider cannot take an input, such as a file of an unsupported media type.
Type Summary
IDecisionModel A model that answers typed questions with probabilities (the AI SDK’s Experimental_DecisionModelV4). Only specification version v4 is accepted.
IDecisionProvider A provider that creates decision models (the AI SDK’s DecisionProvider, ai/src/decide/decision-provider.ts). Both members are optional, as upstream’s: a provider overrides the ones it has. A member that is not overridden returns null.
IEvaluationModel A deprecated decision model shape (the AI SDK’s Experimental_EvaluationModelV4): the same model with doEvaluate in place of doDecide. ResolveDecisionModel(IEvaluationModel) adapts it to an IDecisionModel.
ILanguageModelV4 The AI SDK’s LanguageModelV4 (language-model/v4/language-model-v4.ts): a language model that implements the language model interface version 4.
IProviderRegistryProvider The decision members of the AI SDK’s ProviderRegistryProvider (provider-registry.ts): models by providerId:modelId.
ITelemetry A telemetry integration (the decide members of the AI SDK’s Telemetry, telemetry/telemetry.ts). Every member does nothing by default, so an integration overrides the ones it listens to.
ITelemetryRedactable A value that carries a provider-owned telemetry view (the AI SDK’s withTelemetryRedaction, provider-utils/src/telemetry-redaction.ts). .NET-only name: upstream attaches the view to an object with a symbol; a .NET type implements this interface instead. The original value is never changed.
Type Summary
DownloadFile The type of the AI SDK’s download (typeof originalDownload), which Create takes. Receives the requested URL and the signal of the enclosing call.
DownloadFunction The AI SDK’s DownloadFunction (util/download/download-function.ts), experimental. Called with the requested URLs, it answers one entry for each, in the same order: the downloaded file, or null when the URL goes to the model as is. It throws DownloadException when a download fails.
FetchFunction The AI SDK’s FetchFunction (@ai-sdk/provider-utils): the transport a download goes through. It must not follow redirects itself, because every hop is validated before it is requested.