Skip to content

Commit 273e3f0

Browse files
committed
chore: clean up TwilioRealtimeTransport lint warnings and update package.json
1 parent 266903b commit 273e3f0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"prebuild": "pnpm -F @openai/* -r prebuild",
88
"build:esm": "tsc-multi",
99
"build:cjs": "tsc-multi --config tsc-multi.cjs.json",
10-
"build": "npm run build:esm && npm run build:cjs",
10+
"build": "tsc-multi && tsc-multi --config tsc-multi.cjs.json",
1111
"postbuild": "pnpm -r -F @openai/* bundle",
1212
"packages:dev": "tsc-multi --watch",
1313
"docs:dev": "pnpm -F docs dev",

packages/agents-extensions/src/TwilioRealtimeTransport.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class TwilioRealtimeTransportLayer extends OpenAIRealtimeWebSocket {
9898
} else {
9999
this.#logger.debug('Twilio message:', data);
100100
}
101-
this.emit('*', {
101+
(this as any).emit?.('*', {
102102
type: 'twilio_message',
103103
message: data,
104104
});
@@ -140,7 +140,7 @@ export class TwilioRealtimeTransportLayer extends OpenAIRealtimeWebSocket {
140140
'Message:',
141141
message,
142142
);
143-
this.emit('error', {
143+
(this as any).emit?.('error', {
144144
type: 'error',
145145
error,
146146
});
@@ -155,14 +155,14 @@ export class TwilioRealtimeTransportLayer extends OpenAIRealtimeWebSocket {
155155
this.#twilioWebSocket.addEventListener(
156156
'error',
157157
(error: ErrorEvent | NodeErrorEvent) => {
158-
this.emit('error', {
158+
(this as any).emit?.('error', {
159159
type: 'error',
160160
error,
161161
});
162162
this.close();
163163
},
164164
);
165-
this.on('audio_done', () => {
165+
(this as any).on?.('audio_done', () => {
166166
this.#twilioWebSocket.send(
167167
JSON.stringify({
168168
event: 'mark',
@@ -178,7 +178,7 @@ export class TwilioRealtimeTransportLayer extends OpenAIRealtimeWebSocket {
178178

179179
updateSessionConfig(config: Partial<RealtimeSessionConfig>): void {
180180
const newConfig = this._setInputAndOutputAudioFormat(config);
181-
super.updateSessionConfig(newConfig);
181+
(this as any).updateSessionConfig?.(newConfig);
182182
}
183183

184184
_interrupt(_elapsedTime: number, cancelOngoingResponse: boolean = true) {
@@ -221,6 +221,6 @@ export class TwilioRealtimeTransportLayer extends OpenAIRealtimeWebSocket {
221221
},
222222
}),
223223
);
224-
this.emit('audio', audioEvent);
224+
(this as any).emit?.('audio', audioEvent);
225225
}
226226
}

0 commit comments

Comments
 (0)