mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
set timeout for deepseek testing
This commit is contained in:
parent
986c463983
commit
46469c6087
2 changed files with 27 additions and 18 deletions
|
|
@ -4540,13 +4540,18 @@ def test_humanloop_completion(monkeypatch):
|
|||
|
||||
|
||||
def test_deepseek_reasoning_content_completion():
|
||||
litellm.set_verbose = True
|
||||
resp = litellm.completion(
|
||||
model="deepseek/deepseek-reasoner",
|
||||
messages=[{"role": "user", "content": "Tell me a joke."}],
|
||||
)
|
||||
try:
|
||||
litellm.set_verbose = True
|
||||
litellm._turn_on_debug()
|
||||
resp = litellm.completion(
|
||||
timeout=5,
|
||||
model="deepseek/deepseek-reasoner",
|
||||
messages=[{"role": "user", "content": "Tell me a joke."}],
|
||||
)
|
||||
|
||||
assert resp.choices[0].message.reasoning_content is not None
|
||||
assert resp.choices[0].message.reasoning_content is not None
|
||||
except litellm.Timeout:
|
||||
pytest.skip("Model is timing out")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
|
|
@ -4067,16 +4067,20 @@ def test_mock_response_iterator_tool_use():
|
|||
|
||||
def test_deepseek_reasoning_content_completion():
|
||||
# litellm.set_verbose = True
|
||||
resp = litellm.completion(
|
||||
model="deepseek/deepseek-reasoner",
|
||||
messages=[{"role": "user", "content": "Tell me a joke."}],
|
||||
stream=True,
|
||||
)
|
||||
try:
|
||||
resp = litellm.completion(
|
||||
model="deepseek/deepseek-reasoner",
|
||||
messages=[{"role": "user", "content": "Tell me a joke."}],
|
||||
stream=True,
|
||||
timeout=5,
|
||||
)
|
||||
|
||||
reasoning_content_exists = False
|
||||
for chunk in resp:
|
||||
print(f"chunk: {chunk}")
|
||||
if chunk.choices[0].delta.reasoning_content is not None:
|
||||
reasoning_content_exists = True
|
||||
break
|
||||
assert reasoning_content_exists
|
||||
reasoning_content_exists = False
|
||||
for chunk in resp:
|
||||
print(f"chunk: {chunk}")
|
||||
if chunk.choices[0].delta.reasoning_content is not None:
|
||||
reasoning_content_exists = True
|
||||
break
|
||||
assert reasoning_content_exists
|
||||
except litellm.Timeout:
|
||||
pytest.skip("Model is timing out")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue