-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4b5a7a
commit 38bf86d
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,40 @@ | ||
# Nova OpenAI | ||
|
||
## Testing | ||
OpenAI SDK for a Laravel application that also stores OpenAI communication and presents it in a Laravel Nova admin panel. | ||
|
||
This is currently an **unstable** package, breaking changes are to be expected. The main objective at the moment is to make it easier to include it as a dependency in our own client projects. This way we can make it more mature and have a v1 release when we feel it suits our needs in practice. This is why we haven't implemented all OpenAI endpoints yet and will add them one-by-one when they are actually needed. | ||
|
||
If you need any features to be implemented or bump its priority in our backlog then feel free to make an inquiry via email at [email protected]. | ||
|
||
## Requirements | ||
|
||
- `php: >=8.1` | ||
- `laravel/nova: ^4.0` | ||
|
||
## Installation | ||
|
||
```bash | ||
composer require outl1ne/nova-openai | ||
|
||
// optional | ||
php artisan vendor:publish --tag=nova-openai-config | ||
``` | ||
|
||
## Usage | ||
|
||
```php | ||
$response = OpenAI::chat()->create( | ||
model: 'gpt-3.5-turbo', | ||
messages: (new Messages)->system('You are a helpful assistant.')->user('Hello!'), | ||
); | ||
|
||
$response = OpenAI::embeddings()->create( | ||
'text-embedding-3-small', | ||
'The food was delicious and the waiter...' | ||
); | ||
``` | ||
|
||
## Contributing | ||
|
||
``` | ||
composer install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters