Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/docs/components/PipecatAppBase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ export default function Home() {
},
transportOptions: {
description:
"Optional configuration options for the transport (SmallWebRTC, Daily, WebSocket, or MoQ specific)",
type: "SmallWebRTCTransportConstructorOptions | DailyTransportConstructorOptions | WebSocketTransportConstructorOptions | MoqTransportOptions",
"Optional configuration options for the transport (SmallWebRTC, Daily, WebSocket, LiveKit, or MoQ specific)",
type: "SmallWebRTCTransportConstructorOptions | DailyTransportConstructorOptions | WebSocketTransportConstructorOptions | LiveKitTransportConstructorOptions |MoqTransportOptions",
required: false,
},
clientOptions: {
Expand Down
18 changes: 12 additions & 6 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@pipecat-ai/client-js": ">=1.13.0",
"@pipecat-ai/client-react": ">=1.8.0",
"@pipecat-ai/daily-transport": ">=1.6.0",
"@pipecat-ai/livekit-transport": ">=1.0.0",
"@pipecat-ai/moq-transport": "^0.1.0",
"@pipecat-ai/small-webrtc-transport": ">=1.9.0",
"@pipecat-ai/websocket-transport": ">=1.6.2",
Expand All @@ -73,6 +74,10 @@
"optional": true,
"version": "^1.6.0"
},
"@pipecat-ai/livekit-transport": {
"optional": true,
"version": "^1.0.0"
},
"@pipecat-ai/moq-transport": {
"optional": true,
"version": "^0.1.0"
Expand Down Expand Up @@ -126,12 +131,13 @@
"@daily-co/daily-js": "^0.85.0",
"@eslint/js": "^9.36.0",
"@ladle/react": "^5.0.3",
"@pipecat-ai/client-js": "^1.13.0",
"@pipecat-ai/client-react": "^1.8.0",
"@pipecat-ai/daily-transport": "^1.6.0",
"@pipecat-ai/moq-transport": "^0.1.0",
"@pipecat-ai/small-webrtc-transport": "^1.9.0",
"@pipecat-ai/websocket-transport": "^1.6.2",
"@pipecat-ai/client-js": "link:../../client/client-js",
"@pipecat-ai/client-react": "link:../../client/client-react",
"@pipecat-ai/daily-transport": "link:../../transports/transports/daily",
"@pipecat-ai/livekit-transport": "link:../../transports/transports/livekit-transport",
"@pipecat-ai/moq-transport": "link:../../transports/transports/moq-transport",
"@pipecat-ai/small-webrtc-transport": "link:../../transports/transports/small-webrtc-transport",
"@pipecat-ai/websocket-transport": "link:../../transports/transports/websocket-transport",
"@tailwindcss/vite": "^4.1.13",
"@types/node": "^22.18.8",
"@types/react": "^19.1.16",
Expand Down
7 changes: 5 additions & 2 deletions package/src/components/PipecatAppBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from "@pipecat-ai/client-js";
import { PipecatClientProvider } from "@pipecat-ai/client-react";
import type { DailyTransportConstructorOptions } from "@pipecat-ai/daily-transport";
import type { LiveKitTransportConstructorOptions } from "@pipecat-ai/livekit-transport";
import type {
SmallWebRTCTransport,
SmallWebRTCTransportConstructorOptions,
Expand All @@ -35,12 +36,13 @@ export interface PipecatBaseProps {
response: TransportConnectionParams,
) => TransportConnectionParams | Promise<TransportConnectionParams>;
/** Type of transport to use for the connection */
transportType: "smallwebrtc" | "daily" | "websocket" | "moq";
transportType: "smallwebrtc" | "daily" | "websocket" | "livekit" | "moq";
/** Options for configuring the transport. */
transportOptions?:
| SmallWebRTCTransportConstructorOptions
| DailyTransportConstructorOptions
| WebSocketTransportConstructorOptions
| LiveKitTransportConstructorOptions
| MoqTransportOptions;
/** Optional configuration options for the Pipecat client */
clientOptions?: Partial<PipecatClientOptions>;
Expand All @@ -66,7 +68,8 @@ export interface PipecatBaseProps {
* @returns React.ReactNode
*/
children:
((props: PipecatBaseChildProps) => React.ReactNode) | React.ReactNode;
| ((props: PipecatBaseChildProps) => React.ReactNode)
| React.ReactNode;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions package/src/components/elements/SessionInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export const SessionInfo: React.FC<Props> = ({
transportTypeName = `Daily (v${Daily.version()})`;
} else if (transportServiceName === "small-webrtc-transport") {
transportTypeName = "Small WebRTC";
} else if (transportServiceName === "livekit-transport") {
transportTypeName = "LiveKit";
} else if (transportServiceName === "moq-transport") {
transportTypeName = "MoQ";
}
Expand Down
36 changes: 33 additions & 3 deletions package/src/lib/transports.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import type { Transport } from "@pipecat-ai/client-js";

export type TransportType = "daily" | "smallwebrtc" | "websocket" | "moq";
export type TransportType =
| "daily"
| "smallwebrtc"
| "websocket"
| "livekit"
| "moq";

// Use the actual types from the packages without importing them at build time
export type DailyTransportOptions = ConstructorParameters<
Expand All @@ -12,6 +17,9 @@ export type SmallWebRTCTransportOptions = ConstructorParameters<
export type WebSocketTransportOptions = ConstructorParameters<
typeof import("@pipecat-ai/websocket-transport").WebSocketTransport
>[0];
export type LiveKitTransportOptions = ConstructorParameters<
typeof import("@pipecat-ai/livekit-transport").LiveKitTransport
>[0];
export type MoqTransportOptions = ConstructorParameters<
typeof import("@pipecat-ai/moq-transport").MoqTransport
>[0];
Expand All @@ -20,6 +28,7 @@ export interface TransportModule {
DailyTransport: typeof import("@pipecat-ai/daily-transport").DailyTransport;
SmallWebRTCTransport: typeof import("@pipecat-ai/small-webrtc-transport").SmallWebRTCTransport;
WebSocketTransport: typeof import("@pipecat-ai/websocket-transport").WebSocketTransport;
LiveKitTransport: typeof import("@pipecat-ai/livekit-transport").LiveKitTransport;
MoqTransport: typeof import("@pipecat-ai/moq-transport").MoqTransport;
}

Expand All @@ -46,6 +55,12 @@ export async function loadTransport(transportType: TransportType) {
);
return { WebSocketTransport };
}
case "livekit": {
const { LiveKitTransport } = await import(
"@pipecat-ai/livekit-transport"
);
return { LiveKitTransport };
}
case "moq": {
const { MoqTransport } = await import("@pipecat-ai/moq-transport");
return { MoqTransport };
Expand All @@ -63,7 +78,9 @@ export async function loadTransport(transportType: TransportType) {
? "npm install @pipecat-ai/small-webrtc-transport"
: transportType === "websocket"
? "npm install @pipecat-ai/websocket-transport"
: "npm install @pipecat-ai/moq-transport";
: transportType === "livekit"
? "npm install @pipecat-ai/livekit-transport"
: "npm install @pipecat-ai/moq-transport";
throw new Error(
`Failed to load transport "${transportType}". Make sure the package is installed: ${installHint}. Original error: ${errorMessage}`,
);
Expand All @@ -73,7 +90,7 @@ export async function loadTransport(transportType: TransportType) {
/**
* Creates a transport instance based on the transport type.
*
* @param transportType - The type of transport to create ("daily", "smallwebrtc", "websocket", or "moq")
* @param transportType - The type of transport to create ("daily", "smallwebrtc", "websocket", "livekit",or "moq")
* @param options - Transport-specific options
*
*/
Expand All @@ -89,6 +106,10 @@ export async function createTransport(
transportType: "websocket",
options?: WebSocketTransportOptions,
): Promise<Transport>;
export async function createTransport(
transportType: "livekit",
options?: LiveKitTransportOptions,
): Promise<Transport>;
export async function createTransport(
transportType: "moq",
options?: MoqTransportOptions,
Expand All @@ -99,6 +120,7 @@ export async function createTransport(
| DailyTransportOptions
| SmallWebRTCTransportOptions
| WebSocketTransportOptions
| LiveKitTransportOptions
| MoqTransportOptions,
): Promise<Transport>;
export async function createTransport(
Expand All @@ -107,6 +129,7 @@ export async function createTransport(
| DailyTransportOptions
| SmallWebRTCTransportOptions
| WebSocketTransportOptions
| LiveKitTransportOptions
| MoqTransportOptions,
): Promise<Transport> {
const transportModule = await loadTransport(transportType);
Expand All @@ -133,6 +156,13 @@ export async function createTransport(
}
return new WebSocketTransport(options as WebSocketTransportOptions);
}
case "livekit": {
const { LiveKitTransport } = transportModule;
if (!LiveKitTransport) {
throw new Error("LiveKitTransport not found in loaded module");
}
return new LiveKitTransport(options as LiveKitTransportOptions);
}
case "moq": {
const { MoqTransport } = transportModule;
if (!MoqTransport) {
Expand Down
Loading
Loading