Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 1005 Bytes

README.md

File metadata and controls

38 lines (30 loc) · 1005 Bytes

captainCache

Proxy for the Generative AI application using OpenAI, Use it for cahing the prompts and monitoring the number of API calls.

Prerequisites

  • Go installed on your machine
  • Redis installed and running locally or accessible via a Redis server

Installation

  1. Clone this repository.

  2. Change into the Project directory.

  3. Install the project dependencies.

    go mod download
    
  4. 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
     })
    

Usage

  • 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