Commit 2c4911d
authored
fix: lazy import strands-agents-evals to avoid ImportError when not installed (#367)
evaluation/__init__.py unconditionally imported StrandsEvalsAgentCoreEvaluator
and create_strands_evaluator, which transitively imports strands_evals. This
caused an ImportError for users who installed bedrock-agentcore without the
strands-agents-evals extra.
Use __getattr__ lazy loading so strands-dependent symbols are only imported
when actually accessed, with a clear error message if the extra is missing.
Closes #3401 parent 5bdf009 commit 2c4911d
1 file changed
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 4 | | |
9 | 5 | | |
10 | 6 | | |
| |||
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments