Gemini is an AI-powered content generator built using Node.js and Google's Generative AI. It allows you to generate content by providing prompts through HTTP requests.
- Installation
- Usage
- Setting Up Environment Variables
- Obtaining API Key
- Making a POST Request
- Additional Notes
To get started with the project, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/your-username/gemini-content-generator.git
-
Install the dependencies:
npm install
Once the installation is complete, you can start the server using the following command:
npm run start
This will start the server, and you'll be able to make HTTP requests to generate content.
The project uses environment variables to securely store sensitive information such as API credentials. To set up environment variables, create a .env
file in the root directory of the project and add the following variables:
API_KEY=YOUR_API_KEY
PORT=3000
Replace YOUR_API_KEY
with the API key obtained from Google Developers Console.
Before using Gemini, you need to obtain an API key from Google Developers Console. Follow these steps:
- Sign in to your Google account.
- Go to https://makersuite.google.com/app/apikey.
- Create an API key.
- Replace
YOUR_API_KEY
in the.env
file with the API key you obtained.
To generate content using Gemini, make a POST request to http://localhost:3000/generate
with the following JSON payload:
{
"prompt": "Give information on burger king in india"
}
You will receive a response with the generated content.
- Customize the prompt in the JSON payload according to your requirements.
- Ensure that your
.env
file is properly configured with the API key and port. - You can modify the server port in the
.env
file if needed.