Core
OrgaAI static class for SDK initialization and configuration
OrgaAI
Import
import { OrgaAI } from '@orga-ai/react';
Props
|
Option |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
|
|
No |
|
Enables or disables transcription of conversation items, which are returned to the client via |
|
|
|
No |
|
Logging verbosity. |
|
|
|
No |
|
Array of allowed interaction modalities ("audio", "video") for the session. Controls availability of audio and video streams in |
|
|
|
No |
|
Timeout for requests, in milliseconds. |
|
|
|
Yes* |
- |
URL to your backend endpoint for fetching ephemeral tokens and ICE servers. |
|
|
|
Yes* |
- |
Custom function to fetch ephemeral token and ICE servers. |
|
|
|
No |
|
Model to use (see Types for available models). |
|
|
|
No |
|
Voice to use (see Types for available voices). |
|
|
|
No |
|
Sampling temperature (randomness). Must be between allowed min/max. |
|
|
|
No |
- |
Maximum tokens for responses. Must be between 100 and 1000. |
|
|
|
No |
- |
Custom instructions to modify OrgaAI’s behavior, such as response tone or context. Example: 'Respond in a friendly tone.' |
|
|
|
No |
|
Either sessionConfigEndpoint or fetchSessionConfig is required
Usage
import { OrgaAI } from '@orga-ai/react';
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'],
instructions: 'Respond in a friendly tone.',
logLevel: 'debug',
});