Giter VIP home page Giter VIP logo

openaiservice's Introduction

OpenAI API Client

A simple client for calling the OpenAI API with Go and logging the requests.

Getting Started

Prerequisites

  • Go 1.16 or higher
  • Docker
  • Docker Compose

Installing

Clone the repository: git clone https://github.com/[USERNAME]/openai-api-client.git
Move into the project directory: cd openai-api-client
Install the dependencies: go mod download

Usage

Running locally

To run the client locally, use the go run command:

    go run main.go serve

By default, the server will listen on port 1414. You can change this by modifying the server.port configuration value in the config.yaml file.

You can make requests to the API by sending a GET request to the /api/openai endpoint with a keyword query parameter:

    http://localhost:1414/api/openai?keyword=[YOUR_KEYWORD]

Docker

Start the application using Docker Compose:

    docker-compose up

Contributing

Contributions to this project are welcome! To get started:

  • Fork this repository
  • Create a new branch: git checkout -b feature/my-new-feature
  • Make your changes and commit them: git commit -am 'Add some feature'
  • Push the changes to your fork: git push origin feature/my-new-feature
  • Create a new pull request

Please make sure your code passes the unit tests and integration tests before submitting a pull request.

Credit

This amazing project would not have been possible without the contributions of these incredible open-source libraries:

  • Golang
  • mux
  • gorm
  • Viper

openaiservice's People

Contributors

temon avatar

Stargazers

 avatar Rodolfo Castanheira avatar Cita Wijaya avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.