swarmauri.core.agent_apis.IAgentRouterCRUD module

class swarmauri.core.agent_apis.IAgentRouterCRUD.IAgentRouterCRUD[source]

Bases: ABC

Interface for managing API routes within a SwarmAgent.

abstract create_route(path, method, handler)[source]

Create a new route for the API.

Parameters: - path (str): The URL path for the route. - method (str): The HTTP method (e.g., ‘GET’, ‘POST’). - handler (Callable[[Any], Any]): The function that handles requests to this route.

Return type:

None

abstract delete_route(path, method)[source]

Delete a specific route from the API.

Parameters: - path (str): The URL path for the route. - method (str): The HTTP method.

Return type:

None

abstract read_route(path, method)[source]

Retrieve information about a specific route.

Parameters: - path (str): The URL path for the route. - method (str): The HTTP method.

Returns: - Dict: Information about the route, including path, method, and handler.

Return type:

Dict

abstract update_route(path, method, new_handler)[source]

Update the handler function for an existing route.

Parameters: - path (str): The URL path for the route. - method (str): The HTTP method. - new_handler (Callable[[Any], Any]): The new function that handles requests to this route.

Return type:

None