Skip to content

Commit 8081585

Browse files
committed
fix(synthesis): handle dict model input from gate.champion
1 parent 2f55231 commit 8081585

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/certamen/application/workflow/nodes/synthesis.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from certamen.domain.prompts.builder import PromptBuilder
1414
from certamen.domain.prompts.formatter import PromptFormatter
1515
from certamen.infrastructure.config.defaults import get_defaults
16+
from certamen.infrastructure.llm import ensure_single_model_instance
1617

1718

1819
def _build_prompt_builder(
@@ -97,6 +98,15 @@ async def execute(
9798
if not model_keys:
9899
return {"synthesis": "[No model available for synthesis]"}
99100
synth_model = context.models[model_keys[0]]
101+
elif isinstance(synth_model, dict):
102+
synth_model = await ensure_single_model_instance(
103+
synth_model, "synthesizer"
104+
)
105+
if synth_model is None:
106+
model_keys = list(context.models.keys())
107+
if not model_keys:
108+
return {"synthesis": "[No model available for synthesis]"}
109+
synth_model = context.models[model_keys[0]]
100110

101111
instruction = self.node_properties.get("instruction") or None
102112
prompt_builder = _build_prompt_builder(instruction)

0 commit comments

Comments
 (0)