AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

How to get Auto-GPT to work with request to Azure Open AI deployed models?

Open Mitrandir-main opened this issue 1 year ago • 1 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Windows

Which version of Auto-GPT are you using?

Latest Release

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

No response

Current behavior 😯

Hello,

I am trying to use my Azure gpt-3.5 model deployment for Auto-GPT, but when I enter prompt I always get Authorization error. I run gpt3 only mode as I dont have gpt 4 acess still.

Where should i get the value for OPENAI_API_KEY from, I have tried with the endpoint key and authorization token from Azure login.

Do you have any suggestions on where the problem might be?

This is my .env

OPENAI_API_KEY= "I put endpoint key here" USE_AZURE=True

This is my azure.yaml

azure_api_type: azure_ad azure_api_base: https://name-here.openai.azure.com azure_api_version: 2023-03-15-preview azure_model_map: fast_llm_model_deployment_id: "model gpt3 name" smart_llm_model_deployment_id: "model gpt3 name" embedding_model_deployment_id: "model ada2 name"

Expected behavior 🤔

Auto_GPT runs fine but is not able to respond and do requests to Azure Open AI API, has anyone got similar problems with getting Auto_GPT to work with Aure?

Your prompt 📝

# 

Your Logs 📒

<openai.error.APIError: Invalid response object from API: '{ "statusCode": 401, "message": "Unauthorized. Access token is missing, invalid, audience is incorrect (https://cognitiveservices.azure.com), or have expired." }' (HTTP response code was 401)
Press any key to continue>

Mitrandir-main avatar May 07 '23 15:05 Mitrandir-main

When I try using token from azure login I get this error log:

self._interpret_response_line(

File "C:\Python311\Lib\site-packages\openai\api_requestor.py", line 682, in _interpret_response_line raise self.handle_error_response( openai.error.AuthenticationError: Principal does not have access to API/Operation.

Mitrandir-main avatar May 07 '23 15:05 Mitrandir-main

We don't have access to azure so we can't really help here. Unless we get access we may need to remove the functionality. If you have access and can put us in touch, that would be lovely.

ntindle avatar May 08 '23 04:05 ntindle

@ntindle just FTR, but I believe access to Azure is typically pretty inexpensive.

I pay for a single-user enterprise license for an Office 365 tenant (and it comes with azure) for only $12/month - it also comes with the rest of everything that comes with an enterprise license (Sharepoint, DataVerse/CRM, Power Automate, etc.).

I am mostly unfamiliar with how to actually use Azure, but from my peers I've heard that it isn't expensive to use. Usually only costing a few cents on single-user accounts.

Not saying that you should go out and buy a license, but if you are interested, it isn't expensive.

anonhostpi avatar May 08 '23 04:05 anonhostpi

The OpenAI api for azure is closed access right now so even if we have an azure account (which we do) we don't have access to the open ai services through it

ntindle avatar May 08 '23 04:05 ntindle

Well, if @Mitrandir-main is proficient with Azure, I'm assuming they are probably decent with programming.

If that is the case, @Mitrandir-main, we would happily welcome you to the team.

anonhostpi avatar May 08 '23 04:05 anonhostpi