Поделиться через


ChatResponseUpdate Class

Definition

Represents a single streaming response chunk from an IChatClient.

public ref class ChatResponseUpdate
public class ChatResponseUpdate
type ChatResponseUpdate = class
Public Class ChatResponseUpdate
Inheritance
ChatResponseUpdate

Remarks

ChatResponseUpdate is so named because it represents updates that layer on each other to form a single chat response. Conceptually, this combines the roles of ChatResponse and ChatMessage in streaming output.

The relationship between ChatResponse and ChatResponseUpdate is codified in the ToChatResponseAsync(IAsyncEnumerable<ChatResponseUpdate>, CancellationToken) and ToChatResponseUpdates(), which enable bidirectional conversions between the two. Note, however, that the provided conversions may be lossy, for example if multiple updates all have different RawRepresentation objects whereas there's only one slot for such an object available in RawRepresentation. Similarly, if different updates provide different values for properties like ModelId, only one of the values will be used to populate ModelId.

Constructors

ChatResponseUpdate()

Initializes a new instance of the ChatResponseUpdate class.

ChatResponseUpdate(Nullable<ChatRole>, IList<AIContent>)

Initializes a new instance of the ChatResponseUpdate class.

ChatResponseUpdate(Nullable<ChatRole>, String)

Initializes a new instance of the ChatResponseUpdate class.

Properties

AdditionalProperties

Gets or sets additional properties for the update.

AuthorName

Gets or sets the name of the author of the response update.

ChatThreadId

Gets or sets the chat thread ID associated with the chat response of which this update is a part.

Contents

Gets or sets the chat response update content items.

CreatedAt

Gets or sets a timestamp for the response update.

FinishReason

Gets or sets the finish reason for the operation.

ModelId

Gets or sets the model ID associated with this response update.

RawRepresentation

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

ResponseId

Gets or sets the ID of the response of which this update is a part.

Role

Gets or sets the role of the author of the response update.

Text

Gets the text of this update.

Methods

ToString()

Returns a string that represents the current object.

Applies to