@onereach/idw-init-account-resources 0.14.0 → 0.14.1

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.
@@ -1,5 +1,5 @@
1
1
   WARN  Issue while reading "/builds/onereach/platform/idw/idw-template/.npmrc". Failed to replace env in config: ${OR_NPM_TOKEN}
2
2
 
3
- > @onereach/idw-init-account-resources@0.13.0 build /builds/onereach/platform/idw/idw-template/packages/init/idw-init-account-resources
3
+ > @onereach/idw-init-account-resources@0.14.0 build /builds/onereach/platform/idw/idw-template/packages/init/idw-init-account-resources
4
4
  > rimraf dist && tsc -b && mkdir dist/assets/skills/documentation && cp -r src/assets/skills/documentation/* dist/assets/skills/documentation
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @onereach/idw-init-account-resources
2
2
 
3
+ ## 0.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4e42ca4: fix: use search order in datasources
8
+
3
9
  ## 0.14.0
4
10
 
5
11
  ### Minor Changes
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ module.exports = {
40
+ up: function (queryInterface) {
41
+ return __awaiter(this, void 0, void 0, function () {
42
+ return __generator(this, function (_a) {
43
+ switch (_a.label) {
44
+ case 0: return [4, queryInterface.sequelize.query("\n ALTER TABLE models\n DROP COLUMN IF EXISTS search_order,\n DROP COLUMN IF EXISTS parent_model_id;\n\n ALTER TABLE datasources\n ADD COLUMN IF NOT EXISTS search_order SMALLINT DEFAULT 1;\n ")];
45
+ case 1:
46
+ _a.sent();
47
+ return [2];
48
+ }
49
+ });
50
+ });
51
+ },
52
+ down: function (queryInterface) {
53
+ return __awaiter(this, void 0, void 0, function () {
54
+ return __generator(this, function (_a) {
55
+ switch (_a.label) {
56
+ case 0: return [4, queryInterface.sequelize.query('ALTER TABLE datasources DROP COLUMN IF EXISTS search_order;')];
57
+ case 1:
58
+ _a.sent();
59
+ return [2];
60
+ }
61
+ });
62
+ });
63
+ },
64
+ };
65
+ //# sourceMappingURL=20250401092323-datasource-search-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20250401092323-datasource-search-order.js","sourceRoot":"","sources":["../../../src/assets/db_migrations/20250401092323-datasource-search-order.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKb,MAAM,CAAC,OAAO,GAAG;IACT,EAAE,YAAC,cAAoE;;;;4BAC3E,WAAM,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,6NAOpC,CAAC,EAAA;;wBAPF,SAOE,CAAC;;;;;KACJ;IAEK,IAAI,YAAC,cAAwE;;;;4BACjF,WAAM,cAAc,CAAC,SAAS,CAAC,KAAK,CAClC,6DAA6D,CAC9D,EAAA;;wBAFD,SAEC,CAAC;;;;;KACH;CACF,CAAC"}
@@ -17,6 +17,7 @@ var knowledge = {
17
17
  answerPrompt: 'You are a helpful assistant. Generate answer on behalf of group of people who work for the company.\nAnswer has to use ONLY information strictly from provided Context. If you can`t answer the question using Context\nor the information from provided Context is not enough to answer the question, return not found. Try to save\noriginal formatting of Context, so if there is a list in Context, your answer may also contain a list. Provide\nan answer as detailed as possible. Generate the answer in original language.\n\nContext:{context}\nQuestion:{question}\nHelpful Answer:',
18
18
  questionPrompt: 'Generate a Standalone question using the original language that accurately rephrases the Follow Up Input. However,\nif the Follow Up Input is unrelated to the chat history or if there is no chat history available, the Follow Up\nInput should be returned unchanged, without rephrasing.\n\nChat History:{chat_history}\nFollow Up Input:{question}\nStandalone question:',
19
19
  },
20
+ search_order: 1,
20
21
  };
21
22
  var skills = {
22
23
  name: 'Skills',
@@ -24,20 +25,32 @@ var skills = {
24
25
  config: {
25
26
  icon: null,
26
27
  config: {
27
- distance: 0.23,
28
+ distance: 0.25,
28
29
  limit: 5,
30
+ chunkSize: 10,
31
+ provider: 'openai',
32
+ model: 'gpt-4o-mini',
33
+ temperature: 0,
34
+ maxTokens: 2048,
35
+ historyCapacity: 10,
36
+ frequencyPenalty: 0,
37
+ presencePenalty: 0,
38
+ stop: null,
39
+ topP: 1,
40
+ n: 1,
29
41
  },
30
42
  },
31
43
  display_order: 50,
44
+ search_order: 1,
32
45
  };
33
46
  var gpt = {
34
47
  name: 'GPT',
35
48
  slug: 'gpt',
36
49
  icon_url: 'https://static.vecteezy.com/system/resources/previews/022/227/367/large_2x/openai-chatgpt-logo-icon-free-png.png',
37
50
  config: {
51
+ provider: 'openai',
38
52
  model: 'gpt-4o-mini',
39
53
  temperature: 0.4,
40
- distance: 0.23,
41
54
  maxTokens: 2048,
42
55
  historyCapacity: 10,
43
56
  frequencyPenalty: 0,
@@ -47,6 +60,7 @@ var gpt = {
47
60
  n: 1,
48
61
  systemPrompt: 'You are an AI assistant designed by the company OneReach.ai, to help the user achieve their goals. Your main function is to assist with tasks related to: ${ idw.description }. The user has defined your role as: ${ idw.role }. Your name is ${ idw.name }. Your focus should be on providing relevant, accurate, and helpful information to support the user in their specific needs and tasks. The response must follow markdown syntax.',
49
62
  },
63
+ search_order: 2,
50
64
  };
51
65
  var bing = {
52
66
  name: 'Websearch',
@@ -62,6 +76,7 @@ var bing = {
62
76
  topResultAsContent: false,
63
77
  },
64
78
  display_order: 50,
79
+ search_order: 2,
65
80
  };
66
81
  exports.datasources = [
67
82
  knowledge,
@@ -1 +1 @@
1
- {"version":3,"file":"datasources.js","sourceRoot":"","sources":["../../../src/assets/models/datasources.ts"],"names":[],"mappings":";;;AAEA,IAAM,SAAS,GAAyB;IACtC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE;QACN,QAAQ,EAAE,QAAQ;QAClB,KAAK,EA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SAAS;IACT,MAAM;IACN,GAAG;IACH,IAAI;CACL,CAAC"}
1
+ {"version":3,"file":"datasources.js","sourceRoot":"","sources":["../../../src/assets/models/datasources.ts"],"names":[],"mappings":";;;AAEA,IAAM,SAAS,GAAyB;IACtC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE;QACN,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,GAAG;QAChB,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,IAAI;QACf,eAAe,EAAE,CAAC;QAClB,gBAAgB,EAAE,CAAC;QACnB,eAAe,EAAE,CAAC;QAClB,KAAK,EAAE,EAAE;QACT,YAAY,EACV,+jBAA+jB;QACjkB,cAAc,EACZ,+WAA+W;KAClX;IACD,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF,IAAM,MAAM,GAAyB;IACnC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE;QACN,IAAI,EAAE,IAAI;QACV,MAAM,EAAE;YACN,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,CAAC;YACR,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,QAAQ;YAClB,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,IAAI;YACf,eAAe,EAAE,EAAE;YACnB,gBAAgB,EAAE,CAAC;YACnB,eAAe,EAAE,CAAC;YAClB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,CAAC;YACP,CAAC,EAAE,CAAC;SACL;KACF;IACD,aAAa,EAAE,EAAE;IACjB,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF,IAAM,GAAG,GAAyB;IAChC,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,kHAAkH;IAC5H,MAAM,EAAE;QACN,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,GAAG;QAChB,SAAS,EAAE,IAAI;QACf,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,CAAC;QACnB,eAAe,EAAE,CAAC;QAClB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,CAAC;QACP,CAAC,EAAE,CAAC;QACJ,YAAY,EAAE,8aAA8a;KAC7b;IACD,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF,IAAM,IAAI,GAAyB;IACjC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,yEAAyE;IACnF,MAAM,EAAE;QACN,KAAK,EAAE,CAAC;QACR,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,IAAI;QAChB,GAAG,EAAE,OAAO;QACZ,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,QAAQ;QACpB,kBAAkB,EAAE,KAAK;KAC1B;IACD,aAAa,EAAE,EAAE;IACjB,YAAY,EAAE,CAAC;CAChB,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,SAAS;IACT,MAAM;IACN,GAAG;IACH,IAAI;CACL,CAAC"}
@@ -6,28 +6,24 @@ var chatGpt = {
6
6
  description: 'An AI model that provides conversational responses on various topics',
7
7
  icon: 'chat',
8
8
  datasources: ['gpt'],
9
- search_order: 2,
10
9
  };
11
10
  var websearch = {
12
11
  name: 'Websearch',
13
12
  description: 'Searches the internet for up-to-date information, giving answers from current online sources for accurate responses',
14
13
  icon: 'screen_search_desktop',
15
14
  datasources: ['bing'],
16
- search_order: 2,
17
15
  };
18
16
  var skills = {
19
17
  name: 'Skills',
20
18
  description: 'Specialized tools that perform specific tasks within the IDW',
21
19
  icon: 'auto_awesome_motion',
22
20
  datasources: ['skills'],
23
- search_order: 1,
24
21
  };
25
22
  var knowledge = {
26
23
  name: 'Internal Knowledge',
27
24
  description: 'A data source of company-specific information that provides trusted, in-house answers aligned with organizational needs',
28
25
  icon: 'local_library',
29
26
  datasources: ['knowledge'],
30
- search_order: 1,
31
27
  };
32
28
  exports.models = [
33
29
  chatGpt,
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/assets/models/models.ts"],"names":[],"mappings":";;;AAmBA,IAAM,OAAO,GAAuB;IAClC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,sEAAsE;IACnF,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,CAAC,KAAK,CAAC;IACpB,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF,IAAM,SAAS,GAAuB;IACpC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,qHAAqH;IAClI,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,CAAC,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF,IAAM,MAAM,GAAuB;IACjC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,8DAA8D;IAC3E,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,CAAC,QAAQ,CAAC;IACvB,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF,IAAM,SAAS,GAAuB;IACpC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,yHAAyH;IACtI,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,CAAC,WAAW,CAAC;IAC1B,YAAY,EAAE,CAAC;CAChB,CAAC;AAEW,QAAA,MAAM,GAAG;IAGpB,OAAO;IACP,SAAS;IACT,MAAM;IACN,SAAS;CACV,CAAC"}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/assets/models/models.ts"],"names":[],"mappings":";;;AAEA,IAAM,OAAO,GAAuB;IAClC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,sEAAsE;IACnF,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,CAAC,KAAK,CAAC;CACrB,CAAC;AAEF,IAAM,SAAS,GAAuB;IACpC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,qHAAqH;IAClI,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,CAAC,MAAM,CAAC;CACtB,CAAC;AAEF,IAAM,MAAM,GAAuB;IACjC,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,8DAA8D;IAC3E,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,CAAC,QAAQ,CAAC;CACxB,CAAC;AAEF,IAAM,SAAS,GAAuB;IACpC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,yHAAyH;IACtI,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,CAAC,WAAW,CAAC;CAC3B,CAAC;AAEW,QAAA,MAAM,GAAG;IACpB,OAAO;IACP,SAAS;IACT,MAAM;IACN,SAAS;CACV,CAAC"}
@@ -161,13 +161,14 @@ var InitRdbResources = (function () {
161
161
  case 1:
162
162
  if (!(_i < datasources_1.length)) return [3, 4];
163
163
  ds = datasources_1[_i];
164
- return [4, sequelize.query("\n INSERT INTO datasources (name, slug, description, config, display_order, icon_url, is_default)\n VALUES (:name, :slug, :description, :config, :display_order, :icon_url, :is_default)\n ON CONFLICT (slug) DO UPDATE\n SET description = EXCLUDED.description,\n config = EXCLUDED.config,\n display_order = EXCLUDED.display_order,\n icon_url = EXCLUDED.icon_url,\n updated_at = NOW();\n ", {
164
+ return [4, sequelize.query("\n INSERT INTO datasources (name, slug, description, config, display_order, icon_url, is_default)\n VALUES (:name, :slug, :description, :config, :display_order, :icon_url, :is_default)\n ON CONFLICT (slug) DO UPDATE\n SET description = EXCLUDED.description,\n config = EXCLUDED.config,\n display_order = EXCLUDED.display_order,\n search_order = EXCLUDED.search_order,\n icon_url = EXCLUDED.icon_url,\n updated_at = NOW();\n ", {
165
165
  replacements: {
166
166
  name: ds.name,
167
167
  slug: ds.slug,
168
168
  description: ds.description || null,
169
169
  config: ds.config ? JSON.stringify(ds.config) : null,
170
170
  display_order: ds.display_order || 10,
171
+ search_order: ds.search_order || 1,
171
172
  icon_url: ds.icon_url || null,
172
173
  is_default: true,
173
174
  },
@@ -185,14 +186,13 @@ var InitRdbResources = (function () {
185
186
  case 5:
186
187
  if (!(_a < models_2.length)) return [3, 12];
187
188
  model = models_2[_a];
188
- return [4, sequelize.query("\n INSERT INTO models (name, description, is_default, for_user_roles, icon, search_order)\n VALUES (:name, :description, :is_default, :for_user_roles, :icon, :search_order)\n ON CONFLICT (name) DO UPDATE\n SET description = EXCLUDED.description,\n is_default = EXCLUDED.is_default,\n for_user_roles = EXCLUDED.for_user_roles,\n icon = EXCLUDED.icon,\n search_order = EXCLUDED.search_order,\n updated_at = NOW()\n RETURNING id;\n ", {
189
+ return [4, sequelize.query("\n INSERT INTO models (name, description, is_default, for_user_roles, icon, search_order)\n VALUES (:name, :description, :is_default, :for_user_roles, :icon, :search_order)\n ON CONFLICT (name) DO UPDATE\n SET description = EXCLUDED.description,\n is_default = EXCLUDED.is_default,\n for_user_roles = EXCLUDED.for_user_roles,\n icon = EXCLUDED.icon,\n updated_at = NOW()\n RETURNING id;\n ", {
189
190
  replacements: {
190
191
  name: model.name,
191
192
  description: model.description || null,
192
193
  is_default: true,
193
194
  for_user_roles: model.for_user_roles ? JSON.stringify(model.for_user_roles) : null,
194
195
  icon: model.icon || null,
195
- search_order: model.search_order || 1,
196
196
  },
197
197
  transaction: transaction,
198
198
  })];
@@ -1 +1 @@
1
- {"version":3,"file":"rdb.js","sourceRoot":"","sources":["../../src/initializers/rdb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAsC;AACtC,+BAAgD;AAEhD,8CAAwB;AACxB,uCAAsC;AAQtC,2CAAuD;AACvD,6CAAqD;AAErD;IAKE,0BAAY,EAA+C;YAA7C,KAAK,WAAA,EAAE,YAAY,kBAAA;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK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AAE,UAAU;4BACnB,OAAO,EAAE,KAAK;yBACf,CAAC,CAAC;;;;wBAGe,WAAM,gBAAgB,CAAC,KAAK,CAAC,kFAIhD,EAAE;gCACC,YAAY,EAAE;oCACZ,OAAO,EAAE,0BAAgB,CAAC,IAAI;iCAC/B;6BACF,CAAC,EAAA;;wBARK,OAAO,GAAI,CAAA,SAQhB,CAAA,GARY;wBAUR,kBAAkB,GAAG,MAAC,OAAO,CAAC,CAAC,CAAqB,0CAAE,EAAE,CAAC;wBAE/D,WAAM,SAAS,CAAC,KAAK,CAAC,gGAIrB,EAAE;gCACD,YAAY,EAAE;oCACZ,KAAK,EAAE,kBAAkB;iCAC1B;6BACF,CAAC,EAAA;;wBARF,SAQE,CAAC;;;;wBAEH,OAAO,CAAC,KAAK,CAAC,mDAAmD,EAAE,GAAC,CAAC,CAAC;;4BAEtE,WAAM,gBAAgB,CAAC,KAAK,EAAE,EAAA;;wBAA9B,SAA8B,CAAC;;;;;;KAElC;IACH,uBAAC;AAAD,CAAC,AAzND,IAyNC;AAzNY,4CAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/idw-init-account-resources",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Creation of required resources in OneReach account to enable IDW",
5
5
  "license": "UNLICENSED",
6
6
  "contributors": [
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+ import { QueryInterface, Sequelize } from 'sequelize';
3
+
4
+
5
+ /** @type {import('sequelize-cli').Migration} */
6
+ module.exports = {
7
+ async up(queryInterface: QueryInterface & {context: {sequelize: Sequelize;};}) {
8
+ await queryInterface.sequelize.query(`
9
+ ALTER TABLE models
10
+ DROP COLUMN IF EXISTS search_order,
11
+ DROP COLUMN IF EXISTS parent_model_id;
12
+
13
+ ALTER TABLE datasources
14
+ ADD COLUMN IF NOT EXISTS search_order SMALLINT DEFAULT 1;
15
+ `);
16
+ },
17
+
18
+ async down(queryInterface: QueryInterface & { context: { sequelize: Sequelize; }; }) {
19
+ await queryInterface.sequelize.query(
20
+ 'ALTER TABLE datasources DROP COLUMN IF EXISTS search_order;'
21
+ );
22
+ },
23
+ };
@@ -18,6 +18,7 @@ const knowledge: DatasourceDefinition = {
18
18
  questionPrompt:
19
19
  'Generate a Standalone question using the original language that accurately rephrases the Follow Up Input. However,\nif the Follow Up Input is unrelated to the chat history or if there is no chat history available, the Follow Up\nInput should be returned unchanged, without rephrasing.\n\nChat History:{chat_history}\nFollow Up Input:{question}\nStandalone question:',
20
20
  },
21
+ search_order: 1,
21
22
  };
22
23
 
23
24
  const skills: DatasourceDefinition = {
@@ -26,11 +27,23 @@ const skills: DatasourceDefinition = {
26
27
  config: {
27
28
  icon: null,
28
29
  config: {
29
- distance: 0.23,
30
+ distance: 0.25,
30
31
  limit: 5,
32
+ chunkSize: 10,
33
+ provider: 'openai',
34
+ model: 'gpt-4o-mini',
35
+ temperature: 0,
36
+ maxTokens: 2048,
37
+ historyCapacity: 10,
38
+ frequencyPenalty: 0,
39
+ presencePenalty: 0,
40
+ stop: null,
41
+ topP: 1,
42
+ n: 1,
31
43
  },
32
44
  },
33
45
  display_order: 50,
46
+ search_order: 1,
34
47
  };
35
48
 
36
49
  const gpt: DatasourceDefinition = {
@@ -38,9 +51,9 @@ const gpt: DatasourceDefinition = {
38
51
  slug: 'gpt',
39
52
  icon_url: 'https://static.vecteezy.com/system/resources/previews/022/227/367/large_2x/openai-chatgpt-logo-icon-free-png.png',
40
53
  config: {
54
+ provider: 'openai',
41
55
  model: 'gpt-4o-mini',
42
56
  temperature: 0.4,
43
- distance: 0.23,
44
57
  maxTokens: 2048,
45
58
  historyCapacity: 10,
46
59
  frequencyPenalty: 0,
@@ -50,6 +63,7 @@ const gpt: DatasourceDefinition = {
50
63
  n: 1,
51
64
  systemPrompt: 'You are an AI assistant designed by the company OneReach.ai, to help the user achieve their goals. Your main function is to assist with tasks related to: ${ idw.description }. The user has defined your role as: ${ idw.role }. Your name is ${ idw.name }. Your focus should be on providing relevant, accurate, and helpful information to support the user in their specific needs and tasks. The response must follow markdown syntax.',
52
65
  },
66
+ search_order: 2,
53
67
  };
54
68
 
55
69
  const bing: DatasourceDefinition = {
@@ -66,6 +80,7 @@ const bing: DatasourceDefinition = {
66
80
  topResultAsContent: false,
67
81
  },
68
82
  display_order: 50,
83
+ search_order: 2,
69
84
  };
70
85
 
71
86
  export const datasources = [
@@ -1,28 +1,10 @@
1
1
  import { IdwModelDefinition } from '../../types';
2
2
 
3
- // const internal: IdwModelDefinition = {
4
- // name: 'Internal',
5
- // icon: 'home',
6
- // for_user_roles: ['user', 'admin'],
7
- // datasources: ['knowledge', 'skills'],
8
- // search_order: 1,
9
- // visibility: 'none',
10
- // };
11
-
12
- // const external: IdwModelDefinition = {
13
- // name: 'External',
14
- // icon: 'public',
15
- // datasources: ['gpt', 'bing'],
16
- // search_order: 2,
17
- // visibility: 'none',
18
- // };
19
-
20
3
  const chatGpt: IdwModelDefinition = {
21
4
  name: 'ChatGPT',
22
5
  description: 'An AI model that provides conversational responses on various topics',
23
6
  icon: 'chat',
24
7
  datasources: ['gpt'],
25
- search_order: 2,
26
8
  };
27
9
 
28
10
  const websearch: IdwModelDefinition = {
@@ -30,7 +12,6 @@ const websearch: IdwModelDefinition = {
30
12
  description: 'Searches the internet for up-to-date information, giving answers from current online sources for accurate responses',
31
13
  icon: 'screen_search_desktop',
32
14
  datasources: ['bing'],
33
- search_order: 2,
34
15
  };
35
16
 
36
17
  const skills: IdwModelDefinition = {
@@ -38,7 +19,6 @@ const skills: IdwModelDefinition = {
38
19
  description: 'Specialized tools that perform specific tasks within the IDW',
39
20
  icon: 'auto_awesome_motion',
40
21
  datasources: ['skills'],
41
- search_order: 1,
42
22
  };
43
23
 
44
24
  const knowledge: IdwModelDefinition = {
@@ -46,12 +26,9 @@ const knowledge: IdwModelDefinition = {
46
26
  description: 'A data source of company-specific information that provides trusted, in-house answers aligned with organizational needs',
47
27
  icon: 'local_library',
48
28
  datasources: ['knowledge'],
49
- search_order: 1,
50
29
  };
51
30
 
52
31
  export const models = [
53
- // internal,
54
- // external,
55
32
  chatGpt,
56
33
  websearch,
57
34
  skills,
@@ -105,6 +105,7 @@ export class InitRdbResources {
105
105
  SET description = EXCLUDED.description,
106
106
  config = EXCLUDED.config,
107
107
  display_order = EXCLUDED.display_order,
108
+ search_order = EXCLUDED.search_order,
108
109
  icon_url = EXCLUDED.icon_url,
109
110
  updated_at = NOW();
110
111
  `,
@@ -115,6 +116,7 @@ export class InitRdbResources {
115
116
  description: ds.description || null,
116
117
  config: ds.config ? JSON.stringify(ds.config) : null,
117
118
  display_order: ds.display_order || 10,
119
+ search_order: ds.search_order || 1,
118
120
  icon_url: ds.icon_url || null,
119
121
  is_default: true,
120
122
  },
@@ -134,7 +136,6 @@ export class InitRdbResources {
134
136
  is_default = EXCLUDED.is_default,
135
137
  for_user_roles = EXCLUDED.for_user_roles,
136
138
  icon = EXCLUDED.icon,
137
- search_order = EXCLUDED.search_order,
138
139
  updated_at = NOW()
139
140
  RETURNING id;
140
141
  `,
@@ -145,7 +146,6 @@ export class InitRdbResources {
145
146
  is_default: true,
146
147
  for_user_roles: model.for_user_roles ? JSON.stringify(model.for_user_roles) : null,
147
148
  icon: model.icon || null,
148
- search_order: model.search_order || 1,
149
149
  },
150
150
  transaction,
151
151
  }
package/src/types.ts CHANGED
@@ -90,6 +90,7 @@ export type DatasourceDefinition = {
90
90
  description?: string;
91
91
  config?: Record<string, unknown>;
92
92
  is_default?: boolean;
93
+ search_order?: number;
93
94
  display_order?: number;
94
95
  icon_url?: string;
95
96
  created_by?: string;
@@ -100,10 +101,8 @@ export type IdwModelDefinition = {
100
101
  name: string;
101
102
  description?: string;
102
103
  for_user_roles?: string[];
103
- parent_model_id?: string;
104
104
  is_default?: boolean;
105
105
  icon?: string;
106
- search_order?: number;
107
106
  visibility?: 'none' | 'user' | 'account' | null;
108
107
  created_by?: string;
109
108
  updated_by?: string;