add stream_chunk_builder function

This commit is contained in:
WilliamEspegren 2023-09-17 10:26:34 +02:00
parent 14fd6770be
commit 43a18b9528
No known key found for this signature in database
GPG key ID: 30E0CDDF1B5262CD
3 changed files with 21 additions and 1 deletions

View 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()