🎉 After weeks of development, @gehrisandro and I are proud to announce the release of OpenAI PHP Client v0.1. 🚀— nuno maduro 🤌🏻 (@enunomaduro) October 20, 2022
It's a supercharged PHP API client that allows you to interact with @OpenAI API. Enjoy! ⚡️ https://t.co/7Gw0fewlSx
Here's a brief example from the package's readme of using the OpenAI PHP client:
1$client = OpenAI::client('YOUR_API_KEY');23$result = $client->completions()->create([4 'model' => 'davinci',5 'prompt' => 'PHP is',6]);78echo $result['choices']['text'];9// an open-source, widely-used, server-side scripting language.
At the release of this post, the OpenAI PHP client supports the following resources:
- Models (docs)
- Completions (docs)
- Edits (docs)
- Embeddings (docs)
- Files (docs)
- FineTunes (docs)
- Moderations (docs)
OpenAI has a broad range of uses related to natural language processing (NLP), generating code from natural language, and more. To start using the OpenAI package, you'll need to familiarize yourself with the OpenAI platform. I'd recommend starting with the API docs and OpenAI API examples.
To start using OpenAI with your PHP applications, check out this package on GitHub at openai-php/client.