Skip to content

Commit f7a7100

Browse files
authored
Merge pull request #613 from Cognigy/deprecate/get-conversation-node
removed deprecated flow nodes
2 parents a41d426 + ab2500a commit f7a7100

File tree

10 files changed

+174
-1060
lines changed

10 files changed

+174
-1060
lines changed

extensions/cognigy/README.md

+1-144
Original file line numberDiff line numberDiff line change
@@ -2,149 +2,6 @@
22

33
This Extension provides basic nodes to extend the Cognigy.AI core features.
44

5-
## Node: Send Email With Attachment
6-
7-
This node lets you send emails with attached files, like for example PDF, JPEG or Word files. To send an actual mail, the following arguments have to be defined:
8-
9-
- **Connection**:
10-
You need to create a Connection. Name is for example 'Email Connection' or something similar. Now you need some Connection keys:
11-
- Email Server Hostname:
12-
- key: **host**
13-
- value: *The STMP host of your Mailserver. Please ask your administrator.*
14-
- Email Server Port:
15-
- key: **port**
16-
- value: The port of your email server; 465 or 587
17-
- Email Server Security Option:
18-
- key: **security**
19-
- value: `TLS`, `STARTTLS` or `NONE`
20-
- Email Username:
21-
- key: **user**
22-
- value: *The username of your Email account*
23-
- Email Password:
24-
- key: **password**
25-
- value: *The password of your Email Account*
26-
- **fromName**: *The name of the sender*
27-
- **fromEmail**: *The email address of the sender*
28-
- **to**: *The emails that should receive your message*
29-
- You can provide one or more emails by just adding them to the list:
30-
31-
- **subject**: *The email's subject*
32-
- **attachmentName**: *OPTIONAL. The name of your attached file*
33-
- Something like `file.pdf` if it is a PDF file
34-
- **attachmentUrl**: *If you want to send an attachment, you also have to define the path to the file; the URL*
35-
- Example: https://path-to-file.pdf
36-
- **IMPORTANT**: The path to the file has to public and accessible from the outer world!
37-
- **contextStore**: *How to store the result in the Cognigy Context. It's a simple name*
38-
- Example: `mailResponse`
39-
- **stopOnError**: *Wether to stop the Flow if something went wrong or not*
40-
41-
If everything went well so far, the mail should be sent to the receivers and the node stores a success message into the Cognigy Context:
42-
```json
43-
{
44-
"mail": "Message sent: <[email protected]>"
45-
}
46-
```
47-
48-
## Node: Get Conversation
49-
50-
Obtain a conversation transcript from the Cognigy analytics OData endpoint, typically for human consumption, and often for the current session making the request.
51-
52-
The conversation can be returned as **raw data**, or as **HTML** designed for email embedding, and which can also be styled by supplied CSS styles.
53-
54-
The Node can be used simply, with defaults, or a number of customisation options are available as outlined below.
55-
56-
### Configuration Fields:
57-
* **Cognigy API Connection**: Provide a Cognigy user's apiKey which has access to the required OData
58-
59-
* **OData Base URL**: Typically your Cognigy login server host, preceded by "https://odata-"
60-
61-
* **Conversation User ID**: The Cognigy userId to target - Use {{input.userId}} for the current session. May be left blank to search by Session ID alone
62-
63-
* **Conversation Session ID**: The Cognigy sessionId to obtain - Use {{input.sessionId}} for the current session. May be left blank to find multiple sessions for one user
64-
65-
* **Output Type**: JSON or HTML - See below
66-
67-
* **User Timezone Offset**: For HTML: Used to include 'user time' timestamps in the HTML transcript
68-
69-
### Store the result in 'input' or 'context'
70-
Results can be marshaled into, for example, input.conversation or context.conversation.
71-
72-
'input' is recommended to avoid exceeding the default limit of context (around 500kB by default).
73-
74-
### Result structure
75-
The result, placed in input.conversation or context.conversation (per defaults and selections), will be structured like so:
76-
```typescript
77-
{
78-
// The channel (first evident in the session)
79-
channel: "webchat" | "adminconsole" | "facebook" | etc,
80-
81-
// If the HTML Output Type option is requested:
82-
html: "<table ...> Table contents... </table>",
83-
84-
// If the JSON Output Type is requested:
85-
transcript: [
86-
{
87-
type: 'input' | 'output',
88-
source: 'user' | 'bot',
89-
text: '[The text transcript from Default or Channel]',
90-
data: {}, // Optional data object
91-
timestamp: '2020-08-07T05:15:07.597Z' // - UTC time for JSON Output Type
92-
sessionId: 'someSessionId' // - Present only if Session ID blank in input parameters
93-
},
94-
{
95-
// Next transcript in time order
96-
},
97-
{
98-
// etc
99-
}
100-
]
101-
}
102-
```
103-
104-
### JSON output option
105-
With the Output Type set to JSON, a JSON array will be returned as shown above, containing a minimal set of analytics fields per interaction, to keep the data size to a minimum.
106-
107-
### HTML output option
108-
With the Output Type set to HTML, the transcript will be returned as one long string, containing a formatted html \<table\> element with columns of Time, Source and Text transcript.
109-
110-
CSS styles are 'inlined', and extraneous whitespace is ommitted, as this results in the most broad compatibility with many and varied email client software.
111-
112-
#### User Timezone Offset
113-
To be able to display chat transcript times in a time accurate for the user, we need to know what timezone the user is (was) in. Supply this here as an hours offset like "-4" (for New York, USA) or "+10" (for Sydney, Australia). For half-hour offsets, use minutes like "-90" for 1.5 hours.
114-
115-
If the user's Timezone is not known, it is suggested to pick some logical/likely fixed timezone, and then use ```input.GetConversationTimeFormat``` as described below to _state_ the timezone (e.g. CET or AEDT) in the time format string. e.g. "(17:43:20 CET)".
116-
117-
#### 'bot' and 'user' labels
118-
If you wish to change the labels of 'bot' and 'user' in the output, you can do so via string-replace in the resultant html string, replacing "```>bot<```" with (for example) "```>Virtual Assistant<```"; or similarly for "```>user<```". Be sure to maintain the 'greater than' and 'less than' symbols at the ends of each string.
119-
120-
#### Adding a heading row
121-
If you wish to add a heading row, there is a string in the returned html: ```<!--FirstRow--\>``` which can be string-replaced with your desired first row made up of ```<tr>``` and ```<td>``` tags. Note that you must supply your own inline styling to these tags, if desired.
122-
123-
#### HTML styling
124-
By default, the HTML table will be styled with the styles shown below.
125-
126-
Note that there are styles for the table itself, and then for each one of bot/user, you can modify the row (tr) and data-cell (td) styles.
127-
```html
128-
<style>
129-
table { font-family: arial; border-collapse: collapse; outline:thin solid; }
130-
tr { padding: 8; }
131-
td { padding: 8; }
132-
tr.bot { background: #DDDDFF; }
133-
tr.user {}
134-
td.user-time {}
135-
td.bot-time {}
136-
td.user-source {}
137-
td.bot-source {}
138-
td.user-text { font-weight: bold; }
139-
td.bot-text {}
140-
</style>
141-
```
142-
The styles are forced 'inline' into the final html table to maximise compatibility with email clients.
143-
If you wish to alter any styling, copy the complete style tag above, make your modifications, and set in the variable ```input.GetConversationStyles``` before calling the custom module.
144-
145-
Similarly, the time format can be altered via ```input.GetConversationTimeFormat```, which default to ```[(]HH:mm:ss[)]```. See the [moment formatting options](https://momentjs.com/docs/#/displaying/format) for details.
146-
147-
1485
## Node: Intent Disambiguation
1496

1507
This node reviews the intent mapper result from the Cognigy NLU and finds intents that are within the specified score delta. These intents are recorded and saved in order of similarity to the Cognigy Context. The disambiguation sentences for each intent can also posted back to the user as quick replies, a list or plaintext with a specified `text` message. A maximum of **three** disambiguation sentences in addition to the main intent disambiguation sentence will be posted back.
@@ -193,7 +50,7 @@ The stored response looks like the following:
19350
}
19451
}
19552
```
196-
### Node: Display Options
53+
### Display Options
19754

19855
Here is a brief summary of the additional options.
19956

0 commit comments

Comments
 (0)