diff options
| author | sigoden <sigoden@gmail.com> | 2024-07-04 10:46:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-04 10:46:34 +0800 |
| commit | c7e027c6c3176a7684f4e901b8ddb9a0916c5cd8 (patch) | |
| tree | 5a5aad6d5a1b9d0740c3ccd407e492181e9b6faf /tools/search_tavily.sh | |
| parent | 6d48c0a03133f52cc28b453a65241b35c5823ae2 (diff) | |
| download | llm-functions-docker-c7e027c6c3176a7684f4e901b8ddb9a0916c5cd8.tar.gz | |
feat: add tool search_tavily.sh (#57)
Diffstat (limited to 'tools/search_tavily.sh')
| -rwxr-xr-x | tools/search_tavily.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/search_tavily.sh b/tools/search_tavily.sh new file mode 100755 index 0000000..068615d --- /dev/null +++ b/tools/search_tavily.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e + +# @describe Perform a web search using Tavily API to get up-to-date information or additional context. +# Use this when you need current information or feel a search could provide a better answer. + +# @env TAVILY_API_KEY! The max results to return. +# @env TAVILY_MAX_RESULTS=5 The max results to return. +# @option --query! The query to search for. + +main() { + curl -fsSL -X POST \ + -H 'content-type: application/json' \ + -d '{"api_key":"'"$TAVILY_API_KEY"'","query":"'"$argc_query"'","search_depth":"advanced","max_results":"'"$TAVILY_MAX_RESULTS"'"}' \ + https://api.tavily.com/search +} + +eval "$(argc --argc-eval "$0" "$@")" + |
