Skip to content

OpenResponsesLanguageModel

Namespace: Vercel.AI.OpenResponses

public sealed class OpenResponsesLanguageModel : ILanguageModel

Posts to /responses.

Inheritance: object

Implements: ILanguageModel

View source

OpenResponsesLanguageModel(OpenResponsesProvider, string)

Section titled “OpenResponsesLanguageModel(OpenResponsesProvider, string)”
public OpenResponsesLanguageModel(OpenResponsesProvider provider, string modelId)

Creates a model.

Parameters

Name Type Description
provider OpenResponsesProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id, such as openai.

Value: string

View source

public string SpecificationVersion { get; }

Always V4.

Value: string

View source

DoGenerateAsync(LanguageModelCallOptions, CancellationToken)

Section titled “DoGenerateAsync(LanguageModelCallOptions, CancellationToken)”
public Task<LanguageModelGenerateResult> DoGenerateAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)

Generates a complete result.

Parameters

Name Type Description
options LanguageModelCallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelGenerateResult>

View source

DoStreamAsync(LanguageModelCallOptions, CancellationToken)

Section titled “DoStreamAsync(LanguageModelCallOptions, CancellationToken)”
public Task<LanguageModelStreamResult> DoStreamAsync(LanguageModelCallOptions options, CancellationToken cancellationToken)

Streams partial results. The result carries the stream with the request and response info.

Parameters

Name Type Description
options LanguageModelCallOptions
cancellationToken CancellationToken

Returns: Task<LanguageModelStreamResult>

View source

public SerializedModelOptions Serialize()

Serializes the model id and config for a workflow boundary. Maps to [WORKFLOW_SERIALIZE]. Throws a SerializationError when extensions are registered, because their codecs cannot cross the boundary.

Returns: SerializedModelOptions

View source

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