Skip to Content
🚀 Orga AI is in open beta.

Types & Constants

Import these from @orga-ai/core/types (or via the package root). They power adapters and shared business logic.

Configuration

OrgaAIConfig

interface OrgaAIConfig { logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'disabled'; timeout?: number; sessionConfigEndpoint?: string; fetchSessionConfig?: () => Promise<SessionConfigResponse>; model?: OrgaAIModel; voice?: OrgaAIVoice; temperature?: number; enableTranscriptions?: boolean; instructions?: string; modalities?: Modality[]; history?: boolean; }

SessionConfig

Overrides passed when starting a session (used by adapters).

interface SessionConfig { enableTranscriptions?: boolean; videoQuality?: 'low' | 'medium' | 'high'; facingMode?: 'user' | 'environment'; voice?: OrgaAIVoice; model?: OrgaAIModel; temperature?: number; instructions?: string; modalities?: Modality[]; onSessionStart?: () => void; onSessionEnd?: () => void; onSessionConnected?: () => void; onConnectionStateChange?: (state: ConnectionState) => void; onConversationMessageCreated?: (item: ConversationItem) => void; onSessionCreated?: (event: SessionCreatedEvent) => void; onConversationCreated?: (event: ConversationCreatedEvent) => void; }

Constants & Enums

ConstantDescription
ORGAAI_MODELSTuple of supported model identifiers.
ORGAAI_VOICESTuple of available voice IDs.
ORGAAI_TEMPERATURE_RANGE{ min: 0, max: 1 } clamp for temperature.
MODALITIES_ENUM{ AUDIO, VIDEO } enum-like map.
DataChannelEventTypesEnum of realtime event topic strings.
VIDEO_QUALITY_CONSTRAINTSMap of media constraint presets.

WebRTC Types

  • ConnectionState — union of WebRTC connection states.
  • RTCIceServer — STUN/TURN configuration object.
  • RTCIceCandidateInit — candidate payload shape.
  • MediaConstraints — typed output of getMediaConstraints.

Events

  • DataChannelEvent — generic container for messages on Orga’s data channel.
  • SessionCreatedEvent — emitted when Orga provisions a session.
  • ConversationCreatedEvent — emitted when a new conversation is created.
  • ConversationItem — structured chat transcript entries.

Hook / Adapter Types

OrgaAIHookCallbacks defines callback signatures that adapters (React, Vue, etc.) can reuse to stay consistent.

Session Exchange Types

  • SessionConfigResponse — output of fetchSessionConfig ({ ephemeralToken, iceServers }).
  • RealtimeConnectionRequest — body posted to /v1/realtime/calls.
  • RealtimeConnectionResponse — { conversation_id, answer } returned by Orga.
Last updated on