mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
feat(responses): add supports_native_file_search() capability flag to BaseResponsesAPIConfig
Add a new method supports_native_file_search() to BaseResponsesAPIConfig that lets each provider declare whether it natively handles the file_search tool with vector_store_ids in the Responses API. - BaseResponsesAPIConfig: default returns False (RAG injection mode) - OpenAIResponsesAPIConfig: returns True (native passthrough) - AzureOpenAIResponsesAPIConfig inherits True from OpenAI via subclassing This flag is used by VectorStorePreCallHook to decide between: - Native passthrough (OpenAI/Azure): pass file_search tool through as-is - RAG injection (all others): search vector stores, inject context, strip tool Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
cd37ee1459
commit
f6aa2c3343
2 changed files with 19 additions and 0 deletions
|
|
@ -230,6 +230,21 @@ class BaseResponsesAPIConfig(ABC):
|
|||
"""
|
||||
return False
|
||||
|
||||
def supports_native_file_search(self) -> bool:
|
||||
"""
|
||||
Returns True if the provider natively handles the file_search tool with
|
||||
vector_store_ids in the Responses API.
|
||||
|
||||
When True: the file_search tool is passed through as-is to the provider,
|
||||
and LiteLLM maps any managed vector store IDs to provider-specific IDs.
|
||||
When False: LiteLLM intercepts the file_search tool, performs RAG search against
|
||||
the referenced vector stores, injects context into the input, and
|
||||
strips the file_search tool before forwarding to the provider.
|
||||
|
||||
Default: False (RAG injection mode)
|
||||
"""
|
||||
return False
|
||||
|
||||
#########################################################
|
||||
########## CANCEL RESPONSE API TRANSFORMATION ##########
|
||||
#########################################################
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
|
|||
)
|
||||
)
|
||||
|
||||
def supports_native_file_search(self) -> bool:
|
||||
"""OpenAI natively handles file_search with vector_store_ids."""
|
||||
return True
|
||||
|
||||
def map_openai_params(
|
||||
self,
|
||||
response_api_optional_params: ResponsesAPIOptionalRequestParams,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue