feat: add Exa AI-powered search tool - #6
Open
tgonzalezc5 wants to merge 1 commit into
Open
tgonzalezc5 wants to merge 1 commit into
tgonzalezc5 wants to merge 1 commit into
Conversation
Contributor
|
Hey @tgonzalezc5 thanks for the PR. I'll take a look at it this week between conference meetings and see how we want to handle 1st party tools like this. |
Author
|
dope sounds good, good luck with the conference! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tinyloom.plugins.exa_search, a tinyloom plugin that registers aweb_searchtool backed by Exa's web search API.auto/neural/fast/deep/instantsearch types,text/highlights/summarycontent modes (combinable), domain and text filters, category filter, date ranges, anduser_location.highlights→summary→text) so each result renders the most useful snippet that came back, with text truncated to 1500 chars to keep tool output compact.exa-py>=2.0.0only when installed via the[exa]extra. The plugin gracefully no-ops with a stderr warning ifEXA_API_KEYis unset and returns a clear error ifexa-pyisn't installed.EXA_API_KEYfrom the environment (loaded by tinyloom's existing dotenv handling).Slots in alongside the existing optional plugins (
mcp,mask,hook_scripts) and follows the same style and registration conventions.Usage
The agent can then call:
{ "tool": "web_search", "input": { "query": "test-time compute scaling", "category": "research paper", "start_published_date": "2024-01-01", "num_results": 5 } }Files changed
tinyloom/plugins/exa_search.py— new plugin (registersweb_searchtool, setsx-exa-integrationtracking header)tests/test_plugins.py— 14 new tests covering activation, response rendering, parameter passthrough, fallback content extraction, missing-SDK / missing-key / no-results / SDK-exception pathsdocs/exa-plugin.md— new docs page modeled ondocs/mcp-plugin.mdpyproject.toml—exa = ["exa-py>=2.0.0"]optional extratinyloom.example.yaml— commented entry alongside existing plugins.env.example—EXA_API_KEYentryuv.lock— regenerated after adding the optional extraTest plan
uv run pytest tests/ -q— 233 passed (14 new)uv run ruff check tinyloom/plugins/exa_search.py tests/test_plugins.py— onlyE701/E401warnings, matching the style used intinyloom/plugins/todo.py,mcp.py,mask.py(one-lineifs and grouped imports per CONTRIBUTING.md style guide)EXA_API_KEYis unsetexa-pyisn't installedinclude_domains,category,start_published_date,type,summary, …) pass through to the SDKEXA_API_KEY)