- Clarifies error handling for git push operations. - Provides comprehensive documentation for the `tavily.py` script, including basic usage, examples, advanced options, output structure, command combinations, and tips to enable effective web searching.
3.1 KiB
3.1 KiB
Info For AI Agents
- All cogs from the cogs directory are automatically loaded by default. (in the main bot, at least. neru and gurt have hardcoded lists. but these bots are irrelevant unless specifically mentioned.)
- If you need to exclude a cog from being loaded, check commands.py.
- Hybrid commands are preferred to only legacy prefix commands unless specifcally requested.
- Pytest (pytest -q) won't work in this environment, so don't run it.
- For testing you can use
pylint
andpython -m py_compile
. - You are using python 3.11.
- All pip dependencies are installed in the environment. (Except packages related to locally running AI, due to their large size.)
- You have the ability to directly push to the git repo over https (url already set). And you should when you finish your task and have tested it.
- If you encounter any hard to fix errors when pushing just leave it to the user to fix them. Try fixing merge conflicts/not having work from the remote by yourself.
- You have a python script "tavily.py" in the project root, that you can use to search the web.
Tavily API Script Usage Instructions
Basic Usage
Search for information using simple queries:
python tavily.py "your search query"
Examples
python tavily.py "latest AI developments 2024"
python tavily.py "how to make chocolate chip cookies"
python tavily.py "current weather in New York"
python tavily.py "best programming practices Python"
Advanced Options
Search Depth
- Basic search:
python tavily.py "query"
(default) - Advanced search:
python tavily.py "query" --depth advanced
Control Results
- Limit results:
python tavily.py "query" --max-results 3
- Include images:
python tavily.py "query" --include-images
- Skip AI answer:
python tavily.py "query" --no-answer
Domain Filtering
- Include specific domains:
python tavily.py "query" --include-domains reddit.com stackoverflow.com
- Exclude domains:
python tavily.py "query" --exclude-domains wikipedia.org
Output Format
- Formatted output:
python tavily.py "query"
(default - human readable) - Raw JSON:
python tavily.py "query" --raw
(for programmatic processing)
Output Structure
The default formatted output includes:
- 🤖 AI Answer: Direct answer to your query
- 🔍 Search Results: Titles, URLs, and content snippets
- 🖼️ Images: Relevant images (when
--include-images
is used)
Command Combinations
# Advanced search with images, limited results
python tavily.py "machine learning tutorials" --depth advanced --include-images --max-results 3
# Search specific sites only, raw output
python tavily.py "Python best practices" --include-domains github.com stackoverflow.com --raw
# Quick search without AI answer
python tavily.py "today's news" --no-answer --max-results 5
Tips
- Always quote your search queries to handle spaces and special characters
- Use
--max-results
to control response length and API usage - Use
--raw
when you need to parse results programmatically - Combine options as needed for specific use cases