We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 93fbee8 commit d27082cCopy full SHA for d27082c
README.md
@@ -43,12 +43,14 @@ Finally, you may use the `OpenAI` facade to access the OpenAI API:
43
```php
44
use OpenAI\Laravel\Facades\OpenAI;
45
46
-$result = OpenAI::completions()->create([
+$result = OpenAI::chat()->create([
47
'model' => 'gpt-3.5-turbo-instruct',
48
- 'prompt' => 'PHP is',
+ 'messages' => [
49
+ ['role' => 'user', 'content' => 'Hello!'],
50
+ ],
51
]);
52
-echo $result['choices'][0]['text']; // an open-source, widely-used, server-side scripting language.
53
+echo $result->choices[0]->message->content; // Hello! How can I assist you today?
54
```
55
56
## Configuration
0 commit comments