|
26 | 26 | from typing import Union, Optional, cast |
27 | 27 | from concurrent.futures import ThreadPoolExecutor |
28 | 28 |
|
| 29 | +from azure.identity.aio import AzureCliCredential |
| 30 | + |
29 | 31 | # Audio processing imports |
30 | 32 | try: |
31 | 33 | import pyaudio |
@@ -355,7 +357,7 @@ class AsyncSupervisorAgentClient: |
355 | 357 | def __init__( |
356 | 358 | self, |
357 | 359 | endpoint: str, |
358 | | - credential: Union[AzureKeyCredential, AsyncTokenCredential], |
| 360 | + credential: AsyncTokenCredential, |
359 | 361 | model: str, |
360 | 362 | voice: str, |
361 | 363 | instructions: str, |
@@ -541,21 +543,10 @@ async def _handle_event(self, event, connection) -> None: |
541 | 543 | async def main() -> None: |
542 | 544 | """Main entry point for the supervisor agent sample.""" |
543 | 545 | # Get credentials from environment variables |
544 | | - api_key = os.environ.get("AZURE_VOICELIVE_API_KEY") |
545 | 546 | endpoint = os.environ.get("AZURE_VOICELIVE_ENDPOINT", "wss://api.voicelive.com/v1") |
546 | 547 |
|
547 | | - if not api_key: |
548 | | - print("❌ Error: No AZURE_VOICELIVE_API_KEY provided") |
549 | | - print("Please set the AZURE_VOICELIVE_API_KEY environment variable.") |
550 | | - sys.exit(1) |
551 | | - |
552 | | - # Option 1: API key authentication (simple, recommended for quick start) |
553 | | - credential: Union[AzureKeyCredential, AsyncTokenCredential] = AzureKeyCredential(api_key) |
554 | | - |
555 | | - # Option 2: Async AAD authentication (requires azure-identity) |
556 | | - # Uncomment the lines below to use AAD authentication instead: |
557 | | - # from azure.identity.aio import AzureCliCredential, DefaultAzureCredential |
558 | | - # credential = AzureCliCredential() |
| 548 | + |
| 549 | + credential = AzureCliCredential() |
559 | 550 |
|
560 | 551 | # Create and run the supervisor agent client |
561 | 552 | client = AsyncSupervisorAgentClient( |
|
0 commit comments