@stackfactor/client-api 1.1.21 → 1.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/aiAssistant.js +8 -1
- package/package.json +1 -1
package/lib/aiAssistant.js
CHANGED
|
@@ -96,22 +96,29 @@ const getConversationByElementId = (elementId, token) => {
|
|
|
96
96
|
* @param {String} context
|
|
97
97
|
* @param {Boolean} autoContextRefresh
|
|
98
98
|
* @param {String} token
|
|
99
|
+
* @param {String} conversationId Optional
|
|
99
100
|
* @returns {Promise}
|
|
100
101
|
*/
|
|
101
102
|
const startConversation = (
|
|
102
103
|
elementId,
|
|
103
104
|
elementType,
|
|
105
|
+
question,
|
|
104
106
|
context,
|
|
105
107
|
autoContextRefresh,
|
|
106
|
-
token
|
|
108
|
+
token,
|
|
109
|
+
conversationId = null
|
|
107
110
|
) => {
|
|
108
111
|
return new Promise(function (resolve, reject) {
|
|
109
112
|
let data = {
|
|
110
113
|
autoContextRefresh: autoContextRefresh,
|
|
111
114
|
context: context,
|
|
115
|
+
question: question,
|
|
112
116
|
elementId: elementId,
|
|
113
117
|
elementType: elementType,
|
|
114
118
|
};
|
|
119
|
+
if (conversationId) {
|
|
120
|
+
data.conversationId = conversationId;
|
|
121
|
+
}
|
|
115
122
|
let confirmationRequest = client.post(
|
|
116
123
|
"/api/v1/aiassistant/startconversation",
|
|
117
124
|
{ data: data },
|