-
Notifications
You must be signed in to change notification settings - Fork 552
Description
Checks
- I have updated to the lastest minor and patch version of Strands
- I have checked the documentation and this is not expected behavior
- I have searched ./issues and there are no duplicates of my issue
Strands Version
1.19.0
Python Version
3.13 (also affects 3.10, 3.11, 3.12)
Operating System
All platforms (macOS, Linux, Windows)
Installation Method
git clone
Steps to Reproduce
- Install strands-agents:
pip install strands-agents- Try to import as documented in official examples:
from strands.experimental.bidi.models import BidiOpenAIRealtimeModel
from strands.experimental.bidi.models import BidiGeminiLiveModel- Observe the ImportError:
ImportError: cannot import name 'BidiOpenAIRealtimeModel' from 'strands.experimental.bidi.models'
- Documentation references:
Expected Behavior
The imports should work as documented. Users should be able to import BidiGeminiLiveModel and BidiOpenAIRealtimeModel from the top-level strands.experimental.bidi.models package, just like BidiNovaSonicModel (which works correctly).
Actual Behavior
ImportError is raised because these classes are not included in the __all__ list of src/strands/experimental/bidi/models/__init__.py.
Current workaround requires importing directly from submodules:
from strands.experimental.bidi.models.openai_realtime import BidiOpenAIRealtimeModel
from strands.experimental.bidi.models.gemini_live import BidiGeminiLiveModelAdditional Context
Root Cause:
The classes exist and work perfectly, but are missing from the package exports in src/strands/experimental/bidi/models/__init__.py:
# Current __init__.py (MISSING EXPORTS)
from .model import BidiModel, BidiModelTimeoutError
from .nova_sonic import BidiNovaSonicModel
# Missing: from .gemini_live import BidiGeminiLiveModel
# Missing: from .openai_realtime import BidiOpenAIRealtimeModel
__all__ = [
"BidiModel",
"BidiModelTimeoutError",
"BidiNovaSonicModel",
# Missing: "BidiGeminiLiveModel",
# Missing: "BidiOpenAIRealtimeModel",
]Impact:
- 🔴 Critical: Users cannot follow official documentation
- 🔴 Confusing: Inconsistent -
BidiNovaSonicModelworks but others don't - 🔴 Poor DX: Forces users to discover internal package structure
Testing:
Verified across Python 3.10, 3.11, 3.12, 3.13 - all fail with the same ImportError.
Possible Solution
Add the missing imports and exports to src/strands/experimental/bidi/models/__init__.py:
from .model import BidiModel, BidiModelTimeoutError
from .nova_sonic import BidiNovaSonicModel
from .gemini_live import BidiGeminiLiveModel # ADD THIS
from .openai_realtime import BidiOpenAIRealtimeModel # ADD THIS
__all__ = [
"BidiModel",
"BidiModelTimeoutError",
"BidiNovaSonicModel",
"BidiGeminiLiveModel", # ADD THIS
"BidiOpenAIRealtimeModel", # ADD THIS
]This 4-line change fixes the issue and aligns code with documentation.
Fix provided in PR #1328
Related Issues
No response