diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-06 08:29:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-06 08:29:00 +0800 |
| commit | bfb7d75fe47ea588495c5be8157a67b1fec67a13 (patch) | |
| tree | b1996472711a1ccae391f1bded61adf3475b89ed /tools/search_duckduckgo.sh | |
| parent | 005d23030dab2b7708996e779dc78dd5f8ebdb8d (diff) | |
| download | llm-functions-docker-bfb7d75fe47ea588495c5be8157a67b1fec67a13.tar.gz | |
refactor: move tools/$lang/** to tools/** (#17)
Diffstat (limited to 'tools/search_duckduckgo.sh')
| -rwxr-xr-x | tools/search_duckduckgo.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/search_duckduckgo.sh b/tools/search_duckduckgo.sh new file mode 100755 index 0000000..c5ab565 --- /dev/null +++ b/tools/search_duckduckgo.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -e + +# @describe Takes in a query string and returns search result from DuckDuckGo. +# Use it to answer user questions that require dates, facts, real-time information, or news. +# This ensures accurate and up-to-date answers. + +# @meta require-tools ddgr +# @env DDG_MAX_RESULTS=5 The max results to return. +# @option --query! The query to search for. + +main() { + ddgr -n $DDG_MAX_RESULTS --json "$argc_query" +} + +eval "$(argc --argc-eval "$0" "$@")" |
