Skip to content

Commit 1451f78

Browse files
committed
fix: Interrupt is not a "play_media" parameter
1 parent 331da07 commit 1451f78

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

app/helpers/call_utils.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,10 @@ async def _handle_recognize_media( # noqa: PLR0913
128128
raise e
129129

130130

131-
async def _handle_play_text( # noqa: PLR0913
131+
async def _handle_play_text(
132132
call: CallStateModel,
133133
client: CallAutomationClient,
134134
context: ContextEnum | None,
135-
interrupt_queue: bool,
136135
style: MessageStyleEnum,
137136
text: str,
138137
) -> None:
@@ -146,7 +145,6 @@ async def _handle_play_text( # noqa: PLR0913
146145
assert call.voice_id, "Voice ID is required for playing text"
147146
async with _use_call_client(client, call.voice_id) as call_client:
148147
await call_client.play_media(
149-
interrupt_call_media_operation=interrupt_queue,
150148
operation_context=_context_builder({context}),
151149
play_source=_audio_from_text(
152150
call=call,
@@ -248,7 +246,6 @@ async def handle_recognize_text( # noqa: PLR0913
248246
call=call,
249247
client=client,
250248
context=context,
251-
interrupt_queue=chunck_interrupt_queue,
252249
style=style,
253250
text=chunk,
254251
)
@@ -259,7 +256,6 @@ async def handle_play_text( # noqa: PLR0913
259256
client: CallAutomationClient,
260257
text: str,
261258
context: ContextEnum | None = None,
262-
interrupt_queue: bool = False,
263259
store: bool = True,
264260
style: MessageStyleEnum = MessageStyleEnum.NONE,
265261
) -> None:
@@ -277,16 +273,11 @@ async def handle_play_text( # noqa: PLR0913
277273
)
278274

279275
# Play each chunk
280-
for i, chunk in enumerate(chunks):
281-
# For first chunk, interrupt media if needed
282-
chunck_interrupt_queue = interrupt_queue if i == 0 else False
283-
284-
# Play text
276+
for chunk in chunks:
285277
await _handle_play_text(
286278
call=call,
287279
client=client,
288280
context=context,
289-
interrupt_queue=chunck_interrupt_queue,
290281
style=style,
291282
text=chunk,
292283
)

0 commit comments

Comments
 (0)