ChatCompletionsFunctionToolDefinition Class

Definition

The definition information for a chat completions function tool that can call a function in response to a tool call.

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

Constructors

ChatCompletionsFunctionToolDefinition()

Initializes a new instance of ChatCompletionsFunctionToolDefinition.

ChatCompletionsFunctionToolDefinition(FunctionDefinition)

Initializes a new instance of ChatCompletionsFunctionToolDefinition.

Properties

Description

A description of what the function does. The model will use this description when selecting the function and interpreting its parameters.

Function

The function definition details for the function tool.

Name

The name of the function to be called.

Parameters

The parameters the function accepts, 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" }.

Explicit Interface Implementations

IJsonModel<ChatCompletionsFunctionToolDefinition>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

IJsonModel<ChatCompletionsFunctionToolDefinition>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IJsonModel<ChatCompletionsToolDefinition>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

(Inherited from ChatCompletionsToolDefinition)
IJsonModel<ChatCompletionsToolDefinition>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

(Inherited from ChatCompletionsToolDefinition)
IPersistableModel<ChatCompletionsFunctionToolDefinition>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<ChatCompletionsFunctionToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions)

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

IPersistableModel<ChatCompletionsFunctionToolDefinition>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

IPersistableModel<ChatCompletionsToolDefinition>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

(Inherited from ChatCompletionsToolDefinition)
IPersistableModel<ChatCompletionsToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions)

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

(Inherited from ChatCompletionsToolDefinition)
IPersistableModel<ChatCompletionsToolDefinition>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

(Inherited from ChatCompletionsToolDefinition)

Applies to