OpenAI Integration is a powerful AI tool for your BowPHP application. It enables you to integrate and leverage OpenAI's language model capabilities in your project.
Features
- Seamless integration with OpenAI
- Provides an easy-to-use PHP API for the OpenAI API
- Configurable via BowPHP's configuration system
- Requirements
PHP 8.1 and above Bowphp 5.x Installation
To include this package via Composer, run the following command:
composer require bowphp/bow-openai
Once the installation is complete, include the service provider within app/Kernel.php.
public function configurations(): array
{
return [
...
App\Configurations\OpenAIConfiguration::class,
];
}
Setup the OpenAI integration in config/openai.php config.
Available options Option Description api_key Your OpenAI API key. Usage
You can use the OpenAI service in your application like this:
$response = $this->container->make('openai.completions', [
'Translate these English words to French: "{words}"',
[
'max_tokens' => 60,
]
]);
namespace App\Controllers;
use Bow\Controller\Controller;
class TranslateController extends Controller
{
public function translate()
{
$response = $this->container->make('openai.completions', [
'Translate these English words to French: "{words}"',
[
'max_tokens' => 60,
]
]);
return $response;
}
}
- gnakale
Thank's collaborators
Contact
- [email protected] - @gnakalehacker01
- Please, if there is a bug in the project, contact me by email or leave me a message on Slack. or join us on Slack Contributing
-
Contributing
-
Fork it
-
Create your feature branch (git checkout -b my-new-feature)
-
Commit your changes (git commit -am 'Add some feature')
-
Push to the branch (git push origin my-new-feature)
-
Create new Pull Request
-
License
-
OpenAI Integration for BowPHP is open-sourced software licensed under the MIT license.