Delen via


FunctionToolDefinition Class

Definition

The input definition information for a function tool as used to configure an assistant.

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

Constructors

FunctionToolDefinition(String, String)

Initializes a new instance of FunctionTool for a function that requires no explicit function parameters.

FunctionToolDefinition(String, String, BinaryData)

Initializes a new instance of FunctionToolDefinition.

Properties

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.

Parameters

The parameters the functions 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" }.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

GetHashCode()

Serves as the default hash function.

Operators

Equality(FunctionToolDefinition, RequiredFunctionToolCall)
Equality(FunctionToolDefinition, RunStepFunctionToolCall)
Equality(RequiredFunctionToolCall, FunctionToolDefinition)
Equality(RunStepFunctionToolCall, FunctionToolDefinition)
Inequality(FunctionToolDefinition, RequiredFunctionToolCall)
Inequality(FunctionToolDefinition, RunStepFunctionToolCall)
Inequality(RequiredFunctionToolCall, FunctionToolDefinition)
Inequality(RunStepFunctionToolCall, FunctionToolDefinition)

Explicit Interface Implementations

IJsonModel<FunctionToolDefinition>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

IJsonModel<FunctionToolDefinition>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IJsonModel<ToolDefinition>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

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

Writes the model to the provided Utf8JsonWriter.

(Inherited from ToolDefinition)
IPersistableModel<FunctionToolDefinition>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<FunctionToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions)

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

IPersistableModel<FunctionToolDefinition>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

IPersistableModel<ToolDefinition>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

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

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

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

Writes the model into a BinaryData.

(Inherited from ToolDefinition)

Applies to