Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
MIT License
166.57k stars 44.09k forks source link

APIConnectionError: Invalid URL 'your-base-url-for-azure/embeddings': No scheme supplied #838

Closed pietrosperoni closed 1 year ago

pietrosperoni commented 1 year ago

Duplicates

Steps to reproduce 🕹

For me, I cannot avoid it, so I don't know why it works for everybody else.

I have a .env with those values:

PINECONE_API_KEY=KEY PINECONE_ENV="asia-southeast1-gcp" OPENAI_API_KEY=KEY ELEVENLABS_API_KEY=your-elevenlabs-api-key SMART_LLM_MODEL="gpt-3.5-turbo"#"gpt-4" FAST_LLM_MODEL="gpt-3.5-turbo" GOOGLE_API_KEY= CUSTOM_SEARCH_ENGINE_ID= USE_AZURE=False OPENAI_API_BASE=your-base-url-for-azure OPENAI_API_VERSION="gpt-3.5-turbo" OPENAI_DEPLOYMENT_ID=deployment-id-for-azure IMAGE_PROVIDER=dalle HUGGINGFACE_API_TOKEN=

with instead of KEY the various keys. Notice the USE_AZURE=False When I run the system it ALWAYS blocks on the function get_ada_embedding with stack

Screenshot 2023-04-11 at 19 20 06

I have a free account in Pinecone, and a pro account in openai, and also an account to use open API (but not to use gdp-4). Notice that interestingly my API appear to never have been used:

Screenshot 2023-04-11 at 19 26 57

I tried to change it but it did not help.

Current behavior 😯

The system runs until the chat_with_ai function calls the get relevant (line 72) which calls get_ada_embedding, which calls return openai.Embedding.create(input=[text], model="text-embedding-ada-002")["data"][0]["embedding"]

which returns an error.

Screenshot 2023-04-11 at 19 30 29

What is interesting is what the error says: First message: APIConnectionError (this is something openai is launching) Second message: Error communicating with OpenAI: Invalid URL 'your-base-url-for-azure/embeddings': No scheme supplied

somehow the string 'your-base-url-for-azure' gets sent to openai, even though in the .env I have USE_AZURE=False

Expected behavior 🤔

I suppose returning a vector (an embedding).

Your prompt 📝

There is no last_run_ai_settings.yaml file.

There is however an ai_settings.yaml file whose value is:

- Increase net worth.
- Develop and manage multiple businesses autonomously.
- Play to your strengths as a Large Language Model.
ai_name: Entrepreneur-GPT
ai_role: an AI designed to autonomously develop and run businesses with the sole goal
  of increasing your net worth.
Moomero commented 1 year ago

This is a duplicate, but you just need to change the environment value names to the below

OPENAI_AZURE_API_BASE=your-base-url-for-azure
OPENAI_AZURE_API_VERSION=api-version-for-azure
OPENAI_AZURE_DEPLOYMENT_ID=deployment-id-for-azure
pietrosperoni commented 1 year ago

First of all thank you very much. You solved the issue. Said that I swear on all the mathematical truths that yesterday I had the environmental variables as you listed and it did not work. But now it does. It's a mystery.