@pipecat-ai/daily-transport 0.3.4-rc.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -12
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1524 -4
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +1525 -5
- package/dist/index.module.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,31 +1,96 @@
|
|
|
1
1
|
# Pipecat's Real-Time Voice Inference - Daily Transport
|
|
2
2
|
|
|
3
|
-
[](https://docs.pipecat.ai/client/
|
|
3
|
+
[](https://docs.pipecat.ai/client/js/transports/daily)
|
|
4
4
|

|
|
5
|
+
[](https://github.com/pipecat-ai/pipecat/tree/main/examples/simple-chatbot)
|
|
5
6
|
|
|
6
7
|
Daily transport package for use with `@pipecat-ai/client-js`.
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
+
## Installation
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
```bash copy
|
|
12
|
+
npm install \
|
|
13
|
+
@pipecat-ai/client-js \
|
|
14
|
+
@pipecat-ai/daily-transport
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
The DailyTransport class provides a WebRTC transport layer using [Daily.co's](https://daily.co) infrastructure. It handles audio/video device management, WebRTC connections, and real-time communication between clients and bots.
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- 🎥 Complete camera device management
|
|
24
|
+
- 🎤 Microphone input handling
|
|
25
|
+
- 🔊 Speaker output control
|
|
26
|
+
- 📡 WebRTC connection management
|
|
27
|
+
- 🤖 Bot participant tracking
|
|
28
|
+
- 📊 Audio level monitoring
|
|
29
|
+
- 💬 Real-time messaging
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
### Basic Setup
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
18
36
|
import { RTVIClient } from "@pipecat-ai/client-js";
|
|
19
37
|
import { DailyTransport } from "@pipecat-ai/daily-transport";
|
|
20
38
|
|
|
39
|
+
const transport = new DailyTransport({
|
|
40
|
+
dailyFactoryOptions: {
|
|
41
|
+
// Daily.co specific configuration
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
21
45
|
const rtviClient = new RTVIClient({
|
|
22
|
-
transport
|
|
23
|
-
//
|
|
46
|
+
transport,
|
|
47
|
+
enableCam: false, // Default camera off
|
|
48
|
+
enableMic: true, // Default microphone on
|
|
49
|
+
callbacks: {
|
|
50
|
+
// Event handlers
|
|
51
|
+
},
|
|
52
|
+
params: {
|
|
53
|
+
baseUrl,
|
|
54
|
+
endpoints
|
|
55
|
+
}
|
|
56
|
+
// ...
|
|
24
57
|
});
|
|
25
58
|
|
|
26
59
|
await rtviClient.connect();
|
|
27
60
|
```
|
|
28
61
|
|
|
29
|
-
|
|
62
|
+
## API Reference
|
|
63
|
+
|
|
64
|
+
### Constructor Options
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
interface DailyTransportConstructorOptions {
|
|
68
|
+
dailyFactoryOptions?: DailyFactoryOptions; // Daily.co specific configuration
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### States
|
|
73
|
+
|
|
74
|
+
The transport can be in one of these states:
|
|
75
|
+
- "initializing"
|
|
76
|
+
- "initialized"
|
|
77
|
+
- "connecting"
|
|
78
|
+
- "connected"
|
|
79
|
+
- "ready"
|
|
80
|
+
- "disconnecting"
|
|
81
|
+
- "error"
|
|
82
|
+
|
|
83
|
+
## Events
|
|
84
|
+
|
|
85
|
+
The transport implements the various [RTVI event handlers](https://docs.pipecat.ai/client/js/api-reference/callbacks). Check out the docs or samples for more info.
|
|
86
|
+
|
|
87
|
+
## Error Handling
|
|
88
|
+
|
|
89
|
+
The transport includes error handling for:
|
|
90
|
+
- Connection failures
|
|
91
|
+
- Device errors
|
|
92
|
+
- Authentication issues
|
|
93
|
+
- Message transmission problems
|
|
30
94
|
|
|
31
|
-
|
|
95
|
+
## License
|
|
96
|
+
BSD-2 Clause
|
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,17 @@ export interface DailyTransportAuthBundle {
|
|
|
5
5
|
token: string;
|
|
6
6
|
}
|
|
7
7
|
export interface DailyTransportConstructorOptions {
|
|
8
|
+
bufferLocalAudioUntilBotReady?: boolean;
|
|
8
9
|
dailyFactoryOptions?: DailyFactoryOptions;
|
|
9
10
|
}
|
|
11
|
+
export enum DailyRTVIMessageType {
|
|
12
|
+
AUDIO_BUFFERING_STARTED = "audio-buffering-started",
|
|
13
|
+
AUDIO_BUFFERING_STOPPED = "audio-buffering-stopped"
|
|
14
|
+
}
|
|
10
15
|
export class DailyTransport extends Transport {
|
|
11
|
-
constructor({ dailyFactoryOptions, }?: DailyTransportConstructorOptions);
|
|
16
|
+
constructor({ dailyFactoryOptions, bufferLocalAudioUntilBotReady, }?: DailyTransportConstructorOptions);
|
|
17
|
+
handleUserAudioStream(data: ArrayBuffer): void;
|
|
18
|
+
_sendAudioBatch(dataBatch: ArrayBuffer[]): void;
|
|
12
19
|
initialize(options: RTVIClientOptions, messageHandler: (ev: RTVIMessage) => void): void;
|
|
13
20
|
get state(): TransportState;
|
|
14
21
|
private set state(value);
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;
|
|
1
|
+
{"mappings":";;AS4BA;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;IACE,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C;AAED;IACE,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;CACpD;AAED,2BAA4B,SAAQ,SAAS;gBAe/B,EACV,mBAAwB,EACxB,6BAAqC,GACtC,GAAE,gCAAqC;IAYxC,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IA2B9C,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI;IAoBxC,UAAU,CACf,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,IAAI,GACxC,IAAI;IA6BP,IAAI,KAAK,IAAI,cAAc,CAE1B;IAED,OAAO,KAAK,KAAK,QAKhB;IAEK,UAAU;IAKhB,SAAS,CAAC,KAAK,EAAE,MAAM;IAUvB,IAAI,WAAW,4CAEd;IAEK,UAAU;IAKhB,SAAS,CAAC,KAAK,EAAE,MAAM;IAUvB,IAAI,WAAW,4CAEd;IAEK,cAAc;IAKpB,aAAa,CAAC,SAAS,EAAE,MAAM;IAQ/B,IAAI,eAAe,4CAElB;IAED,SAAS,CAAC,MAAM,EAAE,OAAO;IAIzB,IAAI,YAAY,YAEf;IAED,SAAS,CAAC,MAAM,EAAE,OAAO;IAIzB,IAAI,YAAY,YAEf;IAEM,iBAAiB,CAAC,MAAM,EAAE,OAAO;IAQxC,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,MAAM;IA0CA,WAAW;IA+BX,OAAO,CACX,UAAU,EAAE,wBAAwB,EACpC,eAAe,EAAE,eAAe;IAgC5B,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAwDjC,UAAU;IAYT,WAAW,CAAC,OAAO,EAAE,WAAW;CA0KxC","sources":["transports/lib/wavtools/lib/wav_packer.js","transports/lib/wavtools/lib/analysis/constants.js","transports/lib/wavtools/lib/analysis/audio_analysis.js","transports/lib/wavtools/lib/worklets/stream_processor.js","transports/lib/wavtools/lib/wav_stream_player.js","transports/lib/wavtools/lib/worklets/audio_processor.js","transports/lib/wavtools/lib/wav_recorder.js","transports/lib/wavtools/lib/mediastream_recorder.js","transports/lib/wavtools/index.js","transports/daily/src/src/transport.ts","transports/daily/src/src/index.ts","transports/daily/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,"export * from \"./transport\";\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|