ChatResponseFormat 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表呼叫者所期望的回應格式。
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
- 衍生
- 屬性
屬性
| 名稱 | Description |
|---|---|
| Json |
它會得到一個代表結構化 JSON 資料的單例,但沒有特定的結構結構。 |
| Text |
取得一個代表非結構化文本資料的單例實例。 |
方法
| 名稱 | Description |
|---|---|
| ForJsonSchema(JsonElement, String, String) |
建立 ChatResponseFormatJson 一個代表結構化 JSON 資料,並附上指定的結構化 JSON。 |
| ForJsonSchema(Type, JsonSerializerOptions, String, String) |
建立 ChatResponseFormatJson 一個以結構化 JSON 為基礎 |
| ForJsonSchema<T>(JsonSerializerOptions, String, String) |
建立 ChatResponseFormatJson 一個以結構化 JSON 為基礎 |
擴充方法
| 名稱 | Description |
|---|---|
| AsOpenAIChatResponseFormat(ChatResponseFormat, ChatOptions) | |
| AsOpenAIResponseTextFormat(ChatResponseFormat, ChatOptions) |