Predictive Intelligence Error, 301 : SolutionName is empty

MattStoodley
Tera Contributor

Hi all.

I've been building a predictive intelligence Assignment Group  Assigner

following Multi-Method Assignment Group Prediction with Now ... - ServiceNow Community
 
However the build of the Predictive Intelligence part is causing problems.

I have definitely selected the 'Solution Name' as I create the tool. and the solution definitely exists as I chose it from the dropdown when creating the tool.

However, when I run the tool I get the error:

"301: SolutionName is empty"

The 'request' appears to send a json object which includes the 'short_description' and the 'topnresults' but does not contain a 'SolutionName' field.

Should it.

If so how can I fix this?



 

1 ACCEPTED SOLUTION

qprinsloo
Mega Sage

Hi @MattStoodley , I ran into the exact same issue getting the 301: Solution Name is empty in the PI tool output. Searching for an answer I came across your question. Were you able to solve it? I'm about to open a case with support myself since this seems to be an issue with the Predictive Intelligence tool itself in Now Assist Skill kit since there is no configuration available besides just selecting the 'Solution label'.

 

As a work around to keep going, I instead opted to add an additional script tool and call the solution directly using the below script. This is working for me.  Just replace with your solution name obviously. 

(function runScript(context) {

    var solutionName =
        "ml_yoursolutionnamehere";

    try {

        var shortDescription =
            context.getValue("incident.short_description") || "";

        var description =
            context.getValue("incident.description") || "";

        var mlSolution =
            sn_ml.MLSolutionFactory.getSolution(solutionName);

        var response =
            mlSolution.predict([{
                short_description: shortDescription,
                description: description
            }], {
                top_n: 3
            });

        var result = JSON.parse(response);
        var predictions = result["1"] || [];

        return JSON.stringify({
            prediction_found: predictions.length > 0,
            prediction_count: predictions.length,
            predictions: predictions.map(function(p) {
                return {
                    assignment_group: p.predictedValue || "",
                    assignment_group_sys_id: p.predictedSysId || "",
                    confidence: p.confidence || 0,
                    threshold: p.threshold || 0
                };
            })
        });

    } catch (e) {

        return JSON.stringify({
            prediction_found: false,
            error: e.message
        });
    }

})(context);

 

View solution in original post

6 REPLIES 6

Thank you @qprinsloo for the reply and as well your new approach. 

 

It makes sense on what you came up with to avoid the nuances of adding another tool to the mix when and if all can be produced at the agent layer. So to help me understand this correctly, the 4 layers at the skill kit level: fetchDetailsIncident (Script), fetchingAssignmentGroups (Script), Incident Search(RAG), and PI group prediction (PI) is now all at the agent layer in their respective containers of either a Record Operation, Script or Search Retrieval. All the same input/output, filters etc. can be configured exactly in the same manner within the Agent layer. 

 

As I was new to the NASK function, I was not as comfortable in really understanding the concept even though it was laid out in the previous community post. So I appreciate your response and thank you again for the assistance. 

 

UPDATE:

I tried to create a similar agent as you have outlined, but for some odd reason I'm not getting past the Get Incident Details tool. I'm reviewing my other tools at the Record Operations container, but it's not moving forward. 

Also, I tried creating the Script Tool in NASK in replace of the PI tool and with your script (and some minor adjustments to accommodate business requirements) and I was able to get the PI to work and actually output results. However, I would prefer to build in the same agent layer so I'll troubleshoot further on why my other tools are not launching. 

 

Hi @qprinsloo ,

Thank you very much for your recommendation, calling the solution directly via a script tool worked perfect.

Additionally, Could you please share the prompt you used in the AI ​​agent to which you moved the custom skill logic?

Thanks in advance and have a great week ahead!