
Loading...

Loading...
Capability ยท Chat
A conversation keeps history client-side and runs one encrypted inference per turn (one on-chain job each), signed and paid by your own connected wallet.
Real LCAI per turn. History is replayed each turn so the model keeps context; your wallet signs createSession + submitJob each time.
import { Conversation } from "lightnode-sdk";
const chat = new Conversation({
network: "mainnet",
privateKey: process.env.PRIVATE_KEY,
system: "You are a concise assistant.",
});
const a = await chat.send("What is LightChain AI?");
const b = await chat.send("And how do workers earn?"); // remembers context
console.log(a.answer, b.answer);Drop a chat UI into your project with npx lightnode add chat.