How to resolve an openai.error.AuthenticationError with Azure OpenAI API Embeddings_Create operation?

Joaquín Bonifacino 0 Reputation points
2024-04-22T18:07:35.3433333+00:00

I am working on creating a RAG, and I have successfully set up the LLM connection with gpt-4-32k as my model. I also want to use Azure OpenAI embeddings in another section of my app. I created the service in Azure OpenAI Dashboard, and I created the following code to use the embeddings:

def create_retriever(docs: Document):
    openai.api_type = "azure"
    openai.api_key = "KEY"
    openai.api_base = "ENDPOINT"
    openai.api_version = "2023-05-15"
    embeddings = [openai.Embedding.create(input=doc.page_content, engine="text-embedding-3-small")['data'][0]['embedding'] for doc in docs]

    db = Chroma.from_vectors(embeddings)
    retriever = db.as_retriever(search_type="mmr")

    return retriever

However, I am getting an error when I try to use it:

openai.error.AuthenticationError: The Embeddings_Create Operation under Azure OpenAI API version 2023-05-15 is not supported with the current subscription key and pricing tier FormRecognizer.S0.

I have checked since we are azure partners and we have a token budget and they told me we can use it in any service we want.

So i'm not sure why I'm receiving this error message. Can anyone help me resolve this issue?

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,188 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 27,491 Reputation points
    2024-04-23T13:42:41.55+00:00

    Joaquín Bonifacino I'm glad that your issue is resolved and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.

    Error Message:

    openai.error.AuthenticationError: The Embeddings_Create Operation under Azure OpenAI API version 2023-05-15 is not supported with the current subscription key and pricing tier FormRecognizer.S0.
    
    

    Solution:

    It was that the deployed model didn't have the correct name

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    0 comments No comments