ChatResponseFormat クラス

定義

呼び出し元が必要とする応答形式を表します。

public ref class ChatResponseFormat
[System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.ChatResponseFormatText), "text")]
[System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.ChatResponseFormatJson), "json")]
[System.Text.Json.Serialization.JsonPolymorphic(TypeDiscriminatorPropertyName="$type")]
public class ChatResponseFormat
[<System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.ChatResponseFormatText), "text")>]
[<System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.ChatResponseFormatJson), "json")>]
[<System.Text.Json.Serialization.JsonPolymorphic(TypeDiscriminatorPropertyName="$type")>]
type ChatResponseFormat = class
Public Class ChatResponseFormat
継承
ChatResponseFormat
派生
属性

プロパティ

名前 説明
Json

構造化された JSON データを表すシングルトン インスタンスを取得しますが、特定のスキーマは取得しません。

Text

非構造化テキスト データを表すシングルトン インスタンスを取得します。

メソッド

名前 説明
ForJsonSchema(JsonElement, String, String)

指定したスキーマで構造化された JSON データを表す ChatResponseFormatJson を作成します。

ForJsonSchema(Type, JsonSerializerOptions, String, String)

schemaTypeに基づくスキーマを使用して、構造化された JSON データを表すChatResponseFormatJsonを作成します。

ForJsonSchema<T>(JsonSerializerOptions, String, String)

Tに基づくスキーマを使用して、構造化された JSON データを表すChatResponseFormatJsonを作成します。

拡張メソッド

名前 説明
AsOpenAIChatResponseFormat(ChatResponseFormat, ChatOptions)

ChatResponseFormatから OpenAI ChatResponseFormatを作成します。

AsOpenAIResponseTextFormat(ChatResponseFormat, ChatOptions)

ResponseTextFormatから OpenAI ChatResponseFormatを作成します。

適用対象