fix(utils.py): stricter azure function calling tests

This commit is contained in:
Krrish Dholakia 2024-02-23 20:55:32 -08:00
parent 308c73fca9
commit 97b9d570a6
2 changed files with 261 additions and 33 deletions

View file

@ -376,11 +376,9 @@ class StreamingChoices(OpenAIObject):
self.delta = delta
else:
self.delta = Delta()
if logprobs is not None:
self.logprobs = logprobs
if enhancements is not None:
self.enhancements = enhancements
self.logprobs = logprobs
def __contains__(self, key):
# Define custom behavior for the 'in' operator
@ -8623,6 +8621,10 @@ class CustomStreamWrapper:
model_response.choices[0].finish_reason = response_obj[
"finish_reason"
]
if response_obj.get("original_chunk", None) is not None:
model_response.system_fingerprint = getattr(
response_obj["original_chunk"], "system_fingerprint", None
)
if response_obj["logprobs"] is not None:
model_response.choices[0].logprobs = response_obj["logprobs"]