Skip to main content

Prompt Guard | Node.js SDK

Prompt Guard

constructor(token: string, config: PangeaConfig): PromptGuardService

Creates a new PromptGuardService with the given Pangea API token and configuration.

required parameters

string

Pangea API token.

Configuration.

Response Object

PromptGuardService
const config = new PangeaConfig({ domain: "pangea_domain" });
const promptGuard = new PromptGuardService("pangea_token", config);

Guard (Beta)

guard(request: GuardRequest): Promise<PangeaResponse<GuardResult>>

Undocumented.

required parameters

GuardRequest

Request parameters.

Response Object

Promise<PangeaResponse<GuardResult>>
const response = await promptGuard.guard({
  messages: [{"role": "user", "content": "text"}]
});

Interface GuardRequest

GuardRequest

required parameters

Interface GuardResult

GuardResult

required parameters

boolean

optional parameters

string
string

Interface Message

Message

required parameters

string
string