次の方法で共有


ChatResponse<T> Class

Definition

Represents the response to a chat request with structured output.

generic <typename T>
public ref class ChatResponse : Microsoft::Extensions::AI::ChatResponse
public class ChatResponse<T> : Microsoft.Extensions.AI.ChatResponse
type ChatResponse<'T> = class
    inherit ChatResponse
Public Class ChatResponse(Of T)
Inherits ChatResponse

Type Parameters

T

The type of value expected from the chat response.

Inheritance
ChatResponse<T>

Remarks

Language models are not guaranteed to honor the requested schema. If the model's output is not parseable as the expected type, then TryGetResult(T) will return false. You can access the underlying JSON response on the Message property.

Constructors

ChatResponse<T>(ChatResponse, JsonSerializerOptions)

Initializes a new instance of the ChatResponse<T> class.

Properties

AdditionalProperties

Gets or sets any additional properties associated with the chat response.

(Inherited from ChatResponse)
ChatThreadId

Gets or sets the chat thread ID associated with this chat response.

(Inherited from ChatResponse)
Choices

Gets or sets the list of chat response choices.

(Inherited from ChatResponse)
CreatedAt

Gets or sets a timestamp for the chat response.

(Inherited from ChatResponse)
FinishReason

Gets or sets the reason for the chat response.

(Inherited from ChatResponse)
Message

Gets the chat response message.

(Inherited from ChatResponse)
ModelId

Gets or sets the model ID used in the creation of the chat response.

(Inherited from ChatResponse)
RawRepresentation

Gets or sets the raw representation of the chat response from an underlying implementation.

(Inherited from ChatResponse)
ResponseId

Gets or sets the ID of the chat response.

(Inherited from ChatResponse)
Result

Gets the result value of the chat response as an instance of T.

Usage

Gets or sets usage details for the chat response.

(Inherited from ChatResponse)

Methods

ToChatResponseUpdates()

Creates an array of ChatResponseUpdate instances that represent this ChatResponse.

(Inherited from ChatResponse)
ToString()

Returns a string that represents the current object.

(Inherited from ChatResponse)
TryGetResult(T)

Attempts to deserialize the result to produce an instance of T.

Applies to