Skip to content

Latest commit

 

History

History
101 lines (69 loc) · 2.53 KB

README.md

File metadata and controls

101 lines (69 loc) · 2.53 KB

Real-Time Voice Inference Web SDK

Docs NPM Version

RTVI Web provides a browser client for real-time voice and video inference.

The entry point for creating a client can be found via:

React context, hooks and components:

Transport packages:

RTVI requires a media transport for sending and receiving audio and video data over the internet. RTVI Web does not include any transport capabilities out of the box, so you will need to install the package for your chosen provider.

Transport packages extend the core VoiceClient class, binding provider-specific functionality to the abstract interface.

Currently available transport packages:

Install

# Install latest package from NPM
npm install realtime-ai realtime-ai-daily
# or 
yarn add realtime-ai realtime-ai-daily

Quickstart

Starter projects:

Creating and starting a session with RTVI Web (using Daily as transport):

import {DailyVoiceClient} from "realtime-ai-daily";

const voiceClient = new DailyVoiceClient({
    baseUrl: "https://..." // POST endpoint to request a new bot
    enableMic: true,
    enableCam: false,
    services: {
        llm: "openai",
        tts: "cartesia"
    },
    config: [
        {
            service: "tts",
            options: [{ name: "voice", value: "79a125e8-cd45-4c13-8a67-188112f4dd22" }],
        },
        {
            service: "llm",
            options: [
                { name: "model", value: "GPT-4o" }
                {
                    name: "initial_messages",
                    value: [{
                        role: "system",
                        content: "You are a assistant called ExampleBot. You can ask me anything. Keep responses brief and legible. Introduce yourself first."
                    }]
                }
            ]
        }
    ]
});

await voiceClient.start();

Documentation

Docs and API reference can be found at https://docs.rtvi.ai

Hack on the framework

Install a provider transport

yarn
yarn workspace realtime-ai build

Watch for file changes:

yarn workspace realtime-ai run dev