Skip to content
Merged
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
2 changes: 1 addition & 1 deletion rtvi-client-js/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export abstract class Client extends (EventEmitter as new () => TypedEmitter<Voi
{
useDeepMerge = false,
sendPartial = false,
}: { useDeepMerge?: boolean; sendPartial?: boolean }
}: { useDeepMerge?: boolean; sendPartial?: boolean } = {}
) {
// @TODO refactor this method to use a reducer
if (useDeepMerge) {
Expand Down
8 changes: 4 additions & 4 deletions rtvi-client-js/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type Transcript = {

export class VoiceMessage {
id: string;
label: string = "rtvi";
label: string = "rtvi-ai";
type: string;
data: unknown;

Expand Down Expand Up @@ -86,9 +86,9 @@ export class VoiceMessage {
// TTS
static speak(message: string, interrupt: boolean): VoiceMessage {
// Sent when prompting the STT model to speak
return new VoiceMessage(VoiceMessageType.SPEAK, {
tts: { text: message, interrupt },
});
return new VoiceMessage(VoiceMessageType.SPEAK,
{ text: message, interrupt },
);
}

static interrupt(): VoiceMessage {
Expand Down
4 changes: 2 additions & 2 deletions rtvi-client-js/src/transport/daily.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ export class DailyTransport extends Transport {

private handleAppMessage(ev: DailyEventObjectAppMessage) {
// Bubble any messages with realtime-ai label
if (ev.data.label === "rtvi") {
if (ev.data.label === "rtvi-ai") {
this._onMessage({
type: ev.data.type,
data: ev.data,
} as VoiceMessage);
} else if (ev.data.type === "pipecat-metrics") {
// Bubble up pipecat metrics, which don't have the "rtvi" label
// Bubble up pipecat metrics, which don't have the "rtvi-ai" label
const vmm = new VoiceMessageMetrics(ev.data.metrics as PipecatMetrics);
this._onMessage(vmm);
}
Expand Down