mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
feat(dynamic_rate_limiter.py): passing base case
This commit is contained in:
parent
0430807178
commit
6a7982fa40
5 changed files with 310 additions and 12 deletions
|
@ -428,7 +428,7 @@ def mock_completion(
|
|||
model: str,
|
||||
messages: List,
|
||||
stream: Optional[bool] = False,
|
||||
mock_response: Union[str, Exception] = "This is a mock request",
|
||||
mock_response: Union[str, Exception, dict] = "This is a mock request",
|
||||
mock_tool_calls: Optional[List] = None,
|
||||
logging=None,
|
||||
custom_llm_provider=None,
|
||||
|
@ -477,6 +477,9 @@ def mock_completion(
|
|||
if time_delay is not None:
|
||||
time.sleep(time_delay)
|
||||
|
||||
if isinstance(mock_response, dict):
|
||||
return ModelResponse(**mock_response)
|
||||
|
||||
model_response = ModelResponse(stream=stream)
|
||||
if stream is True:
|
||||
# don't try to access stream object,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue