Added --openai-api-engine

This commit is contained in:
Paul Gauthier 2023-07-11 15:11:35 -07:00
parent 084132a5f8
commit d97707a5c0
2 changed files with 14 additions and 5 deletions

View file

@ -624,8 +624,12 @@ class Coder:
)
if functions is not None:
kwargs["functions"] = self.functions
# we are abusing the openai object to stash these values
if hasattr(openai, "api_deployment_id"):
kwargs["deployment_id"] = openai.api_deployment_id
if hasattr(openai, "api_engine"):
kwargs["engine"] = openai.api_engine
# Generate SHA1 hash of kwargs and append it to chat_completion_call_hashes
hash_object = hashlib.sha1(json.dumps(kwargs, sort_keys=True).encode())