openai  by anasfik

Dart/Flutter SDK for OpenAI APIs (GPT, DALL-E, Whisper)

created 2 years ago
634 stars

Top 53.3% on sourcepulse

GitHubView on GitHub
Project Summary

This Dart/Flutter SDK provides a comprehensive client for interacting with all OpenAI APIs, including GPT, DALL-E, and Whisper. It's designed for Flutter and Dart developers seeking to integrate advanced AI capabilities into their applications with ease, offering intuitive methods and stream support for real-time responses.

How It Works

The SDK acts as a lightweight wrapper around OpenAI's REST APIs. It abstracts away the complexities of HTTP requests, authentication, and data serialization/deserialization. Key design choices include mirroring OpenAI's documentation structure for familiarity, providing a single point of initialization for API keys and organization IDs, and offering stream support for completions and chat endpoints to enable real-time user experiences.

Quick Start & Requirements

  • Install via pub.dev: dart pub add openai
  • Requires an OpenAI API key. It's recommended to manage this using environment variables (e.g., with the envied package).
  • Full documentation available at https://docs.pm.ai/openai/.

Highlighted Details

  • Supports all major OpenAI APIs: Completions, Chat (ChatGPT), Edits, Images (generation, edits, variations), Embeddings, Audio (Speech, Transcription, Translation), Files, Fine-tunes, and Moderations.
  • Features stream functionality for completions and chat APIs, allowing for real-time responses.
  • Includes robust error handling with custom exceptions like RequestFailedException.
  • Provides example snippets for nearly all implemented functionalities.

Maintenance & Community

The project is actively maintained, with contributions encouraged. Links to community support (Discord/Slack) are not explicitly provided in the README.

Licensing & Compatibility

The SDK is released under the MIT License, permitting commercial use and integration with closed-source applications.

Limitations & Caveats

The README does not detail specific limitations or known issues. As an unofficial SDK, it relies on OpenAI's API stability and may require updates to align with API changes.

Health Check
Last commit

1 year ago

Responsiveness

1 week

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

Explore Similar Projects

Feedback? Help us improve.