Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated embedding to work with OpenAI's Python v1.3+ and with Azure O… #569

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

jmahmood
Copy link
Contributor

@jmahmood jmahmood commented Nov 18, 2023

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.

@sre-ci-robot
Copy link
Collaborator

[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.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants