Prompt Guard | Node.js SDK
Prompt Guard
constructor(token: string, config: PangeaConfig): PromptGuardServiceCreates a new PromptGuardService
with the given Pangea API token and
configuration.
const config = new PangeaConfig({ domain: "pangea_domain" });
const promptGuard = new PromptGuardService("pangea_token", config);
Guard (Beta)
guard(request: GuardRequest): Promise<PangeaResponse<GuardResult>>Undocumented.
const response = await promptGuard.guard({
messages: [{"role": "user", "content": "text"}]
});