mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
add customstreapwrapper for openai streaming
This commit is contained in:
parent
0158e12701
commit
69f9c40d80
2 changed files with 9 additions and 1 deletions
|
@ -195,7 +195,9 @@ def completion(
|
|||
response = openai.ChatCompletion.create(
|
||||
engine=model, messages=messages, **optional_params
|
||||
)
|
||||
|
||||
if "stream" in optional_params and optional_params["stream"] == True:
|
||||
response = CustomStreamWrapper(response, model)
|
||||
return response
|
||||
## LOGGING
|
||||
logging.post_call(
|
||||
input=messages,
|
||||
|
@ -251,6 +253,9 @@ def completion(
|
|||
response = openai.ChatCompletion.create(
|
||||
model=model, messages=messages, **optional_params
|
||||
)
|
||||
if "stream" in optional_params and optional_params["stream"] == True:
|
||||
response = CustomStreamWrapper(response, model)
|
||||
return response
|
||||
## LOGGING
|
||||
logging.post_call(
|
||||
input=messages,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue