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

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Mar 31, 2023
1 parent f21f4ad commit a80dbab
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ use HaoZiTeam\ChatGPT\V1 as ChatGPTV1;
$chatGPT = new ChatGPTV1();
$chatGPT->addAccount('<your_access_token>');

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

$answer = $chatGPT->ask('Hello, how are you?');
print_r($answer);
$answers = $chatGPT->ask('Hello, how are you?');
foreach ($answers as $item) {
print_r($item);
}
```

### Advanced example
Expand Down

0 comments on commit a80dbab

Please sign in to comment.