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

✨ Enable the use of an Azure api-key #77

Closed
jaxblack opened this issue Apr 13, 2023 · 19 comments
Closed

✨ Enable the use of an Azure api-key #77

jaxblack opened this issue Apr 13, 2023 · 19 comments
Labels
enhancement New feature or request

Comments

@jaxblack
Copy link

Azure api-key is different from openai api-key. And it should be used.

image

@RepubIique
Copy link

If I am not wrong from reading this
https://msandbu.org/openai-vs-azure-openai/

Azure OpenAI API key is a specific type of API key that allows you to access OpenAI's GPT-3 language model through the Azure Cognitive Services. This means that you can use the Azure portal to create and manage your Azure OpenAI API key, and you will be billed by Microsoft Azure for any usage of the API.

On the other hand, the OpenAI API key is a general API key that allows you to access all of the OpenAI APIs, including GPT-3, through the OpenAI API platform. This means that you can create and manage your OpenAI API key through the OpenAI website, and you will be billed directly by OpenAI for any usage of the API.

In summary, the main difference between the two API keys is the platform they are associated with and the billing method used for their usage. Azure OpenAI API key is associated with Azure Cognitive Services and is billed by Microsoft Azure, while OpenAI API key is associated with the OpenAI platform and is billed by OpenAI.

@cypggs
Copy link

cypggs commented Apr 13, 2023

I also want to use Azure api-key

@cypggs
Copy link

cypggs commented Apr 13, 2023

(auto-gpt) ➜ Auto-GPT git:(master) ✗ grep -nFR USE_AZURE *
README.md:102:- If you want to use GPT on an Azure instance, set USE_AZURE to True and provide the OPENAI_AZURE_API_BASE, OPENAI_AZURE_API_VERSION and OPENAI_AZURE_DEPLOYMENT_ID values as explained here: https://pypi.org/project/openai/ in the Microsoft Azure Endpoints section. Additionally you need separate deployments for both embeddings and chat. Add their ID values to OPENAI_AZURE_CHAT_DEPLOYMENT_ID and OPENAI_AZURE_EMBEDDINGS_DEPLOYMENT_ID respectively
scripts/config.py:47: self.use_azure = os.getenv("USE_AZURE") == 'True'
Binary file scripts/pycache/config.cpython-38.pyc matches

@awtkns
Copy link
Member

awtkns commented Apr 13, 2023

Hi all this is definitely a something we want to support. I can support by helping to review any prs for this 😊

@APiTJLillo APiTJLillo added the enhancement New feature or request label Apr 15, 2023
@yuanman2016
Copy link

Also need this feature, hope it will be supported soon

@itsjobangrewal
Copy link

Hi all this is definitely a something we want to support. I can support by helping to review any prs for this 😊

me too pls, waiting for next release

@karshatmosera
Copy link

We'd like this feature as well, please.

@qianchen94
Copy link

me too

@jebouruama
Copy link

me too,please

@behinder85
Copy link

How is it going so far? I am already very excited about it

@ottodeng
Copy link

me too

@GGGyanice
Copy link

me too,please

@asim-shrestha asim-shrestha changed the title how could I use Azure api-key? ✨ Enable the use of an Azure api-key Jun 5, 2023
@asim-shrestha asim-shrestha moved this to Planned this week in AgentGPT Roadmap 🚀 Jun 5, 2023
@asim-shrestha asim-shrestha moved this from Planned this week to Todo in AgentGPT Roadmap 🚀 Jun 5, 2023
@securigy
Copy link

securigy commented Jun 6, 2023

I am digging into Azure Semantic Kernel and its examples... and most of them reference the following:

Env.Var("AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME"), Env.Var("AZURE_OPENAI_EMBEDDINGS_ENDPOINT"), Env.Var("AZURE_OPENAI_EMBEDDINGS_KEY"))

I had not idea that Embeddings require separate set of Name/Endpoint/Key...
How do I get them?

@Zizico2
Copy link

Zizico2 commented Jul 28, 2023

I have this working internally, at my current employer, with hardcoded api_keys and model_names, deployment_ids, etc.. We're just testing it out. We broke OpenAI to get Azure OpenAI working as easily as possible. Plus we still don't have access to 3.5-16k so summaries are broken.

I might, eventually, tidy it up and submit a PR. But it is not even close to a priority currently :/. I'm more than happy to provide any help if someone is implementing this and gets stuck.

@awtkns
Copy link
Member

awtkns commented Jul 31, 2023

hey this was fixed in #1165

In settings.py you can now enable azure

    # Azure OpenAI
    azure_openai_api_version: str = "2023-06-01-preview"
    azure_openai_api_key: str = ""
    azure_openai_api_base: str = ""
    azure_openai_deployment_name: str = ""

Note that agentgpt uses function calling which is not supported by azure as of yet so it will fall back to openai in some cases :)

@awtkns awtkns closed this as completed Jul 31, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in AgentGPT Roadmap 🚀 Jul 31, 2023
@Zizico2
Copy link

Zizico2 commented Jul 31, 2023

Note that agentgpt uses function calling which is not supported by azure as of yet so it will fall back to openai in some cases :)

I did manage to get it working, including functions. Versions 0613 support functions (source).

I think Microsoft is rolling them out slowly. What I didn't manage to get working properly were the summaries because I don't have access to the 16k model. Idk if there's any solution there.

@zenyanbo
Copy link

hey this was fixed in #1165

In settings.py you can now enable azure

    # Azure OpenAI
    azure_openai_api_version: str = "2023-06-01-preview"
    azure_openai_api_key: str = ""
    azure_openai_api_base: str = ""
    azure_openai_deployment_name: str = ""

Note that agentgpt uses function calling which is not supported by azure as of yet so it will fall back to openai in some cases :)

hellow, even though I added those options as well.

    azure_openai_api_version: str = "2023-06-01-preview"
    azure_openai_api_key: str = "<my key>"
    azure_openai_api_base: str = "https://<my domain>.openai.azure.com/"
    azure_openai_deployment_name: str = "gpt4"

However, it always says: Authentication error: Ensure a valid API key is being used. The next interface also only has the gpt3.5 gpt-3.5-16k gpt-4 option in the settings. It seems agentgpt is still using the openai api. What should I do?

@ssugar
Copy link

ssugar commented Oct 27, 2023

I have this working internally, at my current employer, with hardcoded api_keys and model_names, deployment_ids, etc.. We're just testing it out. We broke OpenAI to get Azure OpenAI working as easily as possible. Plus we still don't have access to 3.5-16k so summaries are broken.

I might, eventually, tidy it up and submit a PR. But it is not even close to a priority currently :/. I'm more than happy to provide any help if someone is implementing this and gets stuck.

@Zizico2
How did you get this working? I've been trying to set the env variables in /next/.env and also tried changing settings via /platform/reworkd_platform/settings.py, but haven't had any luck.

@h3nryza
Copy link

h3nryza commented Dec 25, 2023

I have this working internally, at my current employer, with hardcoded api_keys and model_names, deployment_ids, etc.. We're just testing it out. We broke OpenAI to get Azure OpenAI working as easily as possible. Plus we still don't have access to 3.5-16k so summaries are broken.
I might, eventually, tidy it up and submit a PR. But it is not even close to a priority currently :/. I'm more than happy to provide any help if someone is implementing this and gets stuck.

@Zizico2 How did you get this working? I've been trying to set the env variables in /next/.env and also tried changing settings via /platform/reworkd_platform/settings.py, but haven't had any luck.

I see that they deprecated the functions calling and added it under the tools API: https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling?tabs=python.

@awtkns maybe something to add to a new or existing feature?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests