add customstreapwrapper for openai streaming

This commit is contained in:
ishaan-jaff 2023-08-28 15:28:51 -07:00
parent 2462791f65
commit f84b7d5c0f
2 changed files with 9 additions and 1 deletions

View file

@ -1623,6 +1623,9 @@ class CustomStreamWrapper:
elif self.model in litellm.open_ai_text_completion_models:
chunk = next(self.completion_stream)
completion_obj["content"] = self.handle_openai_text_completion_chunk(chunk)
else: # openai chat/azure models
chunk = next(self.completion_stream)
completion_obj['content'] = chunk['choices']['delta']
# LOGGING
self.logging_obj(completion_obj["content"])
# return this for all models