Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

GuardrailCodeCallback

import type { GuardrailCodeCallback } from "https://googleapis.deno.dev/v1/ces:v1.ts";

Guardrail that blocks the conversation based on the code callbacks provided.

interface GuardrailCodeCallback {
afterAgentCallback?: Callback;
afterModelCallback?: Callback;
beforeAgentCallback?: Callback;
beforeModelCallback?: Callback;
}

§Properties

§
afterAgentCallback?: Callback
[src]

Optional. The callback to execute after the agent is called. Each callback function is expected to return a structure (e.g., a dict or object) containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - 'reason': A string explaining the decision. A 'TRIGGER' decision may halt further processing.

§
afterModelCallback?: Callback
[src]

Optional. The callback to execute after the model is called. If there are multiple calls to the model, the callback will be executed multiple times. Each callback function is expected to return a structure (e.g., a dict or object) containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - 'reason': A string explaining the decision. A 'TRIGGER' decision may halt further processing.

§
beforeAgentCallback?: Callback
[src]

Optional. The callback to execute before the agent is called. Each callback function is expected to return a structure (e.g., a dict or object) containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - 'reason': A string explaining the decision. A 'TRIGGER' decision may halt further processing.

§
beforeModelCallback?: Callback
[src]

Optional. The callback to execute before the model is called. If there are multiple calls to the model, the callback will be executed multiple times. Each callback function is expected to return a structure (e.g., a dict or object) containing at least: - 'decision': Either 'OK' or 'TRIGGER'. - 'reason': A string explaining the decision. A 'TRIGGER' decision may halt further processing.