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