Sameer Kankute
c735251570
feat(responses): file_search support — Phase 1 native passthrough + Phase 2 emulated fallback
Phase 1 (native passthrough):
- _decode_vector_store_ids_in_tools(): decode LiteLLM-managed unified
vector_store_ids to provider-native IDs in file_search tools
- Split update_responses_tools_with_model_file_ids() into decode pass
(always runs) + code_interpreter mapping pass (guarded)
- BaseResponsesAPIConfig.supports_native_file_search() → False by default;
OpenAIResponsesAPIConfig overrides to True
- ManagedFiles.async_pre_call_hook(): batch team-level access check for
unified vector_store_ids in file_search tools (no N+1)
- Docs: file_search section in response_api.md
Phase 2 (emulated fallback for non-native providers):
- litellm/responses/file_search/emulated_handler.py: converts file_search
tool → function tool, intercepts tool call, runs asearch(), makes
follow-up call, synthesizes OpenAI-format output (file_search_call +
message + file_citation annotations)
- responses/main.py: routes to emulated handler when provider doesn't
support file_search natively
Tests: 41 unit tests across 8 families (A-H) in test_file_search_responses.py
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>