0.4.0 • Published 5 months ago

@pipecat-ai/small-webrtc-transport v0.4.0

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
5 months ago

Pipecat's Real-Time Voice Inference - Small WebRTC Transport

Docs NPM Version Demo

Small WebRTC transport package for use with @pipecat-ai/client-js.

Installation

npm install \
@pipecat-ai/client-js \
@pipecat-ai/small-webrtc-transport

Overview

The SmallWebRTCTransport class provides a WebRTC transport layer establishing a PeerConnection with Pipecat SmallWebRTCTransport. It handles audio/video device management, WebRTC connections, and real-time communication between client and bot.

Features

  • 🎥 Complete camera device management
  • 🎤 Microphone input handling
  • 📡 WebRTC connection management
  • 🤖 Bot participant tracking
  • 💬 Real-time messaging

Usage

Basic Setup

import { RTVIClient } from "@pipecat-ai/client-js";
import { SmallWebRTCTransport } from "@pipecat-ai/small-webrtc-transport";

const transport = new SmallWebRTCTransport();

const rtviClient = new RTVIClient({
    transport,
    enableCam: false,  // Default camera off
    enableMic: true,   // Default microphone on
    callbacks: {
      // Event handlers
    },
    params: {
      baseUrl,
      endpoints
    }
    // ...
});

await rtviClient.connect();

API Reference

States

The transport can be in one of these states:

  • "initializing"
  • "initialized"
  • "connecting"
  • "connected"
  • "ready"
  • "disconnecting"
  • "error"

Events

The transport implements the various RTVI event handlers. Check out the docs or samples for more info.

Error Handling

The transport includes error handling for:

  • Connection failures
  • Device errors

License

BSD-2 Clause

0.4.0

5 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

8 months ago