Przeczytaj w języku angielskim

Udostępnij za pośrednictwem


ChatToolMode Class

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Describes how tools should be selected by a IChatClient.

C#
[System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.NoneChatToolMode), "none")]
[System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.AutoChatToolMode), "auto")]
[System.Text.Json.Serialization.JsonDerivedType(typeof(Microsoft.Extensions.AI.RequiredChatToolMode), "required")]
[System.Text.Json.Serialization.JsonPolymorphic(TypeDiscriminatorPropertyName="$type")]
public class ChatToolMode
Inheritance
ChatToolMode
Derived
Attributes

Remarks

The predefined values Auto, None, and RequireAny are provided. To nominate a specific function, use RequireSpecific(String).

Properties

Auto

Gets a predefined ChatToolMode indicating that tool usage is optional.

None

Gets a predefined ChatToolMode indicating that tool usage is unsupported.

RequireAny

Gets a predefined ChatToolMode indicating that tool usage is required, but that any tool can be selected. At least one tool must be provided in Tools.

Methods

RequireSpecific(String)

Instantiates a ChatToolMode indicating that tool usage is required, and that the specified AIFunction must be selected. The function name must match an entry in Tools.

Applies to

Produkt Wersje
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)