Skip to content

Commit 8bbaba5

Browse files
yulin-liYulin Li
andauthored
[ai-voicelive] fix typo in mcp sample file name (#44206)
Co-authored-by: Yulin Li <yulili@microsoft.com>
1 parent d157b1b commit 8bbaba5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

sdk/ai/azure-ai-voicelive/samples/async_map_sample.py renamed to sdk/ai/azure-ai-voicelive/samples/async_mcp_sample.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
1717
USAGE:
1818
python async_mcp_sample.py
19-
19+
2020
Set the environment variables with your own values before running the sample:
2121
1) AZURE_VOICELIVE_API_KEY - The Azure VoiceLive API key
2222
2) AZURE_VOICELIVE_ENDPOINT - The Azure VoiceLive endpoint
23-
23+
2424
REQUIREMENTS:
2525
- azure-ai-voicelive
2626
- python-dotenv
@@ -30,14 +30,12 @@
3030
import os
3131
import sys
3232
import asyncio
33-
import json
34-
import datetime
3533
import logging
3634
import base64
3735
import signal
3836
import threading
3937
import queue
40-
from typing import Union, Optional, Dict, Any, Callable, TYPE_CHECKING, cast
38+
from typing import Union, Optional, Any, Callable, TYPE_CHECKING, cast
4139
from concurrent.futures import ThreadPoolExecutor
4240

4341
# Audio processing imports
@@ -530,7 +528,7 @@ async def _handle_event(self, event, connection):
530528
await self._handle_mcp_call_completed(event, connection)
531529
elif event.type == ServerEventType.RESPONSE_MCP_CALL_FAILED:
532530
logger.error(f"MCP call failed for {event.item_id}.")
533-
531+
534532
elif event.type == ServerEventType.CONVERSATION_ITEM_CREATED:
535533
logger.info(f"Conversation item created: id={event.item.id}, type={event.item.type}")
536534
if event.item.type == ItemType.MCP_LIST_TOOLS:
@@ -602,7 +600,7 @@ async def _handle_mcp_call_completed(self, mcp_call_completed_event: str, connec
602600
return
603601
mcp_output = mcp_call_done.item.output
604602
logger.info(f"MCP Call output received: {mcp_output}")
605-
603+
606604
# Create a new response to process the MCP output
607605
await connection.response.create()
608606

@@ -620,7 +618,7 @@ async def _handle_mcp_call_arguments(self, conversation_created_event, connectio
620618
server_label = mcp_call_item.server_label
621619
function_name = mcp_call_item.name
622620
arguments = mcp_call_item.arguments
623-
621+
624622
logger.info(f"MCP Call triggered: server_label={server_label}, function_name={function_name}")
625623
try:
626624
# Wait for the MCP call arguments to be complete

0 commit comments

Comments
 (0)