Annex 2. AI Agent Code ####################### In the *AI Agents for OSM* functionality, AI Agents are built using the same approach as the configuration file used to run them. There is an orchestrator and a set of interfaces that implement each section of the configuration file. .. code-block:: yaml config: executions: - active: True model: endpoint: "http://192.168.137.46:8501/v1/models/CPU-forecast-model:predict" monitoring: endpoint: "http://192.168.137.34:4000" threshold: function_name: evaluator logic: "evaluator = lambda x: True if x['predictions'][0][0] >= 0.8 else False" AI Agent Orchestrator ********************* .. autoclass:: aiagent.agent.AIAgent :members: Interfaces ************* Model Interface -------------------- .. autoclass:: aiagent.interfaces.model_interface.ModelInterface :members: Monitoring Interface --------------------- .. autoclass:: aiagent.interfaces.monitoring_interface.MonitoringInterface :members: Threshold Interface -------------------- .. autoclass:: aiagent.interfaces.threshold_interface.ThresholdInterface :members: