Reference

Inskill.GPT

ask(question, [data, references])

var question = `
summarize the likely issue based on the provided error codes and suggest recommended next steps.
format: "Error Codes: '...' (bullet list)
Likely Issue: '...'
Recommended Actions: '...'"`;

/** ask question */
Inskill.GPT.ask(question);

/** ask "hidden" question */
Inskill.GPT.ask(question, { mvn: { hide_question: true }});

/** ask question & provide additional references */
var references = [{ title: '...', content: '...' }];
Inskill.GPT.ask(question, {}, references);

Inskill.Session

Properties

  • task - the name of the task
  • start - timestamp when the task started. unix style seconds since time began in 1970. Use the package moment to format into readable string, etc.
  • end - timestamp when the task ended (optional, if task has ended)
  • data - the raw set of data as an object
  • code - handoff code (optional)
  • language - the language used, in 2 letter code eg "en", "fr", "ch"
  • step_count - the number of steps used in the task. Will be 0 for context augmentation

hasData(key)

ds.hasData(key) - where key refers to the name of a variable in the data set. Use to test if the key has a value

if (Inskill.Session.hasData("pressure")) {
  // do something with Inskill.Session.getData("pressure")
}

getData(key)

safely get the value of a variable, or null

setData(key, value)

set a variable in the task's data

removeData(key)

remove an existing variable

getOwner()

hasAsset()

url([navcode, portal])

sendEmail(email, [body, subject])

send email to the to address. Default is json of the task. Include the body and subject to format the email to be readable

Inskill.Session.sendEmail("[email protected]"); 
let body = `Support escalation \n asset ${Inskill.Session.asset.sn}`;
Inskill.Session.sendEmail("[email protected]", body, "Escalation"); 

userLog(message)

writes the message into userlog, can log escalations, tasks with problem conditions, etc.

createAsset(sn, [name])


Inskill.Session.asset

Properties:

  • sn
  • name
  • product_id
  • data
  • url
  • notes
  • groups

hasData(key)

ds.hasData(key) - where key refers to the name of a variable in the data set. Use to test if the key has a value

if (Inskill.Session.Asset.hasData("pressure")) {
  // do something with Inskill.Session.Asset.getData("pressure")
}

getData(key)

safely get the value of a variable, or null

setData(key, value)

set a variable in the task's data

removeData(key)

remove an existing variable

Inskill.Utils

empty(obj)

getData(path, obj)

setData(path, value, obj)

webRequest(options)

var options = {
   method: 'GET' // GET, POST, PATCH, DELETE
   url: 'https://weather.com/' + Inskill.Session.getData('zipcode'),
   headers: {
        'X-API-Key':'XUQJbhZGL1DnOWygBg5nati0NDzFuD26Aw_LtrHssX_0k6GbVsWY11R46cCg'
   },
   data: {}
}

/** AWAIT */
var { error, body, response } = await Inskill.Utils.webRequest(options);
console.log(body);
session.done();


/** JS PROMISE */
Inskill.Utils.webRequest(options).then(function({ error, response, body }) {
   console.log(body);
   session.done();
});