semantic_router.layer#

Functions

is_valid(layer_config)

Make sure the given string is json format and contains the 3 keys: ["encoder_name", "encoder_type", "routes"]

threshold_random_search(route_layer, ...)

Performs a random search iteration given a route layer and a search range.

Classes

LayerConfig([routes, encoder_type, encoder_name])

Generates a LayerConfig object that can be used for initializing a RouteLayer.

RouteLayer([encoder, llm, routes, index, ...])