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 = []
|
||||
|
||||
for chunk in response:
|
||||
print(chunk)
|
||||
chunks.append(chunk)
|
||||
|
||||
try:
|
||||
|
@ -51,8 +52,9 @@ def test_stream_chunk_builder():
|
|||
message = choices["message"]
|
||||
role = message["role"]
|
||||
content = message["content"]
|
||||
finnish_reason = choices["finish_reason"]
|
||||
except:
|
||||
raise Exception("stream_chunk_builder failed to rebuild response")
|
||||
finish_reason = choices["finish_reason"]
|
||||
print(role, content, finish_reason)
|
||||
except Exception as e:
|
||||
raise Exception("stream_chunk_builder failed to rebuild response", e)
|
||||
# test_stream_chunk_builder()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue