Skip to navigation

SemanticGate constants

View as MarkdownOpen in Claude

The SDK checks semantic gates against the platform’s limits when a tool is defined and throws for anything the platform would refuse. These exports hold those limits.

import {
MAX_GATES,
MAX_QUESTION_BYTES,
MAX_CRITERIA_BYTES,
MAX_ON_FAIL_BYTES,
MAX_VISUAL_INPUT,
RESERVED_FUNCTION_NAMES,
} from '@signalwire/sdk';

Properties

MAX_GATES
number

8. The most gates one function can carry.

MAX_QUESTION_BYTES
number

8192. The longest gate question, in UTF-8 bytes.

MAX_CRITERIA_BYTES
number

2048. The longest criteria.true or criteria.false (trueMeans or falseMeans), in UTF-8 bytes.

MAX_ON_FAIL_BYTES
number

8192. The largest on_fail output, measured as compact JSON in UTF-8 bytes.

MAX_VISUAL_INPUT
number

5. The most caller video frames a gate may ask for with visualInput.

RESERVED_FUNCTION_NAMES
ReadonlySet<string>

Hook and built-in function names that can’t carry gates: startup_hook, hangup_hook, check_for_input, end_call, hangup, check_time, wait_for_user, wait_seconds, adjust_response_latency, next_step, change_context, gather_submit, get_visual_input, get_ideal_strategy, and pause_conversation.

Examples

import { MAX_GATES, RESERVED_FUNCTION_NAMES } from '@signalwire/sdk';
console.log(MAX_GATES); // 8
console.log(RESERVED_FUNCTION_NAMES.has('end_call')); // true