共用方式為


ChatCompletionsToolDefinition Class

Definition

The definition of a chat completions tool that can call a function.

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

Constructors

ChatCompletionsToolDefinition(FunctionDefinition)

Initializes a new instance of ChatCompletionsToolDefinition.

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

Type

The type of the tool. Currently, only function is supported.

Explicit Interface Implementations

IJsonModel<ChatCompletionsToolDefinition>.Create(Utf8JsonReader, ModelReaderWriterOptions)

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

IJsonModel<ChatCompletionsToolDefinition>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<ChatCompletionsToolDefinition>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<ChatCompletionsToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions)

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

IPersistableModel<ChatCompletionsToolDefinition>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to