Fix type-checking for circular dependency in voice streamed example
This commit is contained in:
parent
7432347a94
commit
9473c788ba
1 changed files with 6 additions and 6 deletions
|
|
@ -13,13 +13,13 @@ from typing_extensions import override
|
||||||
|
|
||||||
from agents.voice import StreamedAudioInput, VoicePipeline
|
from agents.voice import StreamedAudioInput, VoicePipeline
|
||||||
|
|
||||||
# Use absolute import when running as script directly
|
# Use absolute or relative import based on context
|
||||||
try:
|
if __name__ == "__main__":
|
||||||
# First try relative import (for package use)
|
# When running as script, use absolute import
|
||||||
|
from my_workflow import MyWorkflow # type: ignore
|
||||||
|
else:
|
||||||
|
# When imported as module, use relative import
|
||||||
from .my_workflow import MyWorkflow
|
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
|
CHUNK_LENGTH_S = 0.05 # 100ms
|
||||||
SAMPLE_RATE = 24000
|
SAMPLE_RATE = 24000
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue