Class ChatCompletionsResponseFormatJsonObject
A response format for Chat Completions that restricts responses to emitting valid JSON objects. Note that to enable JSON mode, some AI models may also require you to instruct the model to produce JSON via a system or user message.
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.AI.Inference.dll
Syntax
public class ChatCompletionsResponseFormatJsonObject : Azure.AI.Inference.ChatCompletionsResponseFormat, System.ClientModel.Primitives.IJsonModel<Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject>, System.ClientModel.Primitives.IPersistableModel<Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject>
Constructors
ChatCompletionsResponseFormatJsonObject()
Initializes a new instance of ChatCompletionsResponseFormatJsonObject.
Declaration
public ChatCompletionsResponseFormatJsonObject ();
Methods
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
Declaration
protected override void JsonModelWriteCore (System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
|
System.Text.Json.Utf8JsonWriter
writer
The JSON writer. |
|
System.ClientModel.Primitives.ModelReaderWriterOptions
options
The client options for reading and writing models. |
Explicit Interface Implementations
IJsonModel<ChatCompletionsResponseFormatJsonObject>.Create(Utf8JsonReader, ModelReaderWriterOptions)
Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.
Declaration
Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject IJsonModel<ChatCompletionsResponseFormatJsonObject>.Create (ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
|
System.Text.Json.Utf8JsonReader
reader
The System.Text.Json.Utf8JsonReader to read. |
|
System.ClientModel.Primitives.ModelReaderWriterOptions
options
The System.ClientModel.Primitives.ModelReaderWriterOptions to use. |
Returns
|
ChatCompletionsResponseFormatJsonObject
A |
Exceptions
|
System.FormatException
If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format. |
IJsonModel<ChatCompletionsResponseFormatJsonObject>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
Writes the model to the provided System.Text.Json.Utf8JsonWriter.
Declaration
void IJsonModel<ChatCompletionsResponseFormatJsonObject>.Write (System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
|
System.Text.Json.Utf8JsonWriter
writer
The System.Text.Json.Utf8JsonWriter to write into. |
|
System.ClientModel.Primitives.ModelReaderWriterOptions
options
The System.ClientModel.Primitives.ModelReaderWriterOptions to use. |
Exceptions
|
System.FormatException
If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format. |
IPersistableModel<ChatCompletionsResponseFormatJsonObject>.Create(BinaryData, ModelReaderWriterOptions)
Converts the provided System.BinaryData into a model.
Declaration
Azure.AI.Inference.ChatCompletionsResponseFormatJsonObject IPersistableModel<ChatCompletionsResponseFormatJsonObject>.Create (BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
|
System.BinaryData
data
The System.BinaryData to parse. |
|
System.ClientModel.Primitives.ModelReaderWriterOptions
options
The System.ClientModel.Primitives.ModelReaderWriterOptions to use. |
Returns
|
ChatCompletionsResponseFormatJsonObject
A |
Exceptions
|
System.FormatException
If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format. |
IPersistableModel<ChatCompletionsResponseFormatJsonObject>.GetFormatFromOptions(ModelReaderWriterOptions)
Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.
Declaration
string IPersistableModel<ChatCompletionsResponseFormatJsonObject>.GetFormatFromOptions (System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
|
System.ClientModel.Primitives.ModelReaderWriterOptions
options
The System.ClientModel.Primitives.ModelReaderWriterOptions to consider when serializing and deserializing the model. |
Returns
|
System.String
The format that the model uses when communicating with the service. |
IPersistableModel<ChatCompletionsResponseFormatJsonObject>.Write(ModelReaderWriterOptions)
Writes the model into a System.BinaryData.
Declaration
BinaryData IPersistableModel<ChatCompletionsResponseFormatJsonObject>.Write (System.ClientModel.Primitives.ModelReaderWriterOptions options);
Parameters
|
System.ClientModel.Primitives.ModelReaderWriterOptions
options
The System.ClientModel.Primitives.ModelReaderWriterOptions to use. |
Returns
|
System.BinaryData
A binary representation of the written model. |
Exceptions
|
System.FormatException
If the model does not support the requested System.ClientModel.Primitives.ModelReaderWriterOptions.Format. |