mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
add stream_chunk_builder function
This commit is contained in:
parent
14fd6770be
commit
43a18b9528
3 changed files with 21 additions and 1 deletions
18
litellm/tests/test_stream_chunk_builder.py
Normal file
18
litellm/tests/test_stream_chunk_builder.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from litellm import completion
|
||||
import litellm
|
||||
import os
|
||||
|
||||
user_message = "Write a short poem about the sky"
|
||||
messages = [{"content": user_message, "role": "user"}]
|
||||
|
||||
def test_stream_chunk_builder():
|
||||
litellm.api_key = os.environ["OPENAI_API_KEY"]
|
||||
response = completion(
|
||||
model="gpt-3.5-turbo",
|
||||
messages=messages,
|
||||
stream=True
|
||||
)
|
||||
|
||||
for chunk in response:
|
||||
print(chunk)
|
||||
test_stream_chunk_builder()
|
Loading…
Add table
Add a link
Reference in a new issue