@futdevpro/nts-dynamo 1.14.28 → 1.14.29

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.
Files changed (46) hide show
  1. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.d.ts +22 -0
  2. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.d.ts.map +1 -0
  3. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.js +187 -0
  4. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.js.map +1 -0
  5. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.d.ts +27 -0
  6. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.d.ts.map +1 -0
  7. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.js +277 -0
  8. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.js.map +1 -0
  9. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.d.ts +23 -0
  10. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.d.ts.map +1 -0
  11. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.js +319 -0
  12. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.js.map +1 -0
  13. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.d.ts +118 -0
  14. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.d.ts.map +1 -0
  15. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.js +460 -0
  16. package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.js.map +1 -0
  17. package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts +9 -1
  18. package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +1 -1
  19. package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js +14 -1
  20. package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js.map +1 -1
  21. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +49 -3
  22. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -1
  23. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js +72 -2
  24. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -1
  25. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +61 -3
  26. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
  27. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +190 -4
  28. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
  29. package/build/_modules/ai/_modules/open-ai/index.d.ts +4 -4
  30. package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -1
  31. package/build/_modules/ai/_modules/open-ai/index.js +6 -5
  32. package/build/_modules/ai/_modules/open-ai/index.js.map +1 -1
  33. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +1 -1
  34. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -1
  35. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +1 -1
  36. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
  37. package/package.json +1 -1
  38. package/src/_modules/ai/_modules/open-ai/_services/{oai-doc-chunk-data.service.ts → data-services/oai-doc-chunk-data.service.ts} +8 -8
  39. package/src/_modules/ai/_modules/open-ai/_services/{oai-doc-page.data-service.ts → data-services/oai-doc-page.data-service.ts} +8 -8
  40. package/src/_modules/ai/_modules/open-ai/_services/{oai-document.data-service.ts → data-services/oai-document.data-service.ts} +7 -7
  41. package/src/_modules/ai/_modules/open-ai/_services/{oai-vector-data.service.ts → data-services/oai-vector-data.service.ts} +4 -4
  42. package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts +18 -2
  43. package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +84 -3
  44. package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +240 -5
  45. package/src/_modules/ai/_modules/open-ai/index.ts +6 -5
  46. package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +1 -1
@@ -0,0 +1,460 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyNTS_OAI_VectorDataService = void 0;
4
+ const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
5
+ const fsm_dynamo_2 = require("@futdevpro/fsm-dynamo");
6
+ const open_ai_1 = require("@futdevpro/fsm-dynamo/ai/open-ai");
7
+ const global_settings_const_1 = require("../../../../../../_collections/global-settings.const");
8
+ const data_service_1 = require("../../../../../../_services/base/data.service");
9
+ const oai_embedding_control_service_1 = require("../oai-embedding.control-service");
10
+ /**
11
+ * Vector Data Service that is connected to the relevant DBServices
12
+ * extends {@link DyNTS_DataService}
13
+ *
14
+ * For the vectorization, you need to setup the index in the DB to something like this:
15
+ * (the path declared here must be the same as the vectorizeUseIndex in the {@link DyFM_DataProperty_Params})
16
+ * ```json
17
+ * {
18
+ * "fields": [
19
+ * {
20
+ * "type": "vector",
21
+ * "path": "contentVectorized",
22
+ * "numDimensions": 3072,
23
+ * "similarity": "cosine"
24
+ * }
25
+ * ]
26
+ * }
27
+ * ```
28
+ *
29
+ * @example
30
+ * export class UserMatchStatisticsService extends DyNTS_DataService<UserMatchStatistics> {
31
+ * constructor(
32
+ * set: {
33
+ * data?: UserMatchStatistics,
34
+ * openAISettings?: DyFM_OAI_Settings,
35
+ * issuer: string,
36
+ * }
37
+ * ) {
38
+ * super(
39
+ * new UserMatchStatistics(set?.data),
40
+ * userMatchStatisticsModelParams,
41
+ * set?.openAISettings ?? defaultOpenAISettings,
42
+ * set.issuer,
43
+ * );
44
+ * }
45
+ * }
46
+ */
47
+ class DyNTS_OAI_VectorDataService extends data_service_1.DyNTS_DataService {
48
+ openAISettings;
49
+ /**
50
+ * Properties that are vectorized
51
+ * (properties that are marked with vectorizeFrom in other properties)
52
+ */
53
+ vectorizeProperties;
54
+ vectorizedProperties;
55
+ /* readonly vectorizeProperties: { from: string, to: string }[]; */
56
+ debugLog = false;
57
+ swallowVectorizedProperties = true;
58
+ embedding_CS;
59
+ constructor(
60
+ /**
61
+ * Initial data, this will be used by functions on default
62
+ */
63
+ data,
64
+ /**
65
+ * DB data prams will be used to connect to usable dbService on GlobalService
66
+ */
67
+ dataParams,
68
+ /**
69
+ * OpenAI settings
70
+ */
71
+ openAISettings,
72
+ /**
73
+ * Initial set for issuer to be able to follow the issuer's activity
74
+ */
75
+ issuer) {
76
+ super(data, dataParams, issuer);
77
+ this.openAISettings = openAISettings;
78
+ this.vectorizedProperties = Object.values(dataParams.properties).filter((property) => property.vectorizedFrom);
79
+ this.vectorizeProperties = Object.keys(dataParams.properties).filter((key) => this.vectorizedProperties.some((property) => property.vectorizedFrom.includes(key))).map((key) => dataParams.properties[key]);
80
+ /* const vectorizePropertyKeys: string[] = Object.keys(dataParams.properties).filter(
81
+ (key: string): boolean => (
82
+ dataParams.properties[key] as DyFM_DataProperty_Params<any>
83
+ ).vectorizedFrom &&
84
+ (dataParams.properties[key] as DyFM_DataProperty_Params<any>).vectorizedFrom !== key
85
+ ); */
86
+ if (!openAISettings.config.apiKey) {
87
+ throw new fsm_dynamo_2.DyFM_Error({
88
+ ...this.getDefaultErrorSettings('constructor', new Error('openAISettings.config.apiKey is required')),
89
+ });
90
+ }
91
+ const model = openAISettings.defaultSettings.useModel ??
92
+ open_ai_1.DyFM_OAI_Model.textEmbedding_3Large;
93
+ /* if (
94
+ !DyFM_allOpenAIEmbeddingModels.includes(model)
95
+ ) {
96
+ throw new DyFM_Error({
97
+ ...this.getDefaultErrorSettings(
98
+ 'constructor',
99
+ new Error(`useModel "${model}" is not an embedding model!`)
100
+ ),
101
+ });
102
+ } */
103
+ if (!this.vectorizedProperties.length) {
104
+ throw new Error('vectorizedProperties is missing! ' +
105
+ `\nkeys with vectorizedFrom: ${Object.keys(dataParams.properties).filter((key) => Boolean(dataParams.properties[key].vectorizedFrom)).map(key => `"${key}"`).join(', ')}`);
106
+ }
107
+ if (!this.vectorizeProperties.length) {
108
+ throw new Error('vectorizeProperties is missing! ' +
109
+ `\nkeys with vectorizeFrom: ${Object.keys(dataParams.properties).filter((key) => Boolean(dataParams.properties[key].vectorizedFrom)).map(key => `"${key}"`).join(', ')}`);
110
+ }
111
+ /* if (!vectorizePropertyKeys.length) {
112
+ throw new Error(
113
+ 'vectorizedPropertyKeys is missing! ' +
114
+ `\nkeys with vectorizeFrom: ${Object.keys(dataParams.properties).filter(
115
+ (key: string): boolean => Boolean(
116
+ (dataParams.properties[key] as DyFM_DataProperty_Params<any>).vectorizedFrom
117
+ )
118
+ ).map(key => `"${key}"`).join(', ')}`
119
+ );
120
+ } */
121
+ /* vectorizePropertyKeys.forEach((key: string): void => {
122
+ dataParams.properties[key].embeddingModel ??= model;
123
+ }); */
124
+ this.vectorizedProperties.forEach((property) => {
125
+ property.embeddingModel ??= model;
126
+ });
127
+ /* this.vectorizeProperties = vectorizePropertyKeys.map(
128
+ (key: string): DyFM_DataProperty_Params<any> =>
129
+ dataParams.properties[key] as DyFM_DataProperty_Params<any>
130
+ ); */
131
+ }
132
+ /**
133
+ * Vectorizes the properties of the data
134
+ * IF they are not vectorized yet OR alwaysVectorize is true
135
+ * (That are marked with vectorizeFrom if the specific property is not defined)
136
+ *
137
+ * @example
138
+ * const data = await vectorizeDataProperties(data);
139
+ *
140
+ * @returns The vectorized data
141
+ */
142
+ async vectorizeDataProperties(newData, forceVectorize) {
143
+ try {
144
+ let existingData;
145
+ if (!forceVectorize && newData?._id) {
146
+ existingData = await this.getDataById(newData._id, true, true);
147
+ }
148
+ await fsm_dynamo_2.DyFM_Array.asyncForEachAllAtOnce(this.vectorizedProperties, async (property) => {
149
+ await this.checkAndVectorizeSingleProperty(property, newData, existingData, forceVectorize);
150
+ });
151
+ return newData;
152
+ }
153
+ catch (error) {
154
+ throw new fsm_dynamo_2.DyFM_Error({
155
+ ...this.getDefaultErrorSettings('vectorizeDataProperties', error),
156
+ });
157
+ }
158
+ }
159
+ async checkAndVectorizeSingleProperty(vectorizedProperty, newData, existingData, forceVectorize) {
160
+ const newValue = await this.getVectorizingDataForVectorizedProperty(vectorizedProperty, newData);
161
+ const existingValue = await this.getVectorizingDataForVectorizedProperty(vectorizedProperty, existingData);
162
+ const vectorizedFrom = vectorizedProperty.vectorizedFrom[0];
163
+ const vectorizingPropertyHaveValue = Boolean(newData[vectorizedFrom]);
164
+ const newDataIsNewChanged = (!existingValue && vectorizingPropertyHaveValue) ||
165
+ !fsm_dynamo_2.DyFM_Object.sameObjects(existingValue, newValue);
166
+ if (forceVectorize || (vectorizingPropertyHaveValue && newDataIsNewChanged)) {
167
+ if (!vectorizedProperty.embeddingModel) {
168
+ throw new fsm_dynamo_2.DyFM_Error({
169
+ ...this.getDefaultErrorSettings('vectorizeDataProperties', new Error(`Property "${vectorizedProperty.key}" has no embedding model!`)),
170
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VDB1`,
171
+ __localStack: this.dataParams.stackLocation,
172
+ });
173
+ }
174
+ if (this.debugLog) {
175
+ fsm_dynamo_1.DyFM_Log.log(`vectorizing "${vectorizedProperty.key}" in new "${this.dataParams.dataName}"` +
176
+ newData?.name ? `: "${newData?.name}"` : '');
177
+ }
178
+ newData[vectorizedProperty.key] = await this.vectorize(newValue, vectorizedProperty.embeddingModel);
179
+ }
180
+ else if (existingData?.[vectorizedProperty.key] && !newData?.[vectorizedProperty.key]) {
181
+ newData[vectorizedProperty.key] = existingData[vectorizedProperty.key];
182
+ }
183
+ }
184
+ async getVectorizingDataForVectorizedProperty(vectorizedProperty, data) {
185
+ if (vectorizedProperty.vectorizedFrom.length === 1) {
186
+ const value = data?.[vectorizedProperty.vectorizedFrom[0]];
187
+ if (value === undefined) {
188
+ return undefined;
189
+ }
190
+ else if (typeof value === 'string') {
191
+ return value;
192
+ }
193
+ else if (Array.isArray(value) || typeof value === 'object') {
194
+ return JSON.stringify(value);
195
+ }
196
+ else {
197
+ return `${value}`;
198
+ }
199
+ }
200
+ else {
201
+ const object = {};
202
+ vectorizedProperty.vectorizedFrom.forEach((key) => {
203
+ if (data?.[key] !== undefined) {
204
+ object[key] = data[key];
205
+ }
206
+ });
207
+ return JSON.stringify(object);
208
+ }
209
+ }
210
+ /**
211
+ * Vectorizes the input
212
+ *
213
+ * @example
214
+ * const vector = await vectorize(input);
215
+ */
216
+ async vectorize(input, useModel = this.openAISettings.defaultSettings.useModel) {
217
+ try {
218
+ if (!input) {
219
+ throw new fsm_dynamo_2.DyFM_Error({
220
+ ...this.getDefaultErrorSettings('vectorize', new Error('input is required')),
221
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-V1`,
222
+ });
223
+ }
224
+ this.embedding_CS ??= new oai_embedding_control_service_1.DyNTS_OAI_Embedding_ControlService(this.openAISettings);
225
+ return await this.embedding_CS.createEmbedding(input, useModel, this.issuer);
226
+ }
227
+ catch (error) {
228
+ throw new fsm_dynamo_2.DyFM_Error({
229
+ ...this.getDefaultErrorSettings('vectorize', error),
230
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-V0`,
231
+ });
232
+ }
233
+ }
234
+ /**
235
+ * Vectorizes the input and searches for the most similar data
236
+ * (the default limit is 3, and the default numberOfCandidates is 100)
237
+ *
238
+ * @example
239
+ * const result = await vectorSearch(input, searchInKey);
240
+ */
241
+ async vectorSearch(set) {
242
+ try {
243
+ if (!set.input) {
244
+ throw new fsm_dynamo_2.DyFM_Error({
245
+ ...this.getDefaultErrorSettings('vectorSearch', new Error('input is required')),
246
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS1`,
247
+ });
248
+ }
249
+ set.limit ??= 3;
250
+ set.numberOfCandidates ??= 100;
251
+ const { input, searchInKey, limit, numberOfCandidates, filterBy } = set;
252
+ this.embedding_CS ??= new oai_embedding_control_service_1.DyNTS_OAI_Embedding_ControlService(this.openAISettings);
253
+ const property = this.dataParams.properties[searchInKey];
254
+ if (!property) {
255
+ throw new fsm_dynamo_2.DyFM_Error({
256
+ ...this.getDefaultErrorSettings('vectorSearch', new Error(`Property "${searchInKey}" not found! ` +
257
+ `while searching "${this.dataParams.dataName}" ` +
258
+ `(The searchable properties are: ${this.vectorizedProperties.map(p => `"${p.key}"`).join(', ')})`)),
259
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS2`,
260
+ __localStack: this.dataParams.stackLocation,
261
+ });
262
+ }
263
+ if (!property.vectorizeUseIndex) {
264
+ throw new fsm_dynamo_2.DyFM_Error({
265
+ ...this.getDefaultErrorSettings('vectorSearch', new Error(`Property "${searchInKey}" has no vectorizeUseIndex!`)),
266
+ });
267
+ }
268
+ const embeddedInput = await this.embedding_CS.createEmbedding(input, property.embeddingModel, this.issuer);
269
+ /* const vectorSearchFilter = */
270
+ const vectorSearchFilter = {
271
+ $vectorSearch: {
272
+ /** this is the index name that is created in the DB (in the Atlas)
273
+ * also the same that is used in the {@link DyFM_DataProperty_Params} */
274
+ index: property.vectorizeUseIndex,
275
+ queryVector: embeddedInput,
276
+ /** this is the property key that is vectorized and used to search */
277
+ path: searchInKey,
278
+ numCandidates: numberOfCandidates,
279
+ limit: limit,
280
+ }
281
+ };
282
+ if (filterBy) {
283
+ vectorSearchFilter.filter = filterBy;
284
+ }
285
+ if (this.debugLog) {
286
+ fsm_dynamo_1.DyFM_Log.log(`vectorSearch...`);
287
+ }
288
+ const result = await this.dataDBService.aggregate([vectorSearchFilter]);
289
+ if (this.debugLog) {
290
+ fsm_dynamo_1.DyFM_Log.log(`vectorSearch: ${result.length} results`);
291
+ }
292
+ return result;
293
+ }
294
+ catch (error) {
295
+ throw new fsm_dynamo_2.DyFM_Error({
296
+ ...this.getDefaultErrorSettings('vectorSearch', error),
297
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS0`,
298
+ });
299
+ }
300
+ }
301
+ /**
302
+ * VectorDataService overrides the saveData function to vectorize the data properties
303
+ *
304
+ * {@link DyNTS_DataService.saveData}
305
+ */
306
+ async saveData(data, dontSetToService, forceVectorize) {
307
+ try {
308
+ data = this.ensureData(data);
309
+ data = await this.vectorizeDataProperties(data, forceVectorize);
310
+ data = await super.saveData(data, dontSetToService);
311
+ if (this.swallowVectorizedProperties) {
312
+ this.vectorizedProperties.forEach((property) => {
313
+ delete data[property.key];
314
+ });
315
+ }
316
+ fsm_dynamo_2.DyFM_Object.cleanObject(data);
317
+ return data;
318
+ }
319
+ catch (error) {
320
+ throw new fsm_dynamo_2.DyFM_Error({
321
+ ...this.getDefaultErrorSettings('saveData', error),
322
+ errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-SD0`,
323
+ });
324
+ }
325
+ }
326
+ }
327
+ exports.DyNTS_OAI_VectorDataService = DyNTS_OAI_VectorDataService;
328
+ //import {
329
+ // DyFM_DataModel_Params,
330
+ // DyFM_DataProperty_Params,
331
+ // DyFM_Metadata,
332
+ //} from '@futdevpro/fsm-dynamo';
333
+ //import { DyFM_OAI_Settings, DyFM_OAI_EmbeddingModel, DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
334
+ //
335
+ //import { DyNTS_DAI_VectorDataService } from '../../_modules/document-ai/_services/dai-vector-data.service-base';
336
+ //import { DyNTS_OAI_Embedding_Service } from './oai-embedding.service';
337
+ //import { DyNTS_global_settings } from '../../../../_collections/global-settings.const';
338
+ //import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
339
+ //
340
+ ///**
341
+ // * OpenAI implementation of the generic Vector Data Service
342
+ // * Extends the generic DAI VectorDataService with OpenAI-specific functionality
343
+ // */
344
+ //export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_DAI_VectorDataService<T> {
345
+ //
346
+ // debugLog: boolean = true;
347
+ // swallowVectorizedProperties: boolean = true;
348
+ //
349
+ // constructor(
350
+ // /** Initial data */
351
+ // data: T,
352
+ // /** DB data params */
353
+ // dataParams: DyFM_DataModel_Params<T>,
354
+ // /** OpenAI settings */
355
+ // public readonly openAISettings: DyFM_OAI_Settings,
356
+ // /** Issuer */
357
+ // issuer: string
358
+ // ) {
359
+ // // Create OpenAI embedding service
360
+ // const embeddingService = new DyNTS_OAI_Embedding_Service(openAISettings);
361
+ //
362
+ // super(data, dataParams, embeddingService, issuer);
363
+ //
364
+ // if (!openAISettings.openAIConfig.apiKey) {
365
+ // throw new Error('openAIConfig.apiKey is required');
366
+ // }
367
+ //
368
+ // const model: DyFM_OAI_EmbeddingModel = openAISettings.defaultSettings.useModel as DyFM_OAI_EmbeddingModel ??
369
+ // DyFM_OAI_Model.textEmbedding_3Large;
370
+ //
371
+ // // Configure vectorized properties with OpenAI-specific settings
372
+ // this.configureVectorizedProperties(model);
373
+ // }
374
+ //
375
+ // /**
376
+ // * Configure vectorized properties with OpenAI-specific settings
377
+ // */
378
+ // private configureVectorizedProperties(model: DyFM_OAI_EmbeddingModel): void {
379
+ // // Update vectorized properties with OpenAI model info
380
+ // this.vectorizedProperties.forEach(property => {
381
+ // if (property.vectorizedFrom) {
382
+ // // Set the embedding model for this property
383
+ // (property as any).embeddingModel = model;
384
+ // }
385
+ // });
386
+ // }
387
+ //
388
+ // /**
389
+ // * Perform vector search with OpenAI-specific implementation
390
+ // */
391
+ // protected override async performVectorSearch(
392
+ // query: string,
393
+ // model: string,
394
+ // issuer: string,
395
+ // options: any
396
+ // ): Promise<T[]> {
397
+ // try {
398
+ // // Create embedding for the query
399
+ // const queryEmbedding = await this.embeddingService.createEmbedding(query, model, issuer);
400
+ //
401
+ // // Get all data
402
+ // const allData = await this.getAllData();
403
+ //
404
+ // // Calculate similarities (simplified implementation)
405
+ // const results = allData.map(item => {
406
+ // const itemEmbedding = (item as any).chunkParentedContentVectorized;
407
+ // if (!itemEmbedding) return { item, similarity: 0 };
408
+ //
409
+ // const similarity = this.calculateCosineSimilarity(queryEmbedding, itemEmbedding);
410
+ // return { item, similarity };
411
+ // })
412
+ // .filter(result => result.similarity >= (options.minSimilarity || 0))
413
+ // .sort((a, b) => b.similarity - a.similarity)
414
+ // .slice(0, options.limit || 10)
415
+ // .map(result => result.item);
416
+ //
417
+ // return results;
418
+ // } catch (error) {
419
+ // throw new Error(`Vector search failed: ${error.message}`);
420
+ // }
421
+ // }
422
+ //
423
+ // /**
424
+ // * Calculate cosine similarity between two vectors
425
+ // */
426
+ // private calculateCosineSimilarity(vecA: number[], vecB: number[]): number {
427
+ // if (vecA.length !== vecB.length) return 0;
428
+ //
429
+ // let dotProduct = 0;
430
+ // let normA = 0;
431
+ // let normB = 0;
432
+ //
433
+ // for (let i = 0; i < vecA.length; i++) {
434
+ // dotProduct += vecA[i] * vecB[i];
435
+ // normA += vecA[i] * vecA[i];
436
+ // normB += vecB[i] * vecB[i];
437
+ // }
438
+ //
439
+ // if (normA === 0 || normB === 0) return 0;
440
+ //
441
+ // return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));
442
+ // }
443
+ //
444
+ // /**
445
+ // * Get default error settings
446
+ // */
447
+ // protected getDefaultErrorSettings(
448
+ // method: string,
449
+ // error: any,
450
+ // issuer?: string
451
+ // ): any {
452
+ // return {
453
+ // method,
454
+ // error,
455
+ // issuer: issuer || this.issuer,
456
+ // userMsg: this.defaultErrorUserMsg,
457
+ // };
458
+ // }
459
+ //}
460
+ //# sourceMappingURL=oai-vector-data.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oai-vector-data.service.js","sourceRoot":"","sources":["../../../../../../../src/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.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OAAO;AACP,KAAK;AACL,EAAE;AACF,OAAO;AACP,sDAAsD;AACtD,OAAO;AACP,+EAA+E;AAC/E,gDAAgD;AAChD,MAAM;AACN,yBAAyB;AACzB,oBAAoB;AACpB,oBAAoB;AACpB,MAAM;AACN,6CAA6C;AAC7C,wCAAwC;AACxC,mCAAmC;AACnC,mCAAmC;AACnC,OAAO;AACP,MAAM;AACN,+CAA+C;AAC/C,MAAM;AACN,gEAAgE;AAChE,KAAK;AACL,EAAE;AACF,OAAO;AACP,iCAAiC;AACjC,OAAO;AACP,sCAAsC;AACtC,qBAAqB;AACrB,iBAAiB;AACjB,qBAAqB;AACrB,YAAY;AACZ,cAAc;AACd,eAAe;AACf,cAAc;AACd,sCAAsC;AACtC,0CAA0C;AAC1C,QAAQ;AACR,KAAK;AACL,GAAG"}
@@ -1,7 +1,15 @@
1
1
  import { DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
2
+ import { DyFM_DAI_EmbeddingInfo } from '@futdevpro/fsm-dynamo/ai/document-ai';
2
3
  import { DyNTS_OAI_LLM_ServiceBase } from './oai-llm.service-base';
3
- export declare class DyNTS_OAI_Embedding_ControlService extends DyNTS_OAI_LLM_ServiceBase {
4
+ import { DyNTS_AI_Embedding_ServiceBase } from '../../../_services/ai-embedding.service-base';
5
+ export declare class DyNTS_OAI_Embedding_ControlService extends DyNTS_OAI_LLM_ServiceBase implements DyNTS_AI_Embedding_ServiceBase {
4
6
  createEmbedding(text: string, model: DyFM_OAI_Model | string, issuer: string): Promise<number[]>;
5
7
  createEmbeddings(texts: string[], model: DyFM_OAI_Model | string, issuer: string): Promise<number[][]>;
8
+ /**
9
+ * Visszaadja az embedding model információkat
10
+ *
11
+ * Returns embedding model information
12
+ */
13
+ getEmbeddingInfo(model: string): DyFM_DAI_EmbeddingInfo;
6
14
  }
7
15
  //# sourceMappingURL=oai-embedding.control-service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oai-embedding.control-service.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAInE,qBAAa,kCAAmC,SAAQ,yBAAyB;IAEzE,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,cAAc,GAAG,MAA4C,EACpE,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC;IAyBd,gBAAgB,CACpB,KAAK,EAAE,MAAM,EAAE,EACf,KAAK,EAAE,cAAc,GAAG,MAA4C,EACpE,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;CAwBvB"}
1
+ {"version":3,"file":"oai-embedding.control-service.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAqC,MAAM,kCAAkC,CAAC;AAGrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAE9F,qBAAa,kCAAmC,SAAQ,yBAA0B,YAAW,8BAA8B;IAEnH,eAAe,CACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,cAAc,GAAG,MAA4C,EACpE,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC;IAyBd,gBAAgB,CACpB,KAAK,EAAE,MAAM,EAAE,EACf,KAAK,EAAE,cAAc,GAAG,MAA4C,EACpE,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAyBtB;;;;OAIG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB;CAQxD"}
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DyNTS_OAI_Embedding_ControlService = void 0;
4
4
  const open_ai_1 = require("@futdevpro/fsm-dynamo/ai/open-ai");
5
5
  const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
6
+ const ai_1 = require("@futdevpro/fsm-dynamo/ai");
6
7
  const oai_llm_service_base_1 = require("./oai-llm.service-base");
7
8
  const global_settings_const_1 = require("../../../../../_collections/global-settings.const");
8
- class DyNTS_OAI_Embedding_ControlService extends oai_llm_service_base_1.DyNTS_OAI_LLM_ServiceBase /* implements DyNTS_AI_Embedding_ServiceBase */ {
9
+ class DyNTS_OAI_Embedding_ControlService extends oai_llm_service_base_1.DyNTS_OAI_LLM_ServiceBase {
9
10
  async createEmbedding(text, model = open_ai_1.DyFM_OAI_Model.textEmbedding_3Large, issuer) {
10
11
  try {
11
12
  if (!text) {
@@ -48,6 +49,18 @@ class DyNTS_OAI_Embedding_ControlService extends oai_llm_service_base_1.DyNTS_OA
48
49
  });
49
50
  }
50
51
  }
52
+ /**
53
+ * Visszaadja az embedding model információkat
54
+ *
55
+ * Returns embedding model information
56
+ */
57
+ getEmbeddingInfo(model) {
58
+ const dimensions = open_ai_1.DyFM_OAI_EmbeddingModelDimensions[model];
59
+ return {
60
+ provider: ai_1.DyFM_AI_Provider.OpenAI,
61
+ model: model
62
+ };
63
+ }
51
64
  }
52
65
  exports.DyNTS_OAI_Embedding_ControlService = DyNTS_OAI_Embedding_ControlService;
53
66
  //# sourceMappingURL=oai-embedding.control-service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oai-embedding.control-service.js","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts"],"names":[],"mappings":";;;AAAA,8DAAkE;AAClE,sDAAmD;AAEnD,iEAAmE;AACnE,6FAA0F;AAG1F,MAAa,kCAAmC,SAAQ,gDAAyB,CAAC,+CAA+C;IA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,MAAM,CAAC;gBACnD,KAAK;gBACL,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,uBAAU,CAAC;gBACnB,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,EAAE,KAAK,EAAE,MAAM,CAAC;gBAElE,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,iBAAiB;aACzE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA3DD,gFA2DC"}
1
+ {"version":3,"file":"oai-embedding.control-service.js","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts"],"names":[],"mappings":";;;AAAA,8DAAqG;AACrG,sDAAmD;AACnD,iDAA4D;AAG5D,iEAAmE;AACnE,6FAA0F;AAG1F,MAAa,kCAAmC,SAAQ,gDAAyB;IAE/E,KAAK,CAAC,eAAe,CACnB,IAAY,EACZ,QAAiC,wBAAc,CAAC,oBAAoB,EACpE,MAAc;QAEd,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,IAAI,uBAAU,CAAC;oBACnB,GAAG,IAAI,CAAC,uBAAuB,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;oBAEzF,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,gBAAgB;iBACxE,CAAC,CAAC;YACL,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC;gBACnD,KAAK;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACpC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AM;YACjC,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC;CACF;AAzED,gFAyEC"}
@@ -2,6 +2,7 @@ import { DyFM_OAI_CallSettings } from '@futdevpro/fsm-dynamo/ai/open-ai';
2
2
  import { DyFM_AI_Message } from '@futdevpro/fsm-dynamo/ai';
3
3
  import { ChatCompletion } from 'openai/resources';
4
4
  import { DyNTS_OAI_LLM_ServiceBase } from './oai-llm.service-base';
5
+ import { DyNTS_AI_LLMChat_ServiceBase } from '../../../_services/ai-llm-chat.service-base';
5
6
  import { DyFM_AI_ConversationQuestion_Input, DyFM_AI_ConversationSelect_Input, DyFM_AI_ConversationGenericSelect_Input, DyFM_AI_ConversationMultiSelect_Input, DyFM_AI_ConversationGenericMultiSelect_Input, DyFM_AI_ConversationJSONKeysDescription_Input, DyFM_AI_ConversationJSONExactKeys_Input, DyFM_AI_ConversationGetAnswer_Input } from '../../../_models/ai-input-interfaces';
6
7
  /**
7
8
  * {
@@ -10,7 +11,26 @@ import { DyFM_AI_ConversationQuestion_Input, DyFM_AI_ConversationSelect_Input, D
10
11
  * project: 'proj_XY',
11
12
  * }
12
13
  */
13
- export declare class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
14
+ export declare class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase implements DyNTS_AI_LLMChat_ServiceBase {
15
+ private conversationHistories;
16
+ /**
17
+ * Hozzáad egy üzenetet a conversation history-hoz
18
+ *
19
+ * Adds a message to conversation history
20
+ */
21
+ addMessageToHistory(message: DyFM_AI_Message, issuer: string): void;
22
+ /**
23
+ * Törli a conversation history-t
24
+ *
25
+ * Clears conversation history
26
+ */
27
+ clearHistory(issuer: string): void;
28
+ /**
29
+ * Visszaadja a conversation history-t
30
+ *
31
+ * Gets conversation history
32
+ */
33
+ getHistory(issuer: string): DyFM_AI_Message[];
14
34
  /**
15
35
  * Converts generic AI messages to OpenAI-specific format
16
36
  *
@@ -57,7 +77,7 @@ export declare class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_Service
57
77
  *
58
78
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
59
79
  */
60
- multipleSelectQuestionWithOptionsInConversation(set: DyFM_AI_ConversationMultiSelect_Input): Promise<string[]>;
80
+ multipleSelectQuestionInConversationWithOptions(set: DyFM_AI_ConversationMultiSelect_Input): Promise<string[]>;
61
81
  /**
62
82
  * Asks the AI to select one or more of the options from the list
63
83
  * Similar to {@link askMultipleSelectQuestionWithOptions},
@@ -65,7 +85,7 @@ export declare class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_Service
65
85
  *
66
86
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
67
87
  */
68
- requestMultipleSelectInConversation<T>(set: DyFM_AI_ConversationGenericMultiSelect_Input<T>): Promise<T[]>;
88
+ requestMultiselectInConversation<T>(set: DyFM_AI_ConversationGenericMultiSelect_Input<T>): Promise<T[]>;
69
89
  /**
70
90
  * Asks the AI to answer a question that must result a JSON object
71
91
  *
@@ -78,6 +98,16 @@ export declare class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_Service
78
98
  jsonQuestionInConversation<T = any>(set: DyFM_AI_ConversationQuestion_Input): Promise<T | {
79
99
  unparsableResult: string;
80
100
  }>;
101
+ /**
102
+ * Asks the AI to answer a question that must result a JSON object with specific key descriptions
103
+ *
104
+ * If the answer is not a valid JSON object, it will return { unparsableResult: answer }
105
+ *
106
+ * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.jsonRequestWithKeysDescription} to ask the question
107
+ *
108
+ * (uses {@link DyFM_safeParseJSON})
109
+ */
110
+ JSONQuestionInConversationWithKeysDescription(set: DyFM_AI_ConversationJSONKeysDescription_Input): Promise<object>;
81
111
  /**
82
112
  * Asks the AI to answer a question that must result a JSON object with specific key descriptions
83
113
  *
@@ -90,6 +120,16 @@ export declare class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_Service
90
120
  jsonQuestionWithKeysDescriptionInConversation<T = any>(set: DyFM_AI_ConversationJSONKeysDescription_Input): Promise<T | {
91
121
  unparsableResult: string;
92
122
  }>;
123
+ /**
124
+ * Asks the AI to answer a question that must result a JSON object with specific keys
125
+ *
126
+ * If the answer is not a valid JSON object, it will return { unparsableResult: answer }
127
+ *
128
+ * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.jsonRequestWithExactKeys} to ask the question
129
+ *
130
+ * (uses {@link DyFM_safeParseJSON})
131
+ */
132
+ JSONQuestionInConversationWithExactKeys(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<object>;
93
133
  /**
94
134
  * Asks the AI to answer a question that must result a JSON object with specific keys
95
135
  *
@@ -160,5 +200,11 @@ export declare class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_Service
160
200
  /** this is used to readably replace too long contents to eg '...' in logs */
161
201
  replaceThisInLog?: string;
162
202
  }): void;
203
+ /**
204
+ * Kérdez egy kérdést és JSON választ vár exact keys-szel
205
+ *
206
+ * Asks a question and expects JSON response with exact keys
207
+ */
208
+ requestJSONInConversationWithExactKeys<T>(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<T>;
163
209
  }
164
210
  //# sourceMappingURL=oai-llm-chat.service-base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"oai-llm-chat.service-base.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqC,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE5G,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EACh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AAE,OAAO,CAAC;KACpB,GACA,eAAe,EAAE;IAoEpB,SAAS,CAAC,eAAe,CACvB,GAAG,EAAE;QACH,YAAY,EAAE,eAAe,EAAE,CAAC;QAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,6EAA6E;QAC7E,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B;CAYJ"}
1
+ {"version":3,"file":"oai-llm-chat.service-base.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqC,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE5G,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EACL,kCAAkC,EAClC,gCAAgC,EAChC,uCAAuC,EACvC,qCAAqC,EACrC,4CAA4C,EAC5C,6CAA6C,EAC7C,uCAAuC,EACvC,mCAAmC,EACpC,MAAM,sCAAsC,CAAC;AAG9C;;;;;;GAMG;AAIH,qBAAa,6BAA8B,SAAQ,yBAA0B,YAAW,4BAA4B;IAGlH,OAAO,CAAC,qBAAqB,CAA6C;IAE1E;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAOnE;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIlC;;;;OAIG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,EAAE;IAI7C;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;;;;OAKG;IACG,2BAA2B,CAAC,GAAG,EAAE,kCAAkC,GAAG,OAAO,CAAC,OAAO,CAAC;IA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