Skip to content

SearchableTool

Namespace: Vercel.AI.Operations

public sealed class SearchableTool

A tool the search step can hide until it is discovered.

Inheritance: object

View source

public SearchableTool(string? description = null)

Creates a tool.

Parameters

Name Type Description
description string

View source

public ToolCallerBinding? Caller { get; set; }

Local or provider caller bound to this tool.

Value: ToolCallerBinding

View source

public bool DeferLoading { get; set; }

True when the tool stays hidden until search discovers it.

Value: bool

View source

public Func<IReadOnlyDictionary<string, object?>, string?>? Describe { get; set; }

Description resolved from the current tool context.

Value: Func<IReadOnlyDictionary<string, object>, string>

View source

public string? Description { get; set; }

Static description.

Value: string

View source

public Func<string, IReadOnlyDictionary<string, object?>?, Task<ToolSearchMatchList>>? Execute { get; set; }

Bound search implementation. The unbound search tool throws.

Value: Func<string, IReadOnlyDictionary<string, object>, Task<ToolSearchMatchList>>

View source

public string? InputSchemaJson { get; set; }

Input schema JSON, kept stable across steps.

Value: string

View source

public Func<string, CancellationToken, Task<string>>? Invoke { get; set; }

Executes a discovered tool.

Value: Func<string, CancellationToken, Task<string>>

View source

public bool IsSearch { get; set; }

True when this tool is the search tool. Copying the tool keeps the flag.

Value: bool

View source

public SearchableTool Copy()

Copies the search marker and the other fields.

Returns: SearchableTool

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product