semantic_router.layer.LayerConfig#
- class semantic_router.layer.LayerConfig(routes: List[Route] = [], encoder_type: str = 'openai', encoder_name: str | None = None)#
Bases:
objectGenerates a LayerConfig object that can be used for initializing a RouteLayer.
Methods
__init__([routes, encoder_type, encoder_name])add(route)from_file(path)get(name)remove(name)to_dict()to_file(path)Save the routes to a file in JSON or YAML format
Attributes
routes- to_file(path: str)#
Save the routes to a file in JSON or YAML format