laravel-openai-connect maintained by yeloi
Description
The Laravel-OpenAI-Connect package makes it easy to integrate OpenAI's cutting-edge machine learning capabilities into Laravel applications.
Author
Last update
2023/07/04 01:21
(dev-main)
License
Downloads
1
Tags
Laravel OpenAI Connect Lib
The Laravel-OpenAI-Connect package makes it easy to integrate OpenAI.
Installation
You can install the package via composer:
composer require yeloi/laravel-openai-connect
Add to your env file the openia api key:
OPENAI_API_KEY=<secret_key>
Usage
use Connectors\OpenAIConnect\OpenAI;
$system = "You are a tech company employee named bob.";
$message = [
["role" => "user", "content" => "what is your name?"],
];
$data = OpenAI::model('gpt-3.5-turbo')->system($system)->prompt($message)->options(['max_tokens' => 1000])->send();
dd($data->message);
// My name is Bob. How can I assist you today?
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.