From 7432347a941d46758fc6692d4b4b0df190958d99 Mon Sep 17 00:00:00 2001 From: Aviral Garg Date: Fri, 21 Mar 2025 13:25:46 -0700 Subject: [PATCH] Fix circular dependency in voice streamed example by renaming agents.py to my_workflow.py --- examples/voice/streamed/main.py | 8 +++++++- examples/voice/streamed/{agents.py => my_workflow.py} | 0 2 files changed, 7 insertions(+), 1 deletion(-) rename examples/voice/streamed/{agents.py => my_workflow.py} (100%) diff --git a/examples/voice/streamed/main.py b/examples/voice/streamed/main.py index aef3b36..c429890 100644 --- a/examples/voice/streamed/main.py +++ b/examples/voice/streamed/main.py @@ -13,7 +13,13 @@ from typing_extensions import override from agents.voice import StreamedAudioInput, VoicePipeline -from .agents import MyWorkflow +# Use absolute import when running as script directly +try: + # First try relative import (for package use) + from .my_workflow import MyWorkflow +except ImportError: + # Fall back to direct import (for script use) + from my_workflow import MyWorkflow CHUNK_LENGTH_S = 0.05 # 100ms SAMPLE_RATE = 24000 diff --git a/examples/voice/streamed/agents.py b/examples/voice/streamed/my_workflow.py similarity index 100% rename from examples/voice/streamed/agents.py rename to examples/voice/streamed/my_workflow.py