Skip to content

Commit 44ce423

Browse files
nikosbosseclaude
andauthored
Add typed MergeBreakdownResponse and Claude 4.6 LLM variants (#117)
* Add typed MergeBreakdownResponse and Claude 4.6 Opus LLM variants Regenerated models from current API spec: - Add MergeBreakdownResponse typed model to TaskResultResponse, replacing hand-parsed additional_properties in _extract_merge_breakdown() - Add CLAUDE_4_6_OPUS_* variants to LLMEnumPublic enum Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix basedpyright type errors for MergeBreakdown tuple fields Use (p[0], p[1]) instead of tuple(p) so basedpyright infers tuple[int, int] rather than tuple[int, ...]. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix ruff formatting in task.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a60c052 commit 44ce423

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

src/everyrow/generated/models/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
from .agent_map_operation import AgentMapOperation
44
from .agent_map_operation_input_type_1_item import AgentMapOperationInputType1Item
55
from .agent_map_operation_input_type_2 import AgentMapOperationInputType2
6-
from .agent_map_operation_response_schema_type_0 import AgentMapOperationResponseSchemaType0
6+
from .agent_map_operation_response_schema_type_0 import (
7+
AgentMapOperationResponseSchemaType0,
8+
)
79
from .billing_response import BillingResponse
810
from .create_artifact_request import CreateArtifactRequest
911
from .create_artifact_request_data_type_0_item import CreateArtifactRequestDataType0Item
@@ -42,7 +44,9 @@
4244
from .single_agent_operation import SingleAgentOperation
4345
from .single_agent_operation_input_type_1_item import SingleAgentOperationInputType1Item
4446
from .single_agent_operation_input_type_2 import SingleAgentOperationInputType2
45-
from .single_agent_operation_response_schema_type_0 import SingleAgentOperationResponseSchemaType0
47+
from .single_agent_operation_response_schema_type_0 import (
48+
SingleAgentOperationResponseSchemaType0,
49+
)
4650
from .task_result_response import TaskResultResponse
4751
from .task_result_response_data_type_0_item import TaskResultResponseDataType0Item
4852
from .task_result_response_data_type_1 import TaskResultResponseDataType1

src/everyrow/task.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,8 @@ def _extract_scalar_data[T: BaseModel](
183183

184184
def _extract_merge_breakdown(result: TaskResultResponse) -> MergeBreakdown:
185185
"""Extract merge breakdown from task result response."""
186-
# The merge_breakdown is stored in additional_properties, not as a direct attribute
187-
mb = result.additional_properties.get("merge_breakdown", None)
186+
mb = result.merge_breakdown
188187
if mb is None or isinstance(mb, Unset):
189-
# Return empty breakdown if not present
190188
return MergeBreakdown(
191189
exact=[],
192190
fuzzy=[],
@@ -196,14 +194,21 @@ def _extract_merge_breakdown(result: TaskResultResponse) -> MergeBreakdown:
196194
unmatched_right=[],
197195
)
198196

199-
# mb is a dict from additional_properties, access fields with .get()
200197
return MergeBreakdown(
201-
exact=[tuple(p) for p in mb.get("exact", []) or []],
202-
fuzzy=[tuple(p) for p in mb.get("fuzzy", []) or []],
203-
llm=[tuple(p) for p in mb.get("llm", []) or []],
204-
web=[tuple(p) for p in mb.get("web", []) or []],
205-
unmatched_left=list(mb.get("unmatched_left", []) or []),
206-
unmatched_right=list(mb.get("unmatched_right", []) or []),
198+
exact=[(p[0], p[1]) for p in mb.exact]
199+
if not isinstance(mb.exact, Unset)
200+
else [],
201+
fuzzy=[(p[0], p[1]) for p in mb.fuzzy]
202+
if not isinstance(mb.fuzzy, Unset)
203+
else [],
204+
llm=[(p[0], p[1]) for p in mb.llm] if not isinstance(mb.llm, Unset) else [],
205+
web=[(p[0], p[1]) for p in mb.web] if not isinstance(mb.web, Unset) else [],
206+
unmatched_left=list(mb.unmatched_left)
207+
if not isinstance(mb.unmatched_left, Unset)
208+
else [],
209+
unmatched_right=list(mb.unmatched_right)
210+
if not isinstance(mb.unmatched_right, Unset)
211+
else [],
207212
)
208213

209214

0 commit comments

Comments
 (0)