Skip to content

Commit

Permalink
Checking in
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancde committed May 28, 2024
1 parent fa10325 commit e1bb6e7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion vapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ export interface ControlMessages {
control: 'mute-assistant' | 'unmute-assistant';
}

type VapiClientToServerMessage = AddMessageMessage | ControlMessages;
export interface SayMessage {
type: 'say';
message: string;
endCallAfterSpoken?: boolean;
}

type VapiClientToServerMessage = AddMessageMessage | ControlMessages | SayMessage;

type VapiEventNames =
| 'call-end'
Expand Down Expand Up @@ -275,4 +281,12 @@ export default class Vapi extends VapiEventEmitter {
throw error;
}
}

public say(message: string, endCallAfterSpoken?: boolean) {
this.send({
type:'say',
message,
endCallAfterSpoken
})
}
}

0 comments on commit e1bb6e7

Please sign in to comment.