@ag076810/ai
Version:
Effortlessly integrate AI text and image models in your node applications
16 lines (13 loc) • 487 B
JavaScript
const AI = require("../src/index.js");
(async function () {
const llm = new AI([
{ role: "user", content: "remember the secret codeword is blue" },
{ role: "user", content: "what is the secret codeword I just told you?" },
]);
let content;
content = await llm.send();
console.log(content); // blue
llm.user("now the codeword is red");
content = await llm.chat("what is the codeword I just told you?");
console.log(content); // red
})();