Shield Wrappers
Reference for TypeScript Shield wrappers, including prompt, tool, tool response, model response, and generic wrap patterns.
import { Highflame, Shield } from "@highflame/sdk";
const client = new Highflame({ apiKey: "hf_sk_..." });
const shield = new Shield(client);shield.prompt(fn, options?)
shield.prompt(fn, options?)const chat = shield.prompt(async (message: string) => llm.complete(message));
const guardedChat = shield.prompt(
async (context: string, userMessage: string) => llm.complete(context, userMessage),
{ contentArg: 1 },
);
const monitoredChat = shield.prompt(async (msg: string) => llm.complete(msg), {
mode: "monitor",
sessionId: "sess_user_abc",
});Option
Type
Default
Description
shield.tool(fn, options?)
shield.tool(fn, options?)Option
Type
Default
Description
shield.toolResponse(fn, options?)
shield.toolResponse(fn, options?)Option
Type
Default
Description
shield.modelResponse(fn, options?)
shield.modelResponse(fn, options?)Option
Type
Default
Description
shield.wrap(options)
shield.wrap(options)Option
Type
Default
Description
Related Topics
Last updated