Share via


StructuredOutputDefinition Class

Definition

A structured output that can be produced by the agent.

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

Constructors

Name Description
StructuredOutputDefinition(String, String, BinaryData, Nullable<Boolean>)

Initializes a new instance of StructuredOutputDefinition.

Properties

Name Description
Description

A description of the output to emit. Used by the model to determine when to emit the output.

Name

The name of the structured output.

Schema

The JSON schema for the structured output.

To assign an object to this property use FromObjectAsJson<T>(T, JsonSerializerOptions).

To assign an already formatted json string to this property use FromString(String).

Examples:

  • BinaryData.FromObjectAsJson("foo"). : Creates a payload of "foo".
  • BinaryData.FromString("\"foo\""). : Creates a payload of "foo".
  • BinaryData.FromObjectAsJson(new { key = "value" }). : Creates a payload of { "key": "value" }.
  • BinaryData.FromString("{\"key\": \"value\"}"). : Creates a payload of { "key": "value" }.

Strict

Whether to enforce strict validation. Default true.

Methods

Name Description
JsonModelCreateCore(Utf8JsonReader, ModelReaderWriterOptions)
JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)
PersistableModelCreateCore(BinaryData, ModelReaderWriterOptions)
PersistableModelWriteCore(ModelReaderWriterOptions)

Explicit Interface Implementations

Name Description
IJsonModel<StructuredOutputDefinition>.Create(Utf8JsonReader, ModelReaderWriterOptions)
IJsonModel<StructuredOutputDefinition>.Write(Utf8JsonWriter, ModelReaderWriterOptions)
IPersistableModel<StructuredOutputDefinition>.Create(BinaryData, ModelReaderWriterOptions)
IPersistableModel<StructuredOutputDefinition>.GetFormatFromOptions(ModelReaderWriterOptions)
IPersistableModel<StructuredOutputDefinition>.Write(ModelReaderWriterOptions)

Applies to