-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Feat: Allow Azure ChatGPT usage #192
base: main
Are you sure you want to change the base?
Conversation
Adds variable "OPENAI_API_ENGINE", which is needed for the Azure API
Hi! Thanks for this. It helped me find the error for my system and I can now use Azure! 🥳 |
Hi, do you have any idea how Azure can be used with the docker version? |
@AkivaAK Apply my diff, and it should work I think. |
@cryptictech Maybe I can use the same way to implement the function I want, I will use a third-party api, they will have the same api capabilities as open ai, just the base url is different. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR, there are some conflicts and could you please resolve them : ) .
Adds access to the environment variable "OPENAI_API_ENGINE", which is needed for the Azure API.
The Azure API requires the use of the 'engine' parameter in the ChatCompletion and not the 'model' parameter. ie, from the documentation, here are the needed parameters:
This patch lets you use your Azure ChatGPT account by defining the engine and other required variables as environment variables, without affecting the standard OpenAI API use. Azure API access is used like this:
OPENAI_API_BASE="https://your_deployment_name.openai.azure.com/" OPENAI_API_TYPE=azure OPENAI_API_ENGINE=your_model_name OPENAI_API_VERSION=2023-05-15 OPENAI_API_KEY=your_secret_key python3 run.py --task "Snake game in pure html" --name "WebSnake"
This has been tested with Azure and OpenAI APIs successfully.