import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-runtime"; import {
jsonResult,
readNumberParam,
readStringParam,
} from "openclaw/plugin-sdk/provider-web-search"; import { Type } from "typebox"; import { runTavilySearch } from "./tavily-client.js"; import { optionalStringEnum } from "./tavily-tool-schema.js";
const TavilySearchToolSchema = Type.Object(
{
query: Type.String({ description: "Search query string." }),
search_depth: optionalStringEnum(["basic", "advanced"] as const, {
description: 'Search depth: "basic" (default, faster) or "advanced" (more thorough).',
}),
topic: optionalStringEnum(["general", "news", "finance"] as const, {
description: 'Search topic: "general" (default), "news", or "finance".',
}),
max_results: Type.Optional(
Type.Number({
description: "Number of results to return (1-20).",
minimum: 1,
maximum: 20,
}),
),
include_answer: Type.Optional(
Type.Boolean({
description: "Include an AI-generated answer summary (default: false).",
}),
),
time_range: optionalStringEnum(["day", "week", "month", "year"] as const, {
description: "Filter results by recency: 'day', 'week', 'month', or 'year'.",
}),
include_domains: Type.Optional(
Type.Array(Type.String(), {
description: "Only include results from these domains.",
}),
),
exclude_domains: Type.Optional(
Type.Array(Type.String(), {
description: "Exclude results from these domains.",
}),
),
},
{ additionalProperties: false },
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.