semantic_router.layer.LayerConfig#

class semantic_router.layer.LayerConfig(routes=[], encoder_type='openai', encoder_name=None)#

Bases: object

Generates 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:

LayerConfig

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