Skip to content

Commit

Permalink
add openai model setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ogrre committed Sep 27, 2023
1 parent 0889807 commit 6948ff2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions config/chatgpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

return [

'openai' => [

/*
*
*/

'model' => env('OPENAI_MODEL', 'gpt-3.5-turbo')
],

'models' => [

/*
Expand Down
4 changes: 2 additions & 2 deletions src/Models/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function gpt(string $prompt)
$this->newMessage($prompt, "user");

$response = $this->client->chat()->create([
'model' => 'gpt-3.5-turbo',
'model' => config('chatgpt.openai.model'),
'messages' => $this->list_messages(),
]);

Expand All @@ -104,7 +104,7 @@ private function title(string $prompt)
$content = "Résume ce prompt en quelques mots pour en faire un titre: " . $prompt;

$response = $this->client->chat()->create([
'model' => 'gpt-3.5-turbo',
'model' => config('chatgpt.openai.model'),
'messages' => [
['role' => 'user', 'content' => $content],
],
Expand Down

0 comments on commit 6948ff2

Please sign in to comment.