Skip to content

Commit 32154e4

Browse files
Michael GMichael G
authored andcommitted
feat(api-params): converting all wrapper params to camel case
1 parent eddd858 commit 32154e4

File tree

1 file changed

+41
-19
lines changed

1 file changed

+41
-19
lines changed

libs/langchain-tavily/src/utils.ts

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type TavilySearchParamsBase = {
2121
*
2222
* @default "basic"
2323
*/
24-
search_depth?: "basic" | "advanced";
24+
searchDepth?: "basic" | "advanced";
2525

2626
/**
2727
* The number of {@link TavilySearchResult.content} chunks to retrieve from each source.
@@ -30,17 +30,17 @@ export type TavilySearchParamsBase = {
3030
*
3131
* @default 3
3232
*/
33-
chunks_per_source?: number;
33+
chunksPerSource?: number;
3434
/**
3535
* The maximum number of search results to return.
3636
*
3737
* @default 5
3838
*/
39-
max_results?: number;
39+
maxResults?: number;
4040
/**
4141
* The time range of the search.
4242
*/
43-
time_range?: "day" | "week" | "month" | "year";
43+
timeRange?: "day" | "week" | "month" | "year";
4444
/**
4545
* Number of days back from the current date to include. Available only if topic is news.
4646
*/
@@ -51,7 +51,7 @@ export type TavilySearchParamsBase = {
5151
*
5252
* @default false
5353
*/
54-
include_answer?: boolean | "basic" | "advanced";
54+
includeAnswer?: boolean | "basic" | "advanced";
5555
/**
5656
* Include the cleaned and parsed HTML content of each search result.
5757
* "markdown" returns search result content in markdown format.
@@ -60,22 +60,44 @@ export type TavilySearchParamsBase = {
6060
*
6161
* @default false
6262
*/
63-
include_raw_content?: boolean | "markdown" | "text";
63+
includeRawContent?: boolean | "markdown" | "text";
6464
/**
6565
* A list of domains to specifically include in the search results.
6666
*/
67-
include_domains?: string[];
67+
includeDomains?: string[];
6868
/**
6969
* A list of domains to specifically exclude from the search results.
7070
*/
71-
exclude_domains?: string[];
71+
excludeDomains?: string[];
7272

7373
/**
7474
* Whether to include the favicon URL for each result.
7575
*
7676
* @default false
7777
*/
78-
include_favicon?: boolean;
78+
includeFavicon?: boolean;
79+
80+
/**
81+
* The country to search in. MUST be the full country name in lowercase
82+
* like "united states" or "united kingdom".
83+
*
84+
* @default undefined
85+
*/
86+
country?: string;
87+
88+
/**
89+
* The start date of the search.
90+
*
91+
* @default undefined
92+
*/
93+
startDate?: string;
94+
95+
/**
96+
* The end date of the search.
97+
*
98+
* @default undefined
99+
*/
100+
endDate?: string;
79101
} & Record<string, unknown>;
80102

81103
export type TavilySearchParamsWithSimpleImages = TavilySearchParamsBase & {
@@ -84,26 +106,26 @@ export type TavilySearchParamsWithSimpleImages = TavilySearchParamsBase & {
84106
*
85107
* @default false
86108
*/
87-
include_images?: boolean;
109+
includeImages?: boolean;
88110
/**
89111
* When {@link TavilySearchParams.include_images} is true, also add a descriptive text for each
90112
* image.
91113
*
92114
* @default false
93115
*/
94-
include_image_descriptions?: false;
116+
includeImageDescriptions?: false;
95117
};
96118

97119
export type TavilySearchParamsWithImageDescriptions = TavilySearchParamsBase & {
98120
/**
99121
* Also perform an image search and include the results in the response.
100122
*/
101-
include_images?: true;
123+
includeImages?: true;
102124
/**
103125
* When {@link TavilySearchParams.include_images} is true, also add a descriptive text for each
104126
* image.
105127
*/
106-
include_image_descriptions?: true;
128+
includeImageDescriptions?: true;
107129
};
108130

109131
export type TavilySearchParams =
@@ -126,22 +148,22 @@ export type TavilyExtractParams = {
126148
*
127149
* @default false
128150
*/
129-
include_images?: boolean;
151+
includeImages?: boolean;
130152
/**
131153
* The depth of the extraction process. `"advanced"` extraction retrieves more data, including
132154
* tables and embedded content, with higher success but may increase latency. The cost for
133155
* `"advanced"` extraction requests may be higher than `"basic"` extraction.
134156
*
135157
* @default "basic"
136158
*/
137-
extract_depth?: "basic" | "advanced";
159+
extractDepth?: "basic" | "advanced";
138160

139161
/**
140162
* Whether to include the favicon URL for each result.
141163
*
142164
* @default false
143165
*/
144-
include_favicon?: boolean;
166+
includeFavicon?: boolean;
145167

146168
/**
147169
* The format of the extracted web page content.
@@ -283,7 +305,7 @@ export type TavilyCrawlParams = {
283305
*
284306
* @default false
285307
*/
286-
include_favicon?: boolean;
308+
includeFavicon?: boolean;
287309
} & Record<string, unknown>;
288310

289311
/**
@@ -297,9 +319,9 @@ export type TavilyExtractResult = {
297319
/**
298320
* The full content extracted from the page.
299321
*/
300-
raw_content: string;
322+
rawContent: string;
301323
/**
302-
* This is only available if {@link TavilyExtractParams.include_images} is set to `true`. A list
324+
* This is only available if {@link TavilyExtractParams.includeImages} is set to `true`. A list
303325
* of image URLs extracted from the page.
304326
*/
305327
images: string[];

0 commit comments

Comments
 (0)