mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
fix: handle empty string mock_response in completion()
mock_response='' was falsy so the real request was sent instead of returning a mocked empty response. Changed check from 'if mock_response or' to 'if mock_response is not None or'. Fixes #48162 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JxEyXKctL5suFifVBMuZWG
This commit is contained in:
parent
e04e89c701
commit
47614e7d55
1 changed files with 1 additions and 1 deletions
|
|
@ -6027,7 +6027,7 @@ def completion(
|
|||
custom_llm_provider=custom_llm_provider,
|
||||
model_id=optional_params.get("model_id"),
|
||||
)
|
||||
if mock_response or mock_tool_calls or mock_timeout:
|
||||
if mock_response is not None or mock_tool_calls or mock_timeout:
|
||||
kwargs.pop("mock_timeout", None) # remove for any fallbacks triggered
|
||||
return mock_completion(
|
||||
model,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue