3.6 KiB

IVA Studio Workspace

Place to put random files and examples used in IVA Workspaces

Channel Automation

Interaction Notification API

Interaction Notification API is used to push Call Pops into Channel Automation.

Prerequisits

  1. Install and configure the Channel Automation Interface Package from Resource Center -> Hub.
  2. Download then Import INAPI Package

Source Code

INAPI Global Variable Function

Example Usage

Conversation Flow Code Block that calls the API with some data and user name 'ccmary'

(async () => {
  const ani = recognizedObject.metadata.ani;
  const dnis = recognizedObject.metadata.dnis;
  const firstName = conversationData.customer?.firstName ?? "FirstName";
  const lastName = conversationData.customer?.lastName ?? "LastName";
  const studentId = conversationData.customer?.studentId ?? "StudentId";
  const dob = conversationData.customer?.dob ?? "1/1/1970";
  INAPI().post(`${ani}`, `${dnis}`, "ccmary", {
    "@type": "ved:TelephonyCallDataED",
    "ved:firstName": `${firstName}`,
    "ved:lastName": `${lastName}`,
    "ved:studentId": `${studentId}`,
    "ved:dob": `${dob}`,
  });
})()
  .catch((error) => {
    console.log(error.message);
    recognizedObject.answers.push("");
    recognizedObject.errorInfo = {
      ...recognizedObject.errorInfo,
      label: {
        data: error.toJSON ? error.toJSON() : {},
        message: error.message,
      },
    };
  })
  .finally(() => {
    next();
  });

Basic Messenger

Built for PoCs with other Speech Services, this provides a simple text from a prompt interface for IVA Studio

Prerequisits

  1. Install and configure the Core Messenger Webhook Package from the Resource Center -> Hub.

Source Code

basic_messenger Proxy Script

Example usage

curl --location 'https://router.ivastudio.verint.live/ProxyScript/run/67bca862210071627d32ef12/current/basic_messenger' \
--header 'Content-Type: application/json' \
--data '{
    "input" : "What is the weather",
    "model" : "main"
}'
{
  "id": "resp_c8191807-c478-41d0-a73c-68d361eae5a3",
  "object": "response",
  "created_at": 1745609535,
  "status": "completed",
  "model": "main",
  "output": [
    {
      "type": "message",
      "id": "msg_56594e02-ae08-47ce-8c7f-d5165b1fa9de",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "Could you please provide a city or a zip code to get the weather information?",
          "annotations": []
        }
      ]
    }
  ]
}

Note the use of "previous_response_id" to manage conversation state.

curl --location 'https://router.ivastudio.verint.live/ProxyScript/run/67bca862210071627d32ef12/current/basic_messenger' \
--header 'Content-Type: application/json' \
--data '{
    "input" : "Chicago",
    "model" : "main",
    "previous_response_id" : "resp_c8191807-c478-41d0-a73c-68d361eae5a3"
}'
{
    "id": "resp_c8191807-c478-41d0-a73c-68d361eae5a3",
    "object": "response",
    "created_at": 1745609627,
    "status": "completed",
    "model": "main",
    "output": [
        {
            "type": "message",
            "id": "msg_ef591b4c-b08b-49fe-85a5-306c94269bf6",
            "role": "assistant",
            "content": [
                {
                    "type": "output_text",
                    "text": "Can you provide the zip code for Chicago?",
                    "annotations": []
                }
            ]
        }
    ]
}