Partager via


OpenApiFunctionDefinition Class

Definition

The input definition information for an openapi function.

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

Constructors

OpenApiFunctionDefinition(String, BinaryData, OpenApiAuthDetails)

Initializes a new instance of OpenApiFunctionDefinition.

Properties

Auth

Open API authentication details Please note OpenApiAuthDetails 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 OpenApiAnonymousAuthDetails, OpenApiConnectionAuthDetails and OpenApiManagedAuthDetails.

Description

A description of what the function does, used by the model to choose when and how to call the function.

Name

The name of the function to be called.

Spec

The openapi function shape, described as a JSON Schema object.

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" }.

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)

Explicit Interface Implementations

IJsonModel<OpenApiFunctionDefinition>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

IJsonModel<OpenApiFunctionDefinition>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<OpenApiFunctionDefinition>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<OpenApiFunctionDefinition>.GetFormatFromOptions(ModelReaderWriterOptions)

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

IPersistableModel<OpenApiFunctionDefinition>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to