mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-26 01:01:40 +00:00
Follow-up to PR #267 merge: - Fix CLI syntax: -k is keywords, -m is max results (was reversed) - Add clear trigger condition: use only when web_search tool unavailable - Remove misleading curl fallback (DuckDuckGo Instant Answer API is not a web search endpoint) - Fix package name: ddgs (renamed from duckduckgo-search) - Add workflow section for search → web_extract pipeline - Add pitfalls and limitations sections - Fix author attribution to actual contributor - Rewrite shell script as simple ddgs wrapper with availability check
28 lines
621 B
Bash
Executable file
28 lines
621 B
Bash
Executable file
#!/bin/bash
|
|
# DuckDuckGo Search Helper Script
|
|
# Wrapper around ddgs CLI with sensible defaults
|
|
# Usage: ./duckduckgo.sh <query> [max_results]
|
|
|
|
set -e
|
|
|
|
QUERY="$1"
|
|
MAX_RESULTS="${2:-5}"
|
|
|
|
if [ -z "$QUERY" ]; then
|
|
echo "Usage: $0 <query> [max_results]"
|
|
echo ""
|
|
echo "Examples:"
|
|
echo " $0 'python async programming' 5"
|
|
echo " $0 'latest AI news' 10"
|
|
echo ""
|
|
echo "Requires: pip install ddgs"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if ddgs is available
|
|
if ! command -v ddgs &> /dev/null; then
|
|
echo "Error: ddgs not found. Install with: pip install ddgs"
|
|
exit 1
|
|
fi
|
|
|
|
ddgs text -k "$QUERY" -m "$MAX_RESULTS"
|