Resolve agents, optionally filtered by agent id.
(agent_filter, agent_configs=None)
| 222 | |
| 223 | |
| 224 | def resolve_agents(agent_filter, agent_configs=None): |
| 225 | """Resolve agents, optionally filtered by agent id.""" |
| 226 | if agent_configs is None: |
| 227 | agent_configs = AGENT_CONFIGS |
| 228 | if agent_filter: |
| 229 | by_id = {c.id.lower(): c for c in agent_configs} |
| 230 | config = by_id.get(agent_filter.lower()) |
| 231 | if config is None: |
| 232 | raise ParamValidationError( |
| 233 | f'Invalid agent "{agent_filter}". Valid values: ' |
| 234 | f'{", ".join(sorted(c.id for c in agent_configs))}.' |
| 235 | ) |
| 236 | agent = config.detect() |
| 237 | return [agent] if agent is not None else [] |
| 238 | return get_detected_agents(agent_configs=agent_configs) |
no test coverage detected