Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/everyrow/generated/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from .agent_map_operation import AgentMapOperation
from .agent_map_operation_input_type_1_item import AgentMapOperationInputType1Item
from .agent_map_operation_input_type_2 import AgentMapOperationInputType2
from .agent_map_operation_response_schema_type_0 import AgentMapOperationResponseSchemaType0
from .agent_map_operation_response_schema_type_0 import (
AgentMapOperationResponseSchemaType0,
)
from .billing_response import BillingResponse
from .create_artifact_request import CreateArtifactRequest
from .create_artifact_request_data_type_0_item import CreateArtifactRequestDataType0Item
Expand Down Expand Up @@ -42,7 +44,9 @@
from .single_agent_operation import SingleAgentOperation
from .single_agent_operation_input_type_1_item import SingleAgentOperationInputType1Item
from .single_agent_operation_input_type_2 import SingleAgentOperationInputType2
from .single_agent_operation_response_schema_type_0 import SingleAgentOperationResponseSchemaType0
from .single_agent_operation_response_schema_type_0 import (
SingleAgentOperationResponseSchemaType0,
)
from .task_result_response import TaskResultResponse
from .task_result_response_data_type_0_item import TaskResultResponseDataType0Item
from .task_result_response_data_type_1 import TaskResultResponseDataType1
Expand Down
25 changes: 15 additions & 10 deletions src/everyrow/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,8 @@ def _extract_scalar_data[T: BaseModel](

def _extract_merge_breakdown(result: TaskResultResponse) -> MergeBreakdown:
"""Extract merge breakdown from task result response."""
# The merge_breakdown is stored in additional_properties, not as a direct attribute
mb = result.additional_properties.get("merge_breakdown", None)
mb = result.merge_breakdown
if mb is None or isinstance(mb, Unset):
# Return empty breakdown if not present
return MergeBreakdown(
exact=[],
fuzzy=[],
Expand All @@ -196,14 +194,21 @@ def _extract_merge_breakdown(result: TaskResultResponse) -> MergeBreakdown:
unmatched_right=[],
)

# mb is a dict from additional_properties, access fields with .get()
return MergeBreakdown(
exact=[tuple(p) for p in mb.get("exact", []) or []],
fuzzy=[tuple(p) for p in mb.get("fuzzy", []) or []],
llm=[tuple(p) for p in mb.get("llm", []) or []],
web=[tuple(p) for p in mb.get("web", []) or []],
unmatched_left=list(mb.get("unmatched_left", []) or []),
unmatched_right=list(mb.get("unmatched_right", []) or []),
exact=[(p[0], p[1]) for p in mb.exact]
if not isinstance(mb.exact, Unset)
else [],
fuzzy=[(p[0], p[1]) for p in mb.fuzzy]
if not isinstance(mb.fuzzy, Unset)
else [],
llm=[(p[0], p[1]) for p in mb.llm] if not isinstance(mb.llm, Unset) else [],
web=[(p[0], p[1]) for p in mb.web] if not isinstance(mb.web, Unset) else [],
unmatched_left=list(mb.unmatched_left)
if not isinstance(mb.unmatched_left, Unset)
else [],
unmatched_right=list(mb.unmatched_right)
if not isinstance(mb.unmatched_right, Unset)
else [],
)


Expand Down