mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-31 11:51:22 +00:00
feat: add support for extra headers in Tavily API requests (#55335)
* feat: add support for extra headers in Tavily API requests * test(tavily-client): add unit tests for X-Client-Source header in API calls * fix(tavily): add client source attribution (#55335) (thanks @lakshyaag-tavily) --------- Co-authored-by: Nimrod Gutman <nimrod.gutman@gmail.com>
This commit is contained in:
@@ -100,6 +100,7 @@ export async function postTrustedWebToolsJson<T>(
|
||||
body: Record<string, unknown>;
|
||||
errorLabel: string;
|
||||
maxErrorBytes?: number;
|
||||
extraHeaders?: Record<string, string>;
|
||||
},
|
||||
parseResponse: (response: Response) => Promise<T>,
|
||||
): Promise<T> {
|
||||
@@ -110,6 +111,7 @@ export async function postTrustedWebToolsJson<T>(
|
||||
init: {
|
||||
method: "POST",
|
||||
headers: {
|
||||
...params.extraHeaders,
|
||||
Accept: "application/json",
|
||||
Authorization: `Bearer ${params.apiKey}`,
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user