Skip to content

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
haythemsellami committed May 4, 2024
1 parent 7af721f commit 12b6a5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,16 @@ import "suave-std/protocols/ChatGPT.sol";
contract Example {
function example() public {
ChatGPT chatgpt = new ChatGPT("apikey");
//retreive the apiKey
bytes memory keyData = Suave.confidentialRetrieve(apiKeyRecord, API_KEY);
string memory apiKey = bytesToString(keyData);
ChatGPT chatgpt = new ChatGPT();
ChatGPT.Message[] memory messages = new ChatGPT.Message[](1);
messages[0] = ChatGPT.Message(ChatGPT.Role.User, "How do I write a Suapp with suave-std?");
chatgpt.complete(messages);
chatgpt.complete(apiKey, messages);
}
}
```
Expand Down

0 comments on commit 12b6a5c

Please sign in to comment.