fenghantong
Deploy RouteOpt Agent
ffda755
Raw
History Blame Contribute Delete
1.31 kB
from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any, Literal
Objective = Literal["time", "distance"]
@dataclass
class RouteTask:
raw_request: str
start_place: str
destination_places: list[str]
objective: Objective = "time"
return_to_start: bool = True
fixed_end_place: str | None = None
constraints: list[str] = field(default_factory=list)
@dataclass
class GeoPoint:
name: str
query: str
lat: float
lon: float
display_name: str
source: str
@dataclass
class RouteMatrix:
points: list[GeoPoint]
durations: list[list[float]]
distances: list[list[float]]
source: str
@dataclass
class RouteSolution:
route_indices: list[int]
route_names: list[str]
total_duration_seconds: float
total_distance_meters: float
objective: Objective
algorithm: str
leg_rows: list[list[Any]]
@dataclass
class ToolEvent:
step: int
tool: str
arguments: dict[str, Any]
status: str
result: str
@dataclass
class AgentResult:
task: RouteTask
points: list[GeoPoint]
matrix: RouteMatrix
solution: RouteSolution
summary_markdown: str
trace: list[ToolEvent]
pdf_path: str
route_svg: str
warnings: list[str] = field(default_factory=list)