ChatFinishReason Struct

Definition

Represents the reason a chat response completed.

[System.Text.Json.Serialization.JsonConverter(typeof(Microsoft.Extensions.AI.ChatFinishReason+Converter))]
public readonly struct ChatFinishReason : IEquatable<Microsoft.Extensions.AI.ChatFinishReason>
Inheritance
ChatFinishReason
Attributes
Implements

Constructors

ChatFinishReason(String)

Initializes a new instance of the ChatFinishReason struct with a string that describes the reason.

Properties

ContentFilter

Gets a ChatFinishReason representing the model filtering content, whether for safety, prohibited content, sensitive content, or other such issues.

Length

Gets a ChatFinishReason representing the model reaching the maximum length allowed for the request and/or response (typically in terms of tokens).

Stop

Gets a ChatFinishReason representing the model encountering a natural stop point or provided stop sequence.

ToolCalls

Gets a ChatFinishReason representing the model requesting the use of a tool that was defined in the request.

Value

Gets the finish reason value.

Methods

Equals(ChatFinishReason)

Indicates whether the current object is equal to another object of the same type.

Equals(Object)

Indicates whether this instance and a specified object are equal.

GetHashCode()

Returns the hash code for this instance.

ToString()

Gets the Value of the finish reason.

Operators

Applies to

Prodotto Versioni
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)