Open jmahmood opened 7 months ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: jmahmood
To complete the pull request process, please assign xiaofan-luan after the PR has been reviewed.
You can assign the PR to them by writing /assign @xiaofan-luan
in a comment when ready.
The full list of commands accepted by this bot can be found here.
Hi!
This is meant to correct problems with embedding in the latest versions of the OpenAI Python Library and GPTCache.
The latest versions of the OpenAI Python API do not include the
.api_base
function; even if you manually override it, this leads to other issues. Moreover, the best practice now is to instantiate a client and to use it instead of the global context.The Azure OpenAI part has further complications related to "Azure Deployments" and different os.environ variables.
Rather than keep track of these within GPTCache, my suggestion is that it might make sense to have the user pass in an instance of the OpenAI client object.
I have access to both OpenAI and Azure OpenAI so I can offer additional help with that if necessary.
One of the issues I am running into is that there is an async version of the OpenAI objects; obviously we can't use async with those. Is there a method you have in mind to deal with this, or would you prefer only to work with the synchronous items?
I am in the process of testing this, so if you are interested but would like to make chances, please don't hesitate to let me know.