ChatCompletion<T> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the result of a chat completion request with structured output.
generic <typename T>
public ref class ChatCompletion : Microsoft::Extensions::AI::ChatCompletion
public class ChatCompletion<T> : Microsoft.Extensions.AI.ChatCompletion
type ChatCompletion<'T> = class
inherit ChatCompletion
Public Class ChatCompletion(Of T)
Inherits ChatCompletion
Type Parameters
- T
The type of value expected from the chat completion.
- Inheritance
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
ChatCompletion<T>(ChatCompletion, JsonSerializerOptions) |
Initializes a new instance of the ChatCompletion<T> class. |
Properties
AdditionalProperties |
Gets or sets any additional properties associated with the chat completion. (Inherited from ChatCompletion) |
Choices |
Gets or sets the list of chat completion choices. (Inherited from ChatCompletion) |
CompletionId |
Gets or sets the ID of the chat completion. (Inherited from ChatCompletion) |
CreatedAt |
Gets or sets a timestamp for the chat completion. (Inherited from ChatCompletion) |
FinishReason |
Gets or sets the reason for the chat completion. (Inherited from ChatCompletion) |
Message |
Gets the chat completion message. (Inherited from ChatCompletion) |
ModelId |
Gets or sets the model ID used in the creation of the chat completion. (Inherited from ChatCompletion) |
RawRepresentation |
Gets or sets the raw representation of the chat completion from an underlying implementation. (Inherited from ChatCompletion) |
Result |
Gets the result of the chat completion as an instance of |
Usage |
Gets or sets usage details for the chat completion. (Inherited from ChatCompletion) |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from ChatCompletion) |
TryGetResult(T) |
Attempts to deserialize the result to produce an instance of |