SemanticRouter
is the standard router that uses dense embeddings to match queries to routes. It’s the most common and widely used router type.
Example usage:
HybridRouter
uses both dense and sparse embeddings for a more balanced approach, combining semantic understanding with keyword matching. This can improve accuracy in many cases, especially where exact keyword matching is important.
Example usage:
HybridRouter
allows fine-tuning the balance between dense and sparse embeddings:
RouteChoice
object with these key attributes:
name
: The name of the matched route (or empty string if no match)score
: The confidence score of the matchfunction_schema
: Optional function schema associated with the routemetadata
: Any additional metadata associated with the route