feat: surface disputed extracted values to critic and specialist prompts
This commit is contained in:
@@ -12,7 +12,7 @@ from typing import Dict, List
|
||||
|
||||
|
||||
def _norm(value) -> str:
|
||||
return re.sub(r"\s+", " ", str(value or "").strip().lower())
|
||||
return re.sub(r"\s+", " ", ("" if value is None else str(value)).strip().lower())
|
||||
|
||||
|
||||
def find_disputes(assertions: List[Dict]) -> List[Dict]:
|
||||
|
||||
@@ -11,6 +11,7 @@ from backend.agents.code_agent import CodeAgent, build_code_scopes
|
||||
from backend.agents.completeness import CompletenessAgent, build_sheet_summaries
|
||||
from backend.agents.conflict_critic import ConflictCriticAgent
|
||||
from backend.agents.construct_agent import ConstructabilityAgent, build_construct_scopes
|
||||
from backend.agents.disputes import annotate_clusters
|
||||
from backend.agents.extractors import (
|
||||
JurisdictionAgent,
|
||||
SheetExtractorAgent,
|
||||
@@ -113,6 +114,9 @@ def run_agent_pipeline(
|
||||
for artifact in result.artifacts
|
||||
][:config.CLUSTER_MAX]
|
||||
object_graph = build_object_graph(clusters)
|
||||
disputed_count = annotate_clusters(clusters)
|
||||
if disputed_count:
|
||||
orchestrator.stage(f"[Link] {disputed_count} clusters carry disputed extracted values")
|
||||
memory.replace("clusters", clusters)
|
||||
memory.replace("object_graph", object_graph)
|
||||
memory.dump("03-link.json")
|
||||
|
||||
@@ -54,6 +54,8 @@ def slim_clusters(clusters: List[Dict]) -> List[Dict]:
|
||||
"location": c.get("location"),
|
||||
"disciplines": c.get("disciplines"),
|
||||
"kind": c.get("kind"),
|
||||
**({"disputed_attributes": c["disputed_attributes"]}
|
||||
if c.get("disputed_attributes") else {}),
|
||||
"assertions": [slim_assertion(a) for a in c.get("assertions", [])],
|
||||
}
|
||||
for c in clusters
|
||||
|
||||
Reference in New Issue
Block a user