Feature Request: Abstract Search API
jack-michaud opened this issue · comments
I'd like to swap out Tavily with my own search API. If you're interested, I can make abstract my work and contribute it so it's easier to add additional search backends.
To implement this, I would
- Rename
search_tavily
tosearch_configured_client
. - Add an environment variable
SEARCH_BACKEND
; it would default totavily
. - Write an if-else block in
search_configured_client
that would route to a specific search backend- (this is very simple, may be subject to change.)
Any additional search backends would be configurable here.
Ideally, I'd implement a dynamic plugin approach; any python module reference (e.g. my_third_party.search:search_method
) that returns a SearchResponse
could be use.
This is great, I definitely want to support this. What other search providers are you working with?
Feel free to make a PR!
Hey, I just implemented an abstract search API. Farfalle now supports both tavily and searxng. Let me know if there are other search providers you'd like me to add support for.
Awesome! Searx was the one I would've suggested. Nice work