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

Error: Azure OpenAI API instance name not found #458

Closed
hendryman opened this issue Feb 4, 2024 · 3 comments
Closed

Error: Azure OpenAI API instance name not found #458

hendryman opened this issue Feb 4, 2024 · 3 comments
Labels
kind: bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@hendryman
Copy link

I have configured .env as described in the repo.

Then, on yarn run ingest i get this error:

error Error: Azure OpenAI API instance name not found at new OpenAIEmbeddings (file:///Users/manuel/Dropbox/GitHub/repos/gpt4-pdf-chatbot-langchain/node_modules/langchain/dist/embeddings/openai.js:121:23)

How can I fix this?

Copy link

dosubot bot commented Feb 4, 2024

🤖

Hey @hendryman, good to see you back! Running into a bit of a snag, I see? Let's get that sorted.

The error you're encountering seems to be related to the OpenAI API key configuration. Here are some steps you can take to resolve this issue:

  1. Verify your .env file: Ensure that you have copied .env.example into .env and filled in the necessary details. Your .env file should look like this:
OPENAI_API_KEY=<your_openai_api_key>

PINECONE_API_KEY=<your_pinecone_api_key>
PINECONE_ENVIRONMENT=<your_pinecone_environment>
PINECONE_INDEX_NAME=<your_pinecone_index_name>

Replace <your_openai_api_key>, <your_pinecone_api_key>, <your_pinecone_environment>, and <your_pinecone_index_name> with your actual keys and details.

  1. Check your OpenAI API key: Visit openai to retrieve your API keys and insert them into your .env file. Make sure the key is valid and working.

  2. Check for multiple OpenAI keys: Ensure that you don't have multiple OpenAI keys in your global environment. If you do, the local env file from the project will be overwritten by the system's env variable.

  3. Hardcode your API keys: If you're still facing issues, try hardcoding your API keys into the process.env variables.

  4. Check your OpenAI credits: Make sure you have enough OpenAI credits and a valid card on your billing account.

If you've checked all these and the issue persists, it might be a problem with the OpenAI API itself or the way it's being used in the code. In that case, you might need to check the code where the API is being used or contact OpenAI support for further assistance.

For more information, you can refer to the README.md and .env.example files in the repository.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the kind: bug Related to a bug, vulnerability, unexpected error with an existing feature label Feb 4, 2024
@hendryman
Copy link
Author

@dosu-bot that does not solve my problem. The problem is an error with a "Azure OpenAI API instance name" - I don't use the Azure OpenAI API...

Copy link

dosubot bot commented Feb 4, 2024

🤖

The error you're encountering seems to be related to the OpenAIEmbeddings class, which is used in the gpt4-pdf-chatbot-langchain codebase to generate embeddings for the text data. These embeddings are vector representations of the text data that can be used for various machine learning tasks.

However, since you mentioned that you don't use Azure OpenAI API, you might want to replace the OpenAIEmbeddings with another embeddings generator that doesn't rely on Azure OpenAI API.

Unfortunately, without the implementation details of the OpenAIEmbeddings class and other alternatives, I can't provide a specific solution. You might need to look into the documentation or source code of the 'langchain/embeddings/openai' module to find out how to replace or bypass the Azure OpenAI API usage.

If the OpenAIEmbeddings class is not essential for your use case, you could potentially comment out or remove the related lines:

// const embeddings = new OpenAIEmbeddings();

// await PineconeStore.fromDocuments(docs, embeddings, {
//   pineconeIndex: index,
//   namespace: PINECONE_NAME_SPACE,
//   textKey: 'text',
// });

Please note that this will likely affect the functionality of your application, as the embeddings won't be generated and stored. You should replace these lines with an alternative way of generating and storing embeddings that fits your needs.

You can find these lines in the scripts/ingest-data.ts file.

I hope this helps! If you have any other questions or need further clarification, feel free to ask.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label May 5, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant