mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +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
|
@ -1 +0,0 @@
|
|||
Subproject commit f2fe83e002a7c3ddedf4e500665644adfd31b9fc
|
|
@ -1123,3 +1123,6 @@ def config_completion(**kwargs):
|
|||
raise ValueError(
|
||||
"No config path set, please set a config path using `litellm.config_path = 'path/to/config.json'`"
|
||||
)
|
||||
|
||||
def stream_chunk_builder(chunks:list):
|
||||
pass
|
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