================
This project utilizes the Gemini AI API to generate content based on a given prompt. The API request is made using the gemini-ai Ruby gem, and the response is processed to extract the generated content.
- Ruby 3.1.0 or higher
gemini-aigem installed (version ~> 4.2.0)dotenvgem installed- A Google Gemini Token set as an environment variable (
GOOGLE_GEMINI_TOKEN)
- Clone the repository and navigate to the project directory.
- Install the required gems by running
bundle install. - Set your Google Gemini Token as an environment variable. You can do this by creating a
.envfile in the project root with the following content:
GOOGLE_GEMINI_TOKEN=your_token_here
Replace your_token_here with your actual token.
- Put the files you want to use as input in the
/inputfolder. - Run the project using the run.sh script:
sh run.shThis will execute the lib/main.rb script and save the generated content to result/out.txt.
- The project uses the
gemini-promodel for content generation. - The API request is made with the
server_sent_eventsoption set totrue. - The generated content is extracted from the API response and saved to a file.