sync upstream code

This commit is contained in:
Hk-Gosuto
2023-07-06 00:19:05 +08:00
parent 94a50f92e1
commit 04d3c1f315
12 changed files with 169 additions and 8 deletions

View File

@@ -0,0 +1,15 @@
import { ToolApi, getHeaders } from "../api";
export class DuckDuckGoSearch implements ToolApi {
name = "duckduckgo_search";
description =
"A wrapper around DuckDuckGo Search.Useful for when you need to answer questions about current events.Input should be a search query.";
async call(input: string): Promise<string> {
const res = await fetch(`/api/tools/ddg?query=${input}`, {
method: "GET",
headers: getHeaders(),
});
return await res.json();
}
}