rampart / examples /basic-chat.ts
suryatmodulus's picture
Duplicate from nationaldesignstudio/rampart
8654436
Raw
History Blame Contribute Delete
325 Bytes
import { createGuard } from "../index.ts";
const guard = await createGuard();
const safe = await guard.protect("My name is Alex Rivera. My SSN is 472-81-0094.");
const reply = await llm(safe.text);
console.log(guard.reveal(reply));
async function llm(text: string): Promise<string> {
return "Got it, [GIVEN_NAME_1].";
}