OpenAI-Unity  by srcnalt

Unity package for integrating OpenAI APIs

created 2 years ago
822 stars

Top 44.1% on sourcepulse

GitHubView on GitHub
Project Summary

This package provides an unofficial Unity integration for the OpenAI API, enabling game developers to incorporate AI functionalities like text generation and image creation directly within the Unity engine. It targets Unity developers seeking to leverage advanced AI models for features such as intelligent NPCs, dynamic content generation, or creative tools within their games.

How It Works

The package exposes an OpenAIApi class that handles asynchronous requests to OpenAI's various endpoints. It supports both standard and streamed responses, allowing for real-time interaction with models like GPT-3.5-turbo and DALL-E. The design emphasizes ease of integration via Unity's Package Manager and provides clear examples for common use cases.

Quick Start & Requirements

  • Install via Unity Package Manager: https://github.com/srcnalt/OpenAI-Unity.git
  • Requires Unity 2019 or later.
  • An OpenAI API key is mandatory.
  • Recommended: Store API key in a local .openai/auth.json file for security.
  • Official documentation: https://platform.openai.com/docs/api-reference

Highlighted Details

  • Supports ChatGPT and DALL-E API calls.
  • Includes sample scenes for ChatGPT and DALL-E integration.
  • Handles streamed responses via callbacks.
  • Provides guidance on secure API key management.

Maintenance & Community

  • The project is actively maintained by srcnalt.
  • YouTube tutorials are available for guidance.

Licensing & Compatibility

  • The license is not explicitly stated in the README.
  • Compatibility with commercial use or closed-source projects is not specified.

Limitations & Caveats

WebGL builds may encounter issues with image downloads due to CORS policies, and streamed responses might be blank in Unity 2020 WebGL builds. Support for older Unity versions on non-Windows platforms is marked as "Not Tested."

Health Check
Last commit

8 months ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.