Skip to content

Commit c7e027c

Browse files
authored
feat: add tool search_tavily.sh (#57)
1 parent 6d48c0a commit c7e027c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tools/search_tavily.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# @describe Perform a web search using Tavily API to get up-to-date information or additional context.
5+
# Use this when you need current information or feel a search could provide a better answer.
6+
7+
# @env TAVILY_API_KEY! The max results to return.
8+
# @env TAVILY_MAX_RESULTS=5 The max results to return.
9+
# @option --query! The query to search for.
10+
11+
main() {
12+
curl -fsSL -X POST \
13+
-H 'content-type: application/json' \
14+
-d '{"api_key":"'"$TAVILY_API_KEY"'","query":"'"$argc_query"'","search_depth":"advanced","max_results":"'"$TAVILY_MAX_RESULTS"'"}' \
15+
https://api.tavily.com/search
16+
}
17+
18+
eval "$(argc --argc-eval "$0" "$@")"
19+

0 commit comments

Comments
 (0)