Loading src/app/p_services/admin/lifeCycleManagement/service-rule-design/service-rule-design.component.html +1 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,7 @@ </category> <category name="Openslice" colour="210"> <block type="askAgent"></block> <block type="createServiceOrder"></block> <block type="createServiceOrderJson"></block> </category> Loading src/app/p_services/admin/lifeCycleManagement/service-rule-design/service-rule-design.component.ts +19 −1 Original line number Diff line number Diff line Loading @@ -1421,6 +1421,23 @@ export class ServiceRuleDesignComponent implements OnInit { return [code, Blockly.Java.ORDER_ATOMIC]; }; Blockly.Java['askAgent'] = function(block: any) { // Variable getter. console.log('askAgent') var agentName = Blockly.Java.valueToCode(block, 'agentName', Blockly.Java.ORDER_NONE) || null; var chattext = Blockly.Java.valueToCode(block, 'text', Blockly.Java.ORDER_NONE) || null; var defaultText = Blockly.Java.valueToCode(block, 'defaultText', Blockly.Java.ORDER_NONE) || null; var timeOut = Blockly.Java.valueToCode(block, 'timeOut', Blockly.Java.ORDER_NONE) || null; var code = 'askAgent(' + agentName + ',' + chattext + ',' + defaultText + ',' + timeOut + ')'; return [code, Blockly.Java.ORDER_ATOMIC]; }; Blockly.Java['createServiceOrderJson'] = function(block: any) { // Variable getter. Loading @@ -1433,6 +1450,7 @@ export class ServiceRuleDesignComponent implements OnInit { return [code, Blockly.Java.ORDER_ATOMIC]; }; Blockly.Java['variables_get'] = function(block: any) { // Variable getter. console.log('Variable getter CUSTOM') Loading src/assets/blockly/custom_blocks.js +34 −0 Original line number Diff line number Diff line Loading @@ -794,7 +794,39 @@ Blockly.Blocks['string_to_float'] = { * ****************************************************************************/ Blockly.Blocks['askAgent'] = { init: function() { this.appendDummyInput() .appendField("Ask agent"); this.appendValueInput("agentName") .setCheck("String") .setAlign(Blockly.ALIGN_RIGHT) .appendField("Agent Name"); this.appendValueInput("text") .setCheck("String") .setAlign(Blockly.ALIGN_RIGHT) .appendField("Text"); this.appendValueInput("defaultText") .setCheck("String") .setAlign(Blockly.ALIGN_RIGHT) .appendField("Default Text"); this.appendValueInput("timeOut") .setCheck("Number") .setAlign(Blockly.ALIGN_RIGHT) .appendField("TimeOut (ms)"); this.setOutput(true, 'String'); this.setColour(230); this.setTooltip("Ask the locally configured LLM agent a question. The response will be the text answer from the agent. On error will return the default text"); this.setHelpUrl(""); } }; Loading Loading @@ -849,6 +881,7 @@ Blockly.Blocks['string_to_float'] = { }; /*************************************************************************** * * OSM RELATED Loading Loading @@ -1032,6 +1065,7 @@ Blockly.Blocks['string_to_float'] = { } }; Blockly.Blocks['valueFromJsonPath'] = { init: function() { this.appendValueInput("jsoninput") Loading Loading
src/app/p_services/admin/lifeCycleManagement/service-rule-design/service-rule-design.component.html +1 −0 Original line number Diff line number Diff line Loading @@ -345,6 +345,7 @@ </category> <category name="Openslice" colour="210"> <block type="askAgent"></block> <block type="createServiceOrder"></block> <block type="createServiceOrderJson"></block> </category> Loading
src/app/p_services/admin/lifeCycleManagement/service-rule-design/service-rule-design.component.ts +19 −1 Original line number Diff line number Diff line Loading @@ -1421,6 +1421,23 @@ export class ServiceRuleDesignComponent implements OnInit { return [code, Blockly.Java.ORDER_ATOMIC]; }; Blockly.Java['askAgent'] = function(block: any) { // Variable getter. console.log('askAgent') var agentName = Blockly.Java.valueToCode(block, 'agentName', Blockly.Java.ORDER_NONE) || null; var chattext = Blockly.Java.valueToCode(block, 'text', Blockly.Java.ORDER_NONE) || null; var defaultText = Blockly.Java.valueToCode(block, 'defaultText', Blockly.Java.ORDER_NONE) || null; var timeOut = Blockly.Java.valueToCode(block, 'timeOut', Blockly.Java.ORDER_NONE) || null; var code = 'askAgent(' + agentName + ',' + chattext + ',' + defaultText + ',' + timeOut + ')'; return [code, Blockly.Java.ORDER_ATOMIC]; }; Blockly.Java['createServiceOrderJson'] = function(block: any) { // Variable getter. Loading @@ -1433,6 +1450,7 @@ export class ServiceRuleDesignComponent implements OnInit { return [code, Blockly.Java.ORDER_ATOMIC]; }; Blockly.Java['variables_get'] = function(block: any) { // Variable getter. console.log('Variable getter CUSTOM') Loading
src/assets/blockly/custom_blocks.js +34 −0 Original line number Diff line number Diff line Loading @@ -794,7 +794,39 @@ Blockly.Blocks['string_to_float'] = { * ****************************************************************************/ Blockly.Blocks['askAgent'] = { init: function() { this.appendDummyInput() .appendField("Ask agent"); this.appendValueInput("agentName") .setCheck("String") .setAlign(Blockly.ALIGN_RIGHT) .appendField("Agent Name"); this.appendValueInput("text") .setCheck("String") .setAlign(Blockly.ALIGN_RIGHT) .appendField("Text"); this.appendValueInput("defaultText") .setCheck("String") .setAlign(Blockly.ALIGN_RIGHT) .appendField("Default Text"); this.appendValueInput("timeOut") .setCheck("Number") .setAlign(Blockly.ALIGN_RIGHT) .appendField("TimeOut (ms)"); this.setOutput(true, 'String'); this.setColour(230); this.setTooltip("Ask the locally configured LLM agent a question. The response will be the text answer from the agent. On error will return the default text"); this.setHelpUrl(""); } }; Loading Loading @@ -849,6 +881,7 @@ Blockly.Blocks['string_to_float'] = { }; /*************************************************************************** * * OSM RELATED Loading Loading @@ -1032,6 +1065,7 @@ Blockly.Blocks['string_to_float'] = { } }; Blockly.Blocks['valueFromJsonPath'] = { init: function() { this.appendValueInput("jsoninput") Loading