Skip to main content

Capability discovery

Endpoints in Delphi are not all the same. One endpoint may be voice-only, another text-only, another a multimodal AI agent with bespoke browser-action flows. The SDK exposes a small API for querying that surface before opening a session.

getCapabilities

const capabilities = await delphi.getCapabilities(endpointId);

console.log(capabilities.sessions.modes);
// → ['text', 'audio_playback', 'voice_conversation']

console.log(capabilities.flows.browserActions);
// → [{ id, slug, label, type, messageType, voiceInvocable }, ...]

hasCapability

Predicate form. Returns boolean.

if (!delphi.hasCapability(capabilities, 'voice_conversation')) {
throw new Error('This endpoint does not support voice calls.');
}

assertCapability

Throws CapabilityNotSupportedError when the capability is missing.

delphi.assertCapability(capabilities, 'audio_playback');
// proceeds, or throws

assertEndpointCapability

Convenience: fetch capabilities and assert in one call.

const caps = await delphi.assertEndpointCapability(endpointId, 'audio_playback');

console.log(caps.flows.browserActions);

Browser-action discovery

capabilities.flows.browserActions enumerates the BOA flows the endpoint exposes. The fields:

FieldMeaning
idStable capability id, suitable for capabilityId on readAloud.
slugURL-friendly identifier.
labelHuman-readable name.
typeCapability type (e.g. read_aloud, transform_and_read, custom).
messageTypeThe exact browser.action.* message the server expects. Used by sendBrowserAction.
voiceInvocableWhether the AI can trigger this BOA mid-call.

For readAloud the SDK picks the right BOA automatically; supply capabilityId or identifier only when an endpoint exposes multiple read-aloud BOAs and you need to disambiguate.

Error type

The thrown error from assertCapability / assertEndpointCapability:

import {CapabilityNotSupportedError} from '@ki-kombinat/delphi-client-js-sdk';

try {
delphi.assertCapability(capabilities, 'voice_conversation');
} catch (err) {
if (err instanceof CapabilityNotSupportedError) {
console.warn(`Endpoint missing capability: ${err.capability}`);
}
}

See Errors for the full list of typed errors the SDK exposes.

Next step

Jump into a read-aloud quick start or a voice call.