Skip to content

Commit d547f45

Browse files
glowforge-opensourceMichael Natkin
authored andcommitted
🔍 feat: Additional Tavily API Tool Parameters (danny-avila#7232)
* feat: expose additional Tavily API parameters for tool The following parameters are part of Tavily API but were previously not exposed for agents to use via the tool. Now they are. The source documentation is here: https://docs.tavily.com/documentation/api-reference/endpoint/search include_raw_content - returns the full text of found web pages (default is false) include_domains - limit search to this list of domains (default is none) exclude_domains - exclude this list of domains form search (default is none) topic - enum of "general", "news", or "finance" (default is "general") time_range - enum of "day", "week", "month", or "year" (default unlimited) days - number of days to search (default is 7, but only applicable to topic == "news") include_image_descriptions - include a description of the image in the search results (default is false) It is a little odd that they have both time_range and days, but there it is. I have noticed that this change requires a little bit of care in prompting to make sure that it doesn't use "news" when you wanted "general". I've attemtped to hint that in the tool description. * correct lint error * more lint --------- Co-authored-by: Michael Natkin <[email protected]>
1 parent a26c5ab commit d547f45

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

api/app/clients/tools/structured/TavilySearchResults.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,39 @@ class TavilySearchResults extends Tool {
4343
.boolean()
4444
.optional()
4545
.describe('Whether to include answers in the search results. Default is False.'),
46-
// include_raw_content: z.boolean().optional().describe('Whether to include raw content in the search results. Default is False.'),
47-
// include_domains: z.array(z.string()).optional().describe('A list of domains to specifically include in the search results.'),
48-
// exclude_domains: z.array(z.string()).optional().describe('A list of domains to specifically exclude from the search results.'),
46+
include_raw_content: z
47+
.boolean()
48+
.optional()
49+
.describe('Whether to include raw content in the search results. Default is False.'),
50+
include_domains: z
51+
.array(z.string())
52+
.optional()
53+
.describe('A list of domains to specifically include in the search results.'),
54+
exclude_domains: z
55+
.array(z.string())
56+
.optional()
57+
.describe('A list of domains to specifically exclude from the search results.'),
58+
topic: z
59+
.enum(['general', 'news', 'finance'])
60+
.optional()
61+
.describe(
62+
'The category of the search. Use news ONLY if query SPECIFCALLY mentions the word "news".',
63+
),
64+
time_range: z
65+
.enum(['day', 'week', 'month', 'year', 'd', 'w', 'm', 'y'])
66+
.optional()
67+
.describe('The time range back from the current date to filter results.'),
68+
days: z
69+
.number()
70+
.min(1)
71+
.optional()
72+
.describe('Number of days back from the current date to include. Only if topic is news.'),
73+
include_image_descriptions: z
74+
.boolean()
75+
.optional()
76+
.describe(
77+
'When include_images is true, also add a descriptive text for each image. Default is false.',
78+
),
4979
});
5080
}
5181

0 commit comments

Comments
 (0)