mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-13 11:25:18 +00:00
Fail if not enough fallback deployments
This commit is contained in:
parent
7049c73790
commit
7762a67250
1 changed files with 3 additions and 0 deletions
|
|
@ -221,6 +221,9 @@ async def retry_with_fallback_models(f: Callable):
|
|||
fallback_deployments = [d.strip() for d in fallback_deployments.split(",")]
|
||||
if fallback_deployments:
|
||||
all_deployments = [deployment_id] + fallback_deployments
|
||||
if len(fallback_deployments) < len(fallback_models):
|
||||
raise ValueError(f"The number of fallback deployments ({len(all_deployments)}) "
|
||||
f"is less than the number of fallback models ({len(all_models)})")
|
||||
else:
|
||||
all_deployments = [deployment_id] * len(all_models)
|
||||
# try each (model, deployment_id) pair until one is successful, otherwise raise exception
|
||||
|
|
|
|||
Loading…
Reference in a new issue