Skip to content

Commit 2df61fe

Browse files
committed
return prompt
1 parent 8f787d3 commit 2df61fe

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mastashake08/laravel-openai-api",
33
"description": "Add an OpenAI API and Artisan command easily into your projects. Generate images, or text. Can be integrated with Laravel Sanctum for token based access.",
4-
"version": "1.7.9",
4+
"version": "1.8.0",
55
"keywords": [
66
"mastashake08",
77
"laravel",

src/LaravelOpenaiApi.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
namespace Mastashake\LaravelOpenaiApi;
44

55
use OpenAI\Laravel\Facades\OpenAI;
6+
use OpenAI\Responses\Chat\CreateResponse;
67
use Mastashake\LaravelOpenaiApi\Models\Prompt;
78

89
class LaravelOpenaiApi
910
{
1011
function generateChat(array $data): Prompt {
1112
$result = OpenAI::chat()->create($data);
12-
return $result;
13+
return $this->savePrompt($result, $data);
1314
}
1415

1516
function generateResult(string $type, array $data): Prompt {

0 commit comments

Comments
 (0)