@tiledesk/tiledesk-tybot-connector 2.0.34 → 2.0.35

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "2.0.34",
3
+ "version": "2.0.35",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -71,7 +71,7 @@ class DirAskGPTV2 {
71
71
  // default values
72
72
  let answer = "No answers";
73
73
  let namespace = this.context.projectId;
74
- let llm;
74
+ let llm = "openai";
75
75
  let model;
76
76
  let temperature;
77
77
  let max_tokens;
@@ -99,6 +99,9 @@ class DirAskGPTV2 {
99
99
  }
100
100
 
101
101
  let source = null;
102
+ if (!action.llm) {
103
+ action.llm = "openai";
104
+ }
102
105
 
103
106
  await this.checkMandatoryParameters(action).catch( async (missing_param) => {
104
107
  this.logger.error(`[Ask Knowledge Base] missing attribute '${missing_param}'`);
@@ -116,6 +119,9 @@ class DirAskGPTV2 {
116
119
  if (action.namespace) {
117
120
  namespace = action.namespace;
118
121
  }
122
+ if (action.llm) {
123
+ llm = action.llm;
124
+ }
119
125
  if (action.model) {
120
126
  model = action.model;
121
127
  }
@@ -172,8 +178,10 @@ class DirAskGPTV2 {
172
178
  let key;
173
179
  let publicKey = false;
174
180
  let ollama_integration;
181
+ let vllm_integration;
175
182
 
176
183
  if (action.llm === 'ollama') {
184
+ key = process.env.GPTKEY;
177
185
  ollama_integration = await integrationService.getIntegration(this.projectId, action.llm, this.token).catch( async (err) => {
178
186
  this.logger.error("[Ask Knowledge Base] Error getting ollama integration.");
179
187
  await this.chatbot.addParameter("flowError", "Ollama integration not found");
@@ -185,7 +193,22 @@ class DirAskGPTV2 {
185
193
  callback();
186
194
  return;
187
195
  })
188
- } else {
196
+ }
197
+ else if (action.llm === 'vllm') {
198
+ key = process.env.GPTKEY;
199
+ vllm_integration = await integrationService.getIntegration(this.projectId, action.llm, this.token).catch( async (err) => {
200
+ this.logger.error("[Ask Knowledge Base] Error getting vllm integration.");
201
+ await this.chatbot.addParameter("flowError", "vLLM integration not found");
202
+ if (falseIntent) {
203
+ await this.#executeCondition(false, trueIntent, trueIntentAttributes, falseIntent, falseIntentAttributes);
204
+ callback(true);
205
+ return;
206
+ }
207
+ callback();
208
+ return;
209
+ })
210
+ }
211
+ else {
189
212
  key = await integrationService.getKeyFromIntegrations(this.projectId, action.llm, this.token);
190
213
 
191
214
  if (!key && action.llm === 'openai') {