From 69fdd2f4cb363c86fc24c35963b7b196d6c82a2a Mon Sep 17 00:00:00 2001 From: Greg Priday Date: Wed, 22 Nov 2023 06:57:34 +0200 Subject: [PATCH] Update README.md Added notes about archived status --- README.md | 88 ++++++++++++------------------------------------------- 1 file changed, 18 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 083946b..1d7a85f 100644 --- a/README.md +++ b/README.md @@ -1,83 +1,31 @@ -# A PHP wrapper for the OpenAI API +# Archive Notice for the OpenAI PHP Wrapper -[![Latest Version on Packagist](https://badgen.net/packagist/v/siteorigin/openai-api)](https://packagist.org/packages/siteorigin/openai-api) -[![PHP Version Requirement](https://badgen.net/packagist/php/siteorigin/openai-api)](https://packagist.org/packages/siteorigin/openai-api) -[![GitHub Tests Action Status](https://github.com/siteorigin/openai-api/actions/workflows/run-tests.yml/badge.svg)](https://github.com/siteorigin/openai-api/actions?query=workflow%3ATests+branch%3Amaster) -[![GitHub Code Style Action Status](https://github.com/siteorigin/openai-api/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/siteorigin/openai-api/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amaster) -[![Total Downloads](https://badgen.net/packagist/dt/siteorigin/openai-api)](https://packagist.org/packages/siteorigin/openai-api) +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: -GPT-3 lets you inject a little bit of AI magic into your apps, and this PHP wrapper makes it even easier to access. Covers the entire OpenAI API, in a familiar PHP way, without limiting any functionality. +- **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. -```php -use SiteOrigin\OpenAI\Client; -$client = new Client($_ENV['OPENAI_API_KEY']); -$completions = $client->completions('davinci')->complete("The most important technology for humanity is", [ - 'max_tokens' => 32, - 'temperature' => 0.8, - 'n' => 4, - 'stop' => ["\n", '.'] -]); -foreach($completions as $c) { - echo $c->text . "\n"; -} -``` - -Read more on the [documentation wiki](https://github.com/siteorigin/openai-api/wiki). +### Features: -## Installation +- Provided a comprehensive interface for the OpenAI API in PHP. +- Simplified syntax for common tasks like generating completions. +- Supported full API functionality without constraints. -You can install the package via composer: - -```bash -composer require siteorigin/openai-api -``` - -## Usage - -For most of the features of this wrapper, you should have an understanding of the [OpenAI API](https://beta.openai.com/docs/api-reference/introduction). +### Example Code Snippet: ```php -// Set up a client with your API key. use SiteOrigin\OpenAI\Client; -use SiteOrigin\OpenAI\Models; - $client = new Client($_ENV['OPENAI_API_KEY']); - -// Create a completion call -$c = $client->completions(Models::BABBAGE)->complete('The meaning of life is: ', [ /* ... */]); - -// List all the available engines -$e = $client->engines()->list(); - -// Classify safe/unsafe content -$f = $client->filter()->classify('ponies are fantastic!'); // 'safe' -``` - -## Testing - -```bash -composer test +// Example usage for generating completions +$completions = $client->completions('davinci')->complete("Sample prompt", [/* parameters */]); +foreach($completions as $c) { + echo $c->text . "\n"; +} ``` -## Changelog - -Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. - -## Contributing - -Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. - -## Security Vulnerabilities - -Please email greg@siteorigin.com if you find any security vulnerabilities. - -## Credits - -- [Greg Priday](https://github.com/gregpriday) -- [All Contributors](../../contributors) - -## License +### Further Information: -The MIT License (MIT). Please see [License File](LICENSE.md) for more 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.