Open AndrewMarchukov opened 10 months ago
Setting Up the OpenAI Prompt Query To enable the OpenAI-powered prompt querying in Mongo GUI, you'll need to obtain an API key from OpenAI and add it to your project. Here's a step-by-step guide:
Obtain an OpenAI API Key:
Visit OpenAI's platform Sign up or log in, and navigate to the API section to generate your unique API key. Add the API Key to Your Project:
In the root directory of your project, look for a .env file (or create one if it doesn't exist). Add the following line to the .env file: OPENAI_API_KEY=YOUR_API_KEY_HERE Replace YOUR_API_KEY_HERE with the API key you obtained from OpenAI. Save the .env file and restart Mongo GUI if it's currently running. With this, the AI-powered prompt querying should be activated!
🔐 Security Note: Remember to keep your .env file confidential. Never push it to public repositories or share it. It contains sensitive information.
But I don't want to use openai at all. This should be optional.
Thank you for bringing this to our attention. We will take a look at it.
@AndrewMarchukov which version of node.js you are using?
i have same issue and i use node v18.19.0
/usr/lib/node_modules/mongo-gui/node_modules/openai/index.js:52 throw new Errors.OpenAIError("The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' })."); ^
OpenAIError: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client with an apiKey option, like new OpenAI({ apiKey: 'My API Key' }).
at new OpenAI (/usr/lib/node_modules/mongo-gui/node_modules/openai/index.js:52:19)
at Object.
Thank you for bringing this to our attention. We will take a look at it.
?
Yeah, having OPENAI_API_KEY should be 'opt-in' feature and not enable by default. Easy way would be to enable OPENAI_API_KEY exists then enable it. Thanks for the library!
Is there any plan on fixing this issue?
When i trying just start
mongo-gui
i get this: