mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(test) stream chunk builder
This commit is contained in:
parent
d898b1c412
commit
70885bdba6
1 changed files with 5 additions and 3 deletions
|
@ -35,6 +35,7 @@ def test_stream_chunk_builder():
|
||||||
chunks = []
|
chunks = []
|
||||||
|
|
||||||
for chunk in response:
|
for chunk in response:
|
||||||
|
print(chunk)
|
||||||
chunks.append(chunk)
|
chunks.append(chunk)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -51,8 +52,9 @@ def test_stream_chunk_builder():
|
||||||
message = choices["message"]
|
message = choices["message"]
|
||||||
role = message["role"]
|
role = message["role"]
|
||||||
content = message["content"]
|
content = message["content"]
|
||||||
finnish_reason = choices["finish_reason"]
|
finish_reason = choices["finish_reason"]
|
||||||
except:
|
print(role, content, finish_reason)
|
||||||
raise Exception("stream_chunk_builder failed to rebuild response")
|
except Exception as e:
|
||||||
|
raise Exception("stream_chunk_builder failed to rebuild response", e)
|
||||||
# test_stream_chunk_builder()
|
# test_stream_chunk_builder()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue