HostedToolSearchTool class

A marker tool that enables on-demand tool discovery from a hosted service.

When included in the tools list, deferred tools are not placed into the model's context upfront. Instead, the model invokes tool search to surface relevant tools on demand, reducing token consumption for tools the model does not need.

By default all deferrable tools are treated as deferred. Use deferredTools to restrict deferred loading to a specific subset.

This is an experimental feature.

Inheritance
Annotations
  • @Source(name: 'HostedToolSearchTool.cs', namespace: 'Microsoft.Extensions.AI', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI.Abstractions/Tools/')

Constructors

HostedToolSearchTool({List<String>? deferredTools, String? namespace, String? namespaceDescription})
Creates a new HostedToolSearchTool.

Properties

additionalProperties AdditionalPropertiesDictionary?
Additional properties.
getter/setter pairinherited
deferredTools List<String>?
Tool names for which deferred loading is enabled.
getter/setter pair
description String?
A description of the tool.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
name String
The name of the tool.
finalinherited
namespace String?
Namespace name under which deferred tools are grouped.
getter/setter pair
namespaceDescription String?
Description for the namespace when namespace is specified.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getService<T>({Object? key}) → T?
Gets a service of the specified type.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited