OpenAi-Api-Unity  by hexthedev

Unity integration for the OpenAI API (archived)

created 4 years ago
337 stars

Top 82.8% on sourcepulse

GitHubView on GitHub
Project Summary

This Unity integration provides a C# wrapper for the OpenAI API, enabling developers to easily incorporate AI-powered features like text generation and chat completions into their games and applications. It offers both Coroutine and asynchronous function implementations for seamless integration within Unity's workflow.

How It Works

The library wraps OpenAI API endpoints, including Completions and Chat Completions, as Coroutines and async methods. This approach leverages Unity's execution model, allowing AI calls to be made without blocking the main thread, thus maintaining application responsiveness. The syntax closely mirrors the official OpenAI API documentation for ease of use.

Quick Start & Requirements

  • Install: Via Unity Package Manager (Window > Package Manager > Add package from git URL...) using https://github.com/hexthedev/OpenAi-Api-Unity.git.
  • Prerequisites: Unity, OpenAI API Key. Authentication is handled via a ~/.openai/auth.json file.
  • Setup: Minimal, primarily involves adding the package and configuring API keys.
  • Docs: OpenAI API Reference

Highlighted Details

  • Implements POST /chat/completions and POST /engines/{engine_id}/completions.
  • Provides Coroutine and async API call wrappers.
  • Includes editor scripts and runtime examples for completions and chat.
  • Based on the OpenAI-API-dotnet repository.

Maintenance & Community

The project is officially archived and no longer maintained by the original author, who lacks time for PRs or repo management. Community contributions via Pull Requests are welcome, but unlikely to be merged.

Licensing & Compatibility

The repository does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

This project is officially archived and unmaintained, with no further updates planned. Several API endpoints, such as streaming completions and file uploads, are not implemented or tested. Testing has been limited to Windows editor and play mode, with potential platform-specific issues in builds. Organization key functionality has not been tested.

Health Check
Last commit

1 year ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.