Client Reference
semantic_router.route
Route Objects
class Route(BaseModel)A route: one decision a router can make, and what tells it when to make it.
Arguments:
name(str): The name of the route.utterances(List[Any]): Example queries for the route. Indexed routers embed these; a decision router only reads them when the route has no description.description(Optional[str]): What the route covers, stated literally. Decision routers read it.confidence_threshold(Optional[float]): The confidence a router needs before it returns this route. It overrides the router's own confidence_threshold.metadata(Dict[str, Any]): Anything else to keep with the route.
to_dict
def to_dict() -> Dict[str, Any]Convert the route to a dictionary.
Returns:
Dict[str, Any]: The dictionary representation of the route.
from_dict
@classmethod
def from_dict(cls, data: Dict[str, Any]) -> "Route"Create a Route object from a dictionary.
Arguments:
data(Dict[str, Any]): The dictionary to create the route from.
Returns:
Route: The created route.