semantic_router.hybrid_layer.HybridRouteLayer#

class semantic_router.hybrid_layer.HybridRouteLayer(encoder: BaseEncoder, sparse_encoder: BM25Encoder | None = None, routes: List[Route] = [], alpha: float = 0.3, top_k: int = 5, aggregation: str = 'sum')#

Bases: object

__init__(encoder: BaseEncoder, sparse_encoder: BM25Encoder | None = None, routes: List[Route] = [], alpha: float = 0.3, top_k: int = 5, aggregation: str = 'sum')#

Methods

__init__(encoder[, sparse_encoder, routes, ...])

add(route)

update_dense_embeddings_index(utterances)

update_sparse_embeddings_index(utterances)

Attributes

categories

index

sparse_index

score_threshold