smia.logic.agent_services module¶
- class smia.logic.agent_services.AgentServices(agent_object)[source]¶
Bases:
objectThis class contains all the methods related to the agent services. As well as the asset has services that can be exposed, the agent also has services that can be exposed and used during the execution of the software.
- async get_agent_service_by_id(service_id)[source]¶
This method gets the agent service by its identifier. It returns None if the service is not found.
- Parameters:
service_id (str) – unique identifier of the agent service.
- Returns:
executable method of the agent service.
- Return type:
method
- async save_agent_service(service_id, service_method)[source]¶
This method adds a new agent service with a given identifier and the associated execution method.
- Parameters:
service_id (str) – unique identifier of the agent service.
service_method – execution method associated to the agent service.
- async execute_agent_service_by_id(service_id, **kwargs)[source]¶
This method executes the agent service by its identifier. The parameters of the method with their values are available in kwargs.
- Parameters:
service_id (str) – identifier of the agent service.
**kwargs – received parameters with the values.
- Returns:
the result of the executed agent service (‘OK’ if the service does not return anything).
- Return type:
object