Skip to content
This repository was archived by the owner on Nov 28, 2023. It is now read-only.

Commit a80dbab

Browse files
committed
Doc update
1 parent f21f4ad commit a80dbab

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ use HaoZiTeam\ChatGPT\V1 as ChatGPTV1;
5959
$chatGPT = new ChatGPTV1();
6060
$chatGPT->addAccount('<your_access_token>');
6161

62-
$answer = $chatGPT->ask('Hello, how are you?');
63-
print_r($answer);
62+
$answers = $chatGPT->ask('Hello, how are you?');
63+
foreach ($answers as $item) {
64+
print_r($item);
65+
}
6466
//Array(
6567
// 'answer' => 'I am fine, thank you.',
6668
// 'conversation_id' => '<uuid>',
@@ -102,8 +104,10 @@ use HaoZiTeam\ChatGPT\V2 as ChatGPTV2;
102104
$chatGPT = new ChatGPTV2('sk-<your_api_key>');
103105
$chatGPT->addMessage('You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible.', 'system');
104106

105-
$answer = $chatGPT->ask('Hello, how are you?');
106-
print_r($answer);
107+
$answers = $chatGPT->ask('Hello, how are you?');
108+
foreach ($answers as $item) {
109+
print_r($item);
110+
}
107111
```
108112

109113
### Advanced example

0 commit comments

Comments
 (0)