openaigo  by otiai10

Go library for OpenAI API access

created 2 years ago
296 stars

Top 90.6% on sourcepulse

GitHubView on GitHub
Project Summary

This Go library provides a client for the OpenAI API, targeting developers who need to integrate GPT-3/3.5 and GPT-4 capabilities into their applications. It offers a simple, dependency-light, and well-tested interface for interacting with various OpenAI endpoints, including chat completions, image generation, embeddings, and fine-tuning.

How It Works

The library leverages Go's standard net/http package for making API requests, abstracting the complexities of authentication and request/response serialization. It supports core OpenAI features like chat completions (including function_call and streaming responses) and image generation. The design prioritizes ease of use and minimal external dependencies, making it suitable for Go projects requiring straightforward OpenAI integration.

Quick Start & Requirements

  • Install: go get github.com/otiai10/openaigo
  • Run example: OPENAI_API_KEY=YourAPIKey go run ./testapp/main.go
  • Prerequisites: Go 1.x, OpenAI API Key.
  • Documentation: https://github.com/otiai10/openaigo

Highlighted Details

  • Full support for Chat Completions, including function_call and streaming.
  • Supports Image generation (beta), Embeddings, Files, Fine-tunes, and Moderation endpoints.
  • Includes examples for streaming responses and proxy configuration.
  • Community-maintained, not officially supported by OpenAI.

Maintenance & Community

Licensing & Compatibility

  • License: MIT.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The library is community-maintained and not officially endorsed by OpenAI. Some features are marked as beta, and the Engines endpoint is deprecated and not supported.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.