Skip to content

Commit 46d3627

Browse files
committed
👌 IMPROVE: Code
1 parent 3bade5f commit 46d3627

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

packages/langbase/src/langbase/langbase.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -922,15 +922,11 @@ export class Langbase {
922922
private async webSearch(
923923
options: ToolWebSearchOptions,
924924
): Promise<ToolWebSearchResponse[]> {
925-
const apiKey = options.apiKey ? options.apiKey : null;
926-
apiKey && delete options.apiKey;
927925
return this.request.post({
928926
endpoint: '/v1/tools/web-search',
929927
body: options,
930928
headers: {
931-
...(apiKey && {
932-
'LB-WEB-SEARCH-KEY': apiKey,
933-
}),
929+
'LB-WEB-SEARCH-KEY': options.apiKey,
934930
},
935931
});
936932
}
@@ -944,15 +940,11 @@ export class Langbase {
944940
private async webCrawl(
945941
options: ToolCrawlOptions,
946942
): Promise<ToolCrawlResponse[]> {
947-
const apiKey = options.apiKey ? options.apiKey : null;
948-
apiKey && delete options.apiKey;
949943
return this.request.post({
950944
endpoint: '/v1/tools/crawl',
951945
body: options,
952946
headers: {
953-
...(apiKey && {
954-
'LB-CRAWL-KEY': apiKey,
955-
}),
947+
'LB-CRAWL-KEY': options.apiKey,
956948
},
957949
});
958950
}

0 commit comments

Comments
 (0)