Skip to content

Commit bbd5a7f

Browse files
Michael GMichael G
authored andcommitted
feat(date-range): adding starty and end date params
1 parent 3ada6ac commit bbd5a7f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

libs/langchain-tavily/src/tavily-search.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ export type TavilySearchAPIRetrieverFields = ToolParams & {
105105
*/
106106
includeFavicon?: boolean;
107107

108+
/**
109+
* Filters search results to include only content published on or after this date.
110+
*
111+
* @default undefined
112+
*/
113+
startDate?: string;
114+
115+
/**
116+
* Filters search results to include only content published on or before this date.
117+
*
118+
* @default undefined
119+
*/
120+
endDate?: string;
121+
108122
/**
109123
* The name of the tool.
110124
*
@@ -348,6 +362,10 @@ export class TavilySearch extends StructuredTool<typeof inputSchema> {
348362

349363
includeFavicon?: boolean;
350364

365+
startDate?: string;
366+
367+
endDate?: string;
368+
351369
handleToolError = true;
352370

353371
apiWrapper: TavilySearchAPIWrapper;
@@ -398,6 +416,8 @@ export class TavilySearch extends StructuredTool<typeof inputSchema> {
398416
this.country = params.country;
399417
this.autoParameters = params.autoParameters;
400418
this.includeFavicon = params.includeFavicon;
419+
this.startDate = params.startDate;
420+
this.endDate = params.endDate;
401421
}
402422

403423
async _call(
@@ -439,6 +459,8 @@ export class TavilySearch extends StructuredTool<typeof inputSchema> {
439459
country: this.country,
440460
autoParameters: this.autoParameters,
441461
includeFavicon: this.includeFavicon,
462+
startDate: this.startDate,
463+
endDate: this.endDate,
442464
});
443465

444466
if (

0 commit comments

Comments
 (0)