ChatChoice Class

Definition

The representation of a single prompt completion as part of an overall chat completions request. Generally, n choices are generated per provided prompt with a default value of 1. Token limits and other settings may limit the number of choices generated.

public class ChatChoice : System.ClientModel.Primitives.IJsonModel<Azure.AI.OpenAI.ChatChoice>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.OpenAI.ChatChoice>
type ChatChoice = class
    interface IJsonModel<ChatChoice>
    interface IPersistableModel<ChatChoice>
Public Class ChatChoice
Implements IJsonModel(Of ChatChoice), IPersistableModel(Of ChatChoice)
Inheritance
ChatChoice
Implements

Properties

ContentFilterResults

Information about the content filtering category (hate, sexual, violence, self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that determines the intensity and risk level of harmful content) and if it has been filtered or not.

Enhancements

Represents the output results of Azure OpenAI enhancements to chat completions, as configured via the matching input provided in the request. This supplementary information is only available when using Azure OpenAI and only when the request is configured to use enhancements.

FinishDetails

The reason the model stopped generating tokens, together with any applicable details. This structured representation replaces 'finish_reason' for some models. Please note ChatFinishDetails is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. The available derived classes include MaxTokensFinishDetails and StopFinishDetails.

FinishReason

The reason that this chat completions choice completed its generated.

Index

The ordered index associated with this chat completions choice.

LogProbabilityInfo

The log probability information for this choice, as enabled via the 'logprobs' request option.

Message

The chat message for a given chat completions prompt.

Explicit Interface Implementations

IJsonModel<ChatChoice>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<ChatChoice>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<ChatChoice>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<ChatChoice>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<ChatChoice>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to