Skip to content

Commit 6948ff2

Browse files
committed
add openai model setting
1 parent 0889807 commit 6948ff2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

config/chatgpt.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
return [
44

5+
'openai' => [
6+
7+
/*
8+
*
9+
*/
10+
11+
'model' => env('OPENAI_MODEL', 'gpt-3.5-turbo')
12+
],
13+
514
'models' => [
615

716
/*

src/Models/Chat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function gpt(string $prompt)
8484
$this->newMessage($prompt, "user");
8585

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

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

106106
$response = $this->client->chat()->create([
107-
'model' => 'gpt-3.5-turbo',
107+
'model' => config('chatgpt.openai.model'),
108108
'messages' => [
109109
['role' => 'user', 'content' => $content],
110110
],

0 commit comments

Comments
 (0)