Answer architecture round 2: 0 🔴, 3 🟡 (0 misread); the cycle's and the chunk run's suites sit beside their modules, and the claim rule and the model override have one home each
CI / tests (pull_request) Successful in 3m23s
CI / tests (pull_request) Successful in 3m23s
This commit is contained in:
@@ -18,14 +18,24 @@ class Models:
|
||||
worker: str
|
||||
|
||||
|
||||
# The environment variables that name the judge's and the worker's model for one run, over the model saved or configured.
|
||||
JUDGE_MODEL = "LOOP_CLAUDE_JUDGE_MODEL"
|
||||
WORKER_MODEL = "LOOP_CLAUDE_WORKER_MODEL"
|
||||
|
||||
|
||||
def overridden(env: typing.Mapping[str, str], default: str) -> Models:
|
||||
"""The models of a run: default, unless env names another for the judge or the worker."""
|
||||
return Models(env.get(JUDGE_MODEL) or default, env.get(WORKER_MODEL) or default)
|
||||
|
||||
|
||||
def get_or_ask_models(project_key: str, paths: Paths, env: typing.Mapping[str, str], driver: str, effects: Effects) -> Models | Stop:
|
||||
judge, worker = env.get("LOOP_CLAUDE_JUDGE_MODEL"), env.get("LOOP_CLAUDE_WORKER_MODEL")
|
||||
if judge and worker:
|
||||
return Models(judge, worker)
|
||||
named = overridden(env, "")
|
||||
if named.judge and named.worker:
|
||||
return named
|
||||
chosen = get_or_ask_model(project_key, paths, driver, effects)
|
||||
if isinstance(chosen, Stop):
|
||||
return chosen
|
||||
return Models(judge or chosen, worker or chosen)
|
||||
return overridden(env, chosen)
|
||||
|
||||
|
||||
def get_or_ask_model(project_key: str, paths: Paths, driver: str, effects: Effects) -> str | Stop:
|
||||
|
||||
Reference in New Issue
Block a user