Gemini Go is an AI-based response generator written in Go. The project uses Google's Generative AI to generate meme captions based on user-provided prompts. The main entry point of the application is main.go
, which starts an HTTP server. The AI functionality is implemented in ai/client.go
, and the HTTP request handler is defined in handlers/request-handler.go
. Environment variables are managed in lib/utils.go
, and dependencies are listed in go.mod
.
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/ojuss/gemini-go.git cd gemini-go
-
Install the dependencies:
go mod tidy
-
Create a
.env
file in the root directory and add your Gemini API key:GEMINI_API_KEY=your_api_key_here
-
Run the project:
go run main.go
To use the API endpoint, send a POST request to http://localhost:8080/ai
with a JSON payload containing the prompt. For example:
curl -X POST http://localhost:8080/ai -d '{"prompt": "funny cat"}' -H "Content-Type: application/json"
The main dependencies used in this project are: