mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix(fireworks_ai): keep file_search on LiteLLM's emulated search for the Responses API
This commit is contained in:
parent
a534b9fac5
commit
0157808187
2 changed files with 12 additions and 0 deletions
|
|
@ -94,3 +94,6 @@ class FireworksAIResponsesAPIConfig(OpenAIResponsesAPIConfig):
|
|||
|
||||
def supports_native_websocket(self) -> bool:
|
||||
return False
|
||||
|
||||
def supports_native_file_search(self) -> bool:
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from typing_extensions import ReadOnly
|
|||
|
||||
import litellm
|
||||
from litellm.llms.fireworks_ai.responses.transformation import FireworksAIResponsesAPIConfig
|
||||
from litellm.responses.file_search.emulated_handler import should_use_emulated_file_search
|
||||
from litellm.types.llms.openai import InputTokensDetails, ResponseAPIUsage, ResponsesAPIResponse
|
||||
from litellm.types.router import GenericLiteLLMParams
|
||||
from litellm.types.utils import LlmProviders
|
||||
|
|
@ -180,6 +181,14 @@ def test_responses_call_sends_developer_items_as_system_messages() -> None:
|
|||
)
|
||||
|
||||
|
||||
def test_file_search_tools_take_litellm_emulated_search_not_fireworks() -> None:
|
||||
config: Final = FireworksAIResponsesAPIConfig()
|
||||
file_search: Final = ({"type": "file_search", "vector_store_ids": ("vs_kb",)},)
|
||||
function_tool: Final = ({"type": "function", "name": "get_weather", "parameters": {"type": "object"}},)
|
||||
assert should_use_emulated_file_search(tools=file_search, provider_config=config)
|
||||
assert not should_use_emulated_file_search(tools=function_tool, provider_config=config)
|
||||
|
||||
|
||||
def test_responses_call_sends_session_affinity_for_caller_session_id() -> None:
|
||||
client: Final = _mock_http_client(_fireworks_response("accounts/fireworks/models/kimi-k3"))
|
||||
with patch(HTTPX_CLIENT_FACTORY, return_value=client):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue