Skip to content

OpenResponsesExtension

Namespace: Vercel.AI.OpenResponses

public sealed class OpenResponsesExtension

One Open Responses extension. Tool, item, and event capabilities are registered independently.

Inheritance: object

View source

public Func<OpenResponsesDecodeEventContext, IReadOnlyList<LanguageModelStreamPart>?>? DecodeEvent { get; set; }

Decodes a streaming event into stream parts. Present or absent together with EventTypes.

Value: Func<OpenResponsesDecodeEventContext, IReadOnlyList<LanguageModelStreamPart>>

View source

public Func<OpenResponsesDecodeItemContext, IReadOnlyList<GeneratedContent>?>? DecodeItem { get; set; }

Decodes a completed item into content parts. The model adds a open-responses.extension-replay custom part holding the original item. Present or absent together with ItemTypes.

Value: Func<OpenResponsesDecodeItemContext, IReadOnlyList<GeneratedContent>>

View source

public Func<OpenResponsesEncodeInputItemContext, IReadOnlyList<JsonObject>?>? EncodeInputItem { get; set; }

Encodes a history part when no original wire item is available. Every returned item must use one of ItemTypes. Requires an item decoder.

Value: Func<OpenResponsesEncodeInputItemContext, IReadOnlyList<JsonObject>>

View source

public Func<OpenResponsesToolContext, JsonObject?>? EncodeTool { get; set; }

Encodes a provider tool. Return null when its arguments cannot be encoded. The model adds ToolType and omits a tool choice that selects the omitted tool. Present or absent together with ToolType.

Value: Func<OpenResponsesToolContext, JsonObject>

View source

public Func<OpenResponsesToolContext, JsonObject?>? EncodeToolChoice { get; set; }

Encodes a specific tool choice. The model adds ToolType. The default is an object holding only ToolType. Requires a tool encoder.

Value: Func<OpenResponsesToolContext, JsonObject>

View source

public IReadOnlyList<string>? EventTypes { get; set; }

Namespaced event types. Required together with DecodeEvent.

Value: IReadOnlyList<string>

View source

public string Id { get; set; }

Extension id in implementor.extension form.

Value: string

View source

public IReadOnlyList<string>? ItemTypes { get; set; }

Namespaced item types. Required together with DecodeItem.

Value: IReadOnlyList<string>

View source

public string? ToolType { get; set; }

Namespaced tool type. Required together with EncodeTool.

Value: string

View source

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