open-ai  by orhanerday

PHP SDK for OpenAI API

created 3 years ago
2,352 stars

Top 19.9% on sourcepulse

GitHubView on GitHub
Project Summary

This PHP SDK provides a comprehensive client for interacting with OpenAI's GPT-3, DALL-E, and ChatGPT APIs, targeting PHP developers seeking to integrate AI capabilities into their applications. It offers features like chat streaming and supports various OpenAI endpoints, including Assistants and Threads.

How It Works

The SDK acts as a wrapper around the OpenAI REST API, abstracting the complexities of HTTP requests and JSON parsing. It utilizes standard PHP libraries and follows a fluent interface pattern for building API calls. The library supports streaming responses via Server-Sent Events, enabling real-time interactions similar to ChatGPT.

Quick Start & Requirements

Highlighted Details

  • Supports a wide range of OpenAI API endpoints, including Chat, Completions, Images, Embeddings, Audio, Files, Fine-tunes, Moderation, Assistants, Threads, Messages, and Runs.
  • Offers integration with NVIDIA NIM for running models locally or on-premise.
  • Includes a companion "ChatGPT Clone Project" for a real-time chat interface.

Maintenance & Community

  • Community-driven with a Discord server for support.
  • Featured in PHPStorm blog posts and Laravel News.
  • Creator is actively seeking support via donations (Buy me a coffee, Patreon).

Licensing & Compatibility

  • License: MIT.
  • Compatible with any PHP framework.

Limitations & Caveats

  • The getCURLInfo() method for debugging exposes API keys and should not be used in production.
  • Fine-tuning and some Assistant/Thread functionalities are marked as beta.
Health Check
Last commit

4 months ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.