Capability discovery
This page preserves the previous SDK documentation and its existing URL. The generated API reference was produced from SDK 0.1.5, source commit 4db9fbe925bf07a4b95e936a5bb172d6ab5820bb. Handbook behavior and compatibility claims below are historical descriptions, not a newly verified support guarantee. For the reviewed version-specific reference, see the SDK 0.1.5 overview.
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.interactionModes);
// → { text: true, audio_playback: true, voice_conversation: true, … }
console.log(capabilities.flows.entryPoints);
// → ['web_chat', 'web_voice', 'phone']
console.log(capabilities.runtime.migration);
// → ['text_to_voice', 'voice_to_text', 'api_to_media'] when both web entry points exist
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);
Session migration
capabilities.runtime.migration lists which live handoffs TelAPI supports for this endpoint:
| Value | Meaning |
|---|---|
text_to_voice | Active text session can upgrade to WebRTC voice on the same sessionId. |
voice_to_text | Active voice_conversation can downgrade back to text. |
api_to_media | Other API-initiated media transitions (platform-internal). |
Both text_to_voice and voice_to_text appear only when the flow defines web_chat and web_voice entry points. Gate “Upgrade to voice” / “Switch to text chat” buttons on these flags — see Text chat quick start.
Browser-action discovery
capabilities.flows.browserActions enumerates the BOA flows the endpoint exposes. The fields:
| Field | Meaning |
|---|---|
id | Stable capability id, suitable for capabilityId on readAloud. |
slug | URL-friendly identifier. |
label | Human-readable name. |
type | Capability type (e.g. read_aloud, transform_and_read, custom). |
messageType | The exact browser.action.* message the server expects. Used by sendBrowserAction. |
voiceInvocable | Whether 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 text chat, read-aloud quick start, or a voice call.