https://github.com/siteorigin/openai-api
PHP wrapper for the OpenAI API.
https://github.com/siteorigin/openai-api
gpt-3 openai php
Last synced: 6 months ago
JSON representation
PHP wrapper for the OpenAI API.
- Host: GitHub
- URL: https://github.com/siteorigin/openai-api
- Owner: siteorigin
- License: mit
- Archived: true
- Created: 2021-06-30T14:31:13.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-11-22T04:57:34.000Z (over 2 years ago)
- Last Synced: 2024-11-02T01:06:08.720Z (over 1 year ago)
- Topics: gpt-3, openai, php
- Language: PHP
- Homepage:
- Size: 622 KB
- Stars: 7
- Watchers: 7
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Archive Notice for the OpenAI PHP Wrapper
This repository for the OpenAI PHP Wrapper, developed by SiteOrigin, is now archived. For updated and ongoing PHP integration with OpenAI's API, please refer to the [OpenAI PHP Client](https://github.com/openai-php/client) instead.
## Original Repository Details:
- **Repository:** [OpenAI PHP Wrapper by SiteOrigin](https://github.com/siteorigin/openai-api)
- **Packagist:** [siteorigin/openai-api](https://packagist.org/packages/siteorigin/openai-api)
- **Functionality:** Facilitated integration with the OpenAI API, offering a PHP-based approach for incorporating GPT-3 into applications.
### Features:
- Provided a comprehensive interface for the OpenAI API in PHP.
- Simplified syntax for common tasks like generating completions.
- Supported full API functionality without constraints.
### Example Code Snippet:
```php
use SiteOrigin\OpenAI\Client;
$client = new Client($_ENV['OPENAI_API_KEY']);
// Example usage for generating completions
$completions = $client->completions('davinci')->complete("Sample prompt", [/* parameters */]);
foreach($completions as $c) {
echo $c->text . "\n";
}
```
### Further Information:
For those who previously utilized or are interested in this PHP wrapper, it's recommended to transition to the [new OpenAI PHP Client](https://github.com/openai-php/client) for the latest updates and continued support.