Refactored to flow Hub Packaging directory structures

This commit is contained in:
Peter Morton 2025-05-27 18:24:39 -05:00
parent 93362b209b
commit 73294b19b4
24 changed files with 222 additions and 174 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
Applications/basic-messenger-cli/node_modules
basic-messenger-cli/application/node_modules

50
CA_INAPI/README.md Normal file
View File

@ -0,0 +1,50 @@
# 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 into you IVA Workspace [INAPI Package](_studio_dependencies/ConversationFlowExport/IVA-Solution-Consultants_Peter's-Workspace_INAPI_e8063074-0129-41df-9a40-2f5386b0b3d5.json)
3. Follow instructions for [Configuring Telephony Call Data Fields](https://em-docs.verint.com/15_3/em-channels/Content/Telephony/Configuring_Telephony_Call_Data_Fields.htm) in Channel Automation
4. Follow instructions for [Configure Call Information Views](https://em-docs.verint.com/15_3/em-channels/Content/Configuring_the_Transfer_Bot__Voice_.htm)
## Source Code
[INAPI](./_studio_dependencies/Global%20Variable/INAPI.js) Global Variable Function
## Example Usage
Conversation Flow Code Block that calls the API with some data and user name 'ccmary'
```javascript
(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();
});
```

View File

@ -1,17 +0,0 @@
(async () => {
await opentelemetry().endSpan();
})()
.catch((error) => {
console.log(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
};
})
.finally(() => {
next();
});

View File

@ -1,20 +0,0 @@
(async () => {
await latencySpan().endSpan(recognizedObject.conversationId);
const span = await opentelemetry().startSpan("Global Flow");
console.log(span);
})()
.catch((error) => {
console.log(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
};
})
.finally(() => {
next();
});

157
README.md
View File

@ -2,142 +2,33 @@
Place to put random files and examples used in IVA Workspaces
## Channel Automation
Each example follows the following directory structure taken from the IVAS Hub Packaging guidelines:
### Interaction Notification API
## Hub Package
Interaction Notification API is used to push Call Pops into Channel Automation.
Hub Package is configured through a few locations. Utilize the structure
below to understand the relationship and purpose of the different
files and locations.
#### Prerequisits
File content will have instances of {{ Hub Version }} replaced with the
identified version based on git Tag.
1. Install and configure the _Channel Automation Interface_ Package from Resource Center -> Hub.
2. Download then Import into you IVA Workspace [INAPI Package](./Exports/IVA-Solution-Consultants_Peter's-Workspace_INAPI_e8063074-0129-41df-9a40-2f5386b0b3d5.json)
3. Follow instructions for [Configuring Telephony Call Data Fields](https://em-docs.verint.com/15_3/em-channels/Content/Telephony/Configuring_Telephony_Call_Data_Fields.htm) in Channel Automation
4. Follow instructions for [Configure Call Information Views](https://em-docs.verint.com/15_3/em-channels/Content/Configuring_the_Transfer_Bot__Voice_.htm)
#### Source Code
[INAPI](./Integrations/Global%20Variables/INAPI.js) Global Variable Function
#### Example Usage
Conversation Flow Code Block that calls the API with some data and user name 'ccmary'
```javascript
(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](./Integrations/Proxy%20Scripts/basic_messenger.js) Proxy Script
### Example usage
```sh
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"
}'
/
├───\_studio\_dependencies/
│ ├───ConversationFlowExport/ -- Export of example conversation flows
│ ├───DynamicQuery/
│ ├───Engagement/
│ ├───GlobalVariable/
│ ├───ProxyScript/
│ ├───README.md -- Hub Readme Document
│ └───HubPackage.json -- Hub Name/Description and Official Verint Package
└───widget/
├───README.md -- General Development documentation
├───{widgetName}/
│ ├───\_studio\_dependencies/
│ │ └───README.md -- Widget Readme Document
│ ├───widget.config.json -- Widget Name and Description
│ └───README.md -- Development Notes for specific widget
└───{widgetName2}/
```
```json
{
"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.
```sh
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"
}'
```
```json
{
"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": []
}
]
}
]
}
```
#### CLI client for basic_messenger
You can find an example CLI client (using Node.js) [here](./Applications/basic-messenger-cli/)

View File

@ -0,0 +1,86 @@
# 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](./_studio_dependencies/ProxyScript/basic_messenger.js) Proxy Script
## Example usage
```sh
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"
}'
```
```json
{
"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.
```sh
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"
}'
```
```json
{
"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": []
}
]
}
]
}
```
#### CLI client for basic_messenger
You can find an example CLI client (using Node.js) [here](./application/)

View File

@ -11,9 +11,6 @@
"dependencies": {
"axios": "^1.9.0",
"dotenv": "^16.5.0"
},
"bin": {
"hello": "bin/index.js"
}
},
"node_modules/asynckit": {

52
open-telemetry/README.md Normal file
View File

@ -0,0 +1,52 @@
# Open Telemetery Example
## Example Usage
Use the _code block_ widget to start and end spans. Spans can be nested to form a stack, ending a span will always end the last span added to the stack.
### Start Span
```javascript
(async () => {
await latencySpan().endSpan(recognizedObject.conversationId);
const span = await opentelemetry().startSpan("Global Flow");
console.log(span);
})()
.catch((error) => {
console.log(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
};
})
.finally(() => {
next();
});
```
### End Span
```javascript
(async () => {
await opentelemetry().endSpan();
})()
.catch((error) => {
console.log(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
};
})
.finally(() => {
next();
});
```

View File

@ -0,0 +1 @@
# Salesforce Mock Proxy

View File

@ -1,3 +1,10 @@
# Test Harness Support files
The test harness uses Redis event pub/sub to receive notifications from IVA Studio.
## Example Usage
```javascript
(async () => {
webdis().publish(recognizedObject.workspaceId, {
conversationId: recognizedObject.conversationId,
@ -19,3 +26,4 @@
.finally(() => {
next();
});
```