fix(utils.py): fix streaming chunks to not return role, unless set

This commit is contained in:
Krrish Dholakia 2024-02-01 09:53:33 -08:00
parent 76f053f85b
commit d46df34ff5
2 changed files with 7 additions and 6 deletions

View file

@ -233,7 +233,8 @@ class Delta(OpenAIObject):
def __init__(self, content=None, role=None, **params):
super(Delta, self).__init__(**params)
self.content = content
self.role = role
if role is not None:
self.role = role
def __contains__(self, key):
# Define custom behavior for the 'in' operator