litellm/tests/search_tests
Ilan Chemla f99d0a4b38
feat(search): add Nimble as a search provider (#36347)
* feat(search): add Nimble as a search provider

Adds `NimbleSearchConfig` so `search_provider: nimble` works across the SDK,
the proxy /v1/search endpoint, the Search Tools dashboard, and spend tracking.

Nimble's /v2/search already uses the Perplexity unified spec's parameter names,
so the request transform is close to a pass-through. `search_domain_filter`
splits into include_domains/exclude_domains on the spec's `-` prefix, `country`
is upper-cased to the ISO form Nimble documents, and everything else is
forwarded so focus, search_depth, time_range and the rest stay reachable. On the
response side, snippet prefers `content` and falls back to `description`, and a
malformed body raises an attributed error rather than reporting an empty search.

Also tightens `BaseSearchConfig.get_supported_perplexity_optional_params` to
return `frozenset[str]` instead of a bare mutable `set`, which every caller
already treats as read-only.

* fix(search): surface Nimble error bodies instead of empty results

Greptile flagged that a null or absent `results` degraded to a successful empty
search. A search with no hits comes back as `"results": []`, verified against the
live API, so the field is now required and anything else raises the attributed
schema error the other malformed bodies already take.

Also unwraps Nimble's second error envelope. Collection failures return
`{"success", "task_id", "message"}` rather than the `{"detail"}` shape validation
errors use, and only the latter was being read.

Drops comments that restated the adjacent code.

* docs(search): drop the Nimble param list from the transform docstring

It restated the vendor's API reference, which the module docstring already links,
and would go stale the moment Nimble adds a focus mode.
2026-08-14 17:09:58 -07:00
..
__init__.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
base_search_unit_tests.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
conftest.py fix(tests): stabilize image-edit VCR cassettes to stop live gpt-image-1 spend (#28110) 2026-05-18 09:15:39 -07:00
test_brave_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_dataforseo_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_duckduckgo_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_exa_ai_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_firecrawl_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_google_pse_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_linkup_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_nimble_search.py feat(search): add Nimble as a search provider (#36347) 2026-08-14 17:09:58 -07:00
test_parallel_ai_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_perplexity_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_search_tool_name_filtering.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_searchapi_search.py fix(search): block server credential leak to caller-supplied api_base (#30682) 2026-06-23 13:01:21 -07:00
test_searxng_search.py fix(search): block server credential leak to caller-supplied api_base (#30682) 2026-06-23 13:01:21 -07:00
test_serper_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_tavily_search.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_tinyfish_search.py feat(tinyfish): make search provider permissive, attribute errors (#31997) 2026-07-03 10:17:11 -07:00