mirror of
https://github.com/openclaw/openclaw.git
synced 2026-09-29 17:19:00 +08:00
refactor: use the shared Tavily response reader directly (#134255)
This commit is contained in:
@@ -122,20 +122,12 @@ async function postTavilyJson(params: {
|
||||
...(params.signal ? { signal: params.signal } : {}),
|
||||
},
|
||||
async (response) =>
|
||||
readTavilyJsonResponse(response, params.errorLabel, {
|
||||
readProviderJsonResponse<Record<string, unknown>>(response, params.errorLabel, {
|
||||
maxBytes: params.responseMaxBytes,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async function readTavilyJsonResponse(
|
||||
response: Response,
|
||||
label: string,
|
||||
opts?: { maxBytes?: number },
|
||||
): Promise<Record<string, unknown>> {
|
||||
return await readProviderJsonResponse<Record<string, unknown>>(response, label, opts);
|
||||
}
|
||||
|
||||
export async function runTavilySearch(
|
||||
params: TavilySearchParams,
|
||||
): Promise<Record<string, unknown>> {
|
||||
@@ -415,6 +407,5 @@ export async function runTavilyExtract(
|
||||
}
|
||||
|
||||
export const testing = {
|
||||
readTavilyJsonResponse,
|
||||
resolveEndpoint,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user