mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-03 20:23:46 +00:00
Litellm dev 02 07 2025 p3 (#8387)
* add back streaming for base o3 (#8361) * test(base_llm_unit_tests.py): add base test for o-series models - ensure streaming always works * fix(base_llm_unit_tests.py): fix test for o series models * refactor: move test --------- Co-authored-by: Matteo Boschini <12133566+mbosc@users.noreply.github.com>
This commit is contained in:
co-authored by
Matteo Boschini
parent
b242c66a3b
commit
c83498f0cd
@@ -54,7 +54,7 @@ class OpenAIOSeriesConfig(OpenAIGPTConfig):
|
||||
|
||||
if model is None:
|
||||
return True
|
||||
supported_stream_models = ["o1-mini", "o1-preview"]
|
||||
supported_stream_models = ["o1-mini", "o1-preview", "o3-mini"]
|
||||
for supported_model in supported_stream_models:
|
||||
if supported_model in model:
|
||||
return False
|
||||
|
||||
@@ -204,3 +204,26 @@ def test_o3_reasoning_effort():
|
||||
reasoning_effort="high",
|
||||
)
|
||||
assert resp.choices[0].message.content is not None
|
||||
|
||||
|
||||
def test_streaming_response():
|
||||
"""Test that streaming response is returned correctly"""
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="o3-mini",
|
||||
messages=[
|
||||
{"role": "system", "content": "Be a good bot!"},
|
||||
{"role": "user", "content": "Hello!"},
|
||||
],
|
||||
stream=True,
|
||||
)
|
||||
|
||||
assert response is not None
|
||||
|
||||
chunks = []
|
||||
for chunk in response:
|
||||
chunks.append(chunk)
|
||||
|
||||
resp = litellm.stream_chunk_builder(chunks=chunks)
|
||||
print(resp)
|
||||
|
||||
Reference in New Issue
Block a user