Wire gaps that were forgotten
This commit is contained in:
parent
57bac178dd
commit
84e94f8257
3 changed files with 11 additions and 0 deletions
|
|
@ -37,6 +37,9 @@ class EvaluationResult(BaseModel):
|
|||
max_length=3,
|
||||
default=[],
|
||||
)
|
||||
gaps: list[str] = Field(
|
||||
description="Concrete information gaps that remain", default_factory=list
|
||||
)
|
||||
confidence_score: float = Field(
|
||||
description="Confidence level in the completeness of research (0-1)",
|
||||
ge=0.0,
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ class EvaluateNode(BaseNode[ResearchState, ResearchDeps, ResearchReport]):
|
|||
for new_q in output.new_questions:
|
||||
if new_q not in state.context.sub_questions:
|
||||
state.context.sub_questions.append(new_q)
|
||||
for gap in output.gaps:
|
||||
state.context.add_gap(gap)
|
||||
|
||||
state.last_eval = output
|
||||
state.iterations += 1
|
||||
|
|
@ -65,6 +67,10 @@ class EvaluateNode(BaseNode[ResearchState, ResearchDeps, ResearchReport]):
|
|||
log(deps, state, " [bold]Key insights:[/bold]")
|
||||
for ins in output.key_insights:
|
||||
log(deps, state, f" • {ins}")
|
||||
if output.gaps:
|
||||
log(deps, state, " [bold yellow]Remaining gaps:[/bold yellow]")
|
||||
for gap in output.gaps:
|
||||
log(deps, state, f" • {gap}")
|
||||
log(
|
||||
deps,
|
||||
state,
|
||||
|
|
|
|||
|
|
@ -53,11 +53,13 @@ async def test_graph_end_to_end_with_patched_nodes(monkeypatch):
|
|||
ctx.state.last_eval = EvaluationResult(
|
||||
key_insights=["ok"],
|
||||
new_questions=[],
|
||||
gaps=["gap"],
|
||||
confidence_score=1.0,
|
||||
is_sufficient=True,
|
||||
reasoning="done",
|
||||
)
|
||||
ctx.state.iterations += 1
|
||||
ctx.state.context.add_gap("gap")
|
||||
ctx.deps.emit_log("evaluated", ctx.state)
|
||||
return SynthesizeNode(self.provider, self.model)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue