Core

OrgaAI static class for SDK initialization and configuration

OrgaAI

Import

import { OrgaAI } from '@orga-ai/sdk-react-native';

Props

Option

Type

Required

Default

Description

enableTranscriptions

boolean

No

false

Enables or disables transcription of conversation items, which are returned to the client via useOrgaAI hook.

logLevel

"debug" | "info" | "warn" | "error" | "none"

No

”none”

Logging verbosity.

modalities

Modality[]

No

[“audio”]

Array of allowed interaction modalities ("audio", "video") for the session. Controls availability of audio and video streams in useOrgaAI

timeout

number

No

30000

Timeout for requests, in milliseconds.

sessionConfigEndpoint

string

Yes*

-

URL to your backend endpoint for fetching ephemeral tokens and ICE servers.

fetchSessionConfig

() => Promise<{ ephemeralToken: string; iceServers: RTCIceServer[] }>

Yes*

-

Custom function to fetch ephemeral token and ICE servers.

model

OrgaAIModel

No

orga-1-beta

Model to use (see Types for available models).

voice

OrgaAIVoice

No

alloy

Voice to use (see Types for available voices).

temperature

number

No

0.5

Sampling temperature (randomness). Must be between allowed min/max.

maxTokens

number

No

-

Maximum tokens for responses. Must be between 100 and 1000.

instructions

string

No

-

Custom instructions to modify OrgaAI’s behavior, such as response tone or context. Example: 'Respond in a friendly tone.'

history

boolean

No

true

Either sessionConfigEndpoint or fetchSessionConfig is required

Usage

import { OrgaAI } from '@orga-ai/sdk-react-native';

OrgaAI.init({
  fetchSessionConfig: async () => {
    const response = await fetch('https://your-backend.com/api/orga-client-secrets');
    const { ephemeralToken, iceServers } = await response.json();
    return { ephemeralToken, iceServers };
  },
  model: 'orga-1-beta',
  voice: 'alloy',
  temperature: 0.7,
  enableTranscriptions: true,
  modalities: ['audio', 'video'],
  history: true,
  instructions: 'Respond in a friendly tone.',
  logLevel: 'debug',
});