Skip to content

Commit

Permalink
expose daily avoideval config
Browse files Browse the repository at this point in the history
  • Loading branch information
kaustubhkagrawal committed Jul 10, 2024
1 parent f2fafe9 commit 2dcea88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vapi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Call, CreateAssistantDTO, CreateSquadDTO, AssistantOverrides } from './api';
import DailyIframe, {
DailyAdvancedConfig,
DailyCall,
DailyEventObjectAppMessage,
DailyEventObjectParticipant,
Expand Down Expand Up @@ -108,11 +109,13 @@ export default class Vapi extends VapiEventEmitter {
private started: boolean = false;
private call: DailyCall | null = null;
private speakingTimeout: NodeJS.Timeout | null = null;
private dailyCallConfig: DailyAdvancedConfig = {}

constructor(apiToken: string, apiBaseUrl?: string) {
constructor(apiToken: string, apiBaseUrl?: string, dailyCallConfig?: Pick<DailyAdvancedConfig, 'avoidEval'>) {
super();
client.baseUrl = apiBaseUrl ?? 'https://api.vapi.ai';
client.setSecurityData(apiToken);
this.dailyCallConfig = dailyCallConfig ?? {}
}

private cleanup() {
Expand Down Expand Up @@ -155,6 +158,7 @@ export default class Vapi extends VapiEventEmitter {
this.call = DailyIframe.createCallObject({
audioSource: true,
videoSource: isVideoRecordingEnabled,
dailyConfig: this.dailyCallConfig
});
this.call.iframe()?.style.setProperty('display', 'none');

Expand Down

0 comments on commit 2dcea88

Please sign in to comment.