mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
feat: add routed online search providers
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { prefixTavilyTool } from "../extensions/tavily-tool-prefix.ts";
|
||||
|
||||
test("Tavily override prefixes tool identity and internal tool references", () => {
|
||||
const tool = prefixTavilyTool({
|
||||
name: "web_search",
|
||||
label: "Web Search",
|
||||
description: "Use web_search, then web_fetch with Tavily.",
|
||||
promptSnippet: "Call web_search.",
|
||||
promptGuidelines: ["Use web_fetch after web_search."],
|
||||
parameters: {} as never,
|
||||
execute: async () => ({ content: [{ type: "text" as const, text: "ok" }] }),
|
||||
});
|
||||
|
||||
assert.equal(tool.name, "tavily_web_search");
|
||||
assert.equal(tool.label, "Tavily Web Search");
|
||||
assert.equal(tool.description, "Use tavily_web_search, then tavily_web_fetch with Tavily.");
|
||||
assert.equal(tool.promptSnippet, "Call tavily_web_search.");
|
||||
assert.deepEqual(tool.promptGuidelines, ["Use tavily_web_fetch after tavily_web_search."]);
|
||||
});
|
||||
Reference in New Issue
Block a user