forked from phoenix/litellm-mirror
feat(utils.py): enable returning complete response when stream=true
This commit is contained in:
parent
cdb2474184
commit
9bfbdc18fb
4 changed files with 22 additions and 7 deletions
|
@ -24,6 +24,7 @@ function_schema = {
|
|||
}
|
||||
|
||||
def test_stream_chunk_builder():
|
||||
litellm.set_verbose = False
|
||||
litellm.api_key = os.environ["OPENAI_API_KEY"]
|
||||
response = completion(
|
||||
model="gpt-3.5-turbo",
|
||||
|
@ -35,10 +36,11 @@ def test_stream_chunk_builder():
|
|||
chunks = []
|
||||
|
||||
for chunk in response:
|
||||
print(chunk)
|
||||
# print(chunk)
|
||||
chunks.append(chunk)
|
||||
|
||||
try:
|
||||
print(f"chunks: {chunks}")
|
||||
rebuilt_response = stream_chunk_builder(chunks)
|
||||
|
||||
# exract the response from the rebuilt response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue