@stackfactor/client-api 1.1.20 → 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 +12 -5
- package/package.json +1 -1
package/lib/aiAssistant.js
CHANGED
|
@@ -21,7 +21,7 @@ export const askQuestion = (
|
|
|
21
21
|
updatedContext: updatedContext,
|
|
22
22
|
};
|
|
23
23
|
let confirmationRequest = client.post(
|
|
24
|
-
"/api/v1/
|
|
24
|
+
"/api/v1/aiassistant/askquestion",
|
|
25
25
|
{ data: data },
|
|
26
26
|
{
|
|
27
27
|
headers: { authorization: token },
|
|
@@ -49,7 +49,7 @@ export const endConversation = (conversationId, token) => {
|
|
|
49
49
|
conversationId: conversationId,
|
|
50
50
|
};
|
|
51
51
|
let confirmationRequest = client.post(
|
|
52
|
-
"/api/v1/
|
|
52
|
+
"/api/v1/aiassistant/endconversation",
|
|
53
53
|
{ data: data },
|
|
54
54
|
{
|
|
55
55
|
headers: { authorization: token },
|
|
@@ -74,7 +74,7 @@ export const endConversation = (conversationId, token) => {
|
|
|
74
74
|
const getConversationByElementId = (elementId, token) => {
|
|
75
75
|
return new Promise(function (resolve, reject) {
|
|
76
76
|
let confirmationRequest = client.get(
|
|
77
|
-
`/api/v1/
|
|
77
|
+
`/api/v1/aiassistant/getconversation/${elementId}`,
|
|
78
78
|
{
|
|
79
79
|
headers: { authorization: token },
|
|
80
80
|
}
|
|
@@ -96,24 +96,31 @@ 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
|
-
"/api/v1/
|
|
123
|
+
"/api/v1/aiassistant/startconversation",
|
|
117
124
|
{ data: data },
|
|
118
125
|
{
|
|
119
126
|
headers: { authorization: token },
|