Proxy for the Generative AI application using OpenAI, Use it for cahing the prompts and monitoring the number of API calls.
- Go installed on your machine
- Redis installed and running locally or accessible via a Redis server
-
Clone this repository.
-
Change into the Project directory.
-
Install the project dependencies.
go mod download
-
Set up the Redis connection details in the main.go file
redisClient = redis.NewClient(&redis.Options{ Addr: "localhost:6379", Password: "", // Enter your Redis password if applicable DB: 0, // Use default Redis database })
- start the Proxy server using
go run main.go
- Make HTTP requests via Proxy
GET http://localhost:8080/?api_key=<YOUR_API_KEY>&prompt=Hello%20World