-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*⚠️ Fix eslint warnings *⚠️ Pass target & cmd eslint * ✨ Add generate chains * 🔖 Change to 0.1.73
- Loading branch information
Showing
3 changed files
with
22 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,11 @@ | ||
import { Chat } from "../lib/index"; | ||
import { generate } from "../lib/index"; | ||
|
||
async function main() { | ||
const chat = new Chat({}); | ||
const answer = await generate("Who was Neil Armstrong ?") | ||
.generate("Who was the US president at the time ?") | ||
.generate("Who was his wife ?"); | ||
|
||
console.log(await chat.chatId); | ||
|
||
console.log(await chat.getMessages()); | ||
|
||
let prompt = "Who is the first person to have walked on the moon?"; | ||
console.log(prompt); | ||
|
||
let result = await chat.sendMessage(prompt); | ||
console.log(result); | ||
|
||
prompt = "Who is the second ?"; | ||
console.log(prompt); | ||
|
||
result = await chat.sendMessage(prompt); | ||
console.log(result); | ||
|
||
prompt = "Who was the president of the United States at the time?"; | ||
console.log(prompt); | ||
|
||
result = await chat.sendMessage(prompt); | ||
console.log(result); | ||
|
||
console.log(await chat.getMessages()); | ||
console.log(answer); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters