@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.
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.d.ts +22 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.js +187 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.d.ts +27 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.js +277 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.d.ts +23 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.js +319 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.d.ts +118 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.d.ts.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.js +460 -0
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.js.map +1 -0
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts +9 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js +14 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +49 -3
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js +72 -2
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +61 -3
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +190 -4
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
- package/build/_modules/ai/_modules/open-ai/index.d.ts +4 -4
- package/build/_modules/ai/_modules/open-ai/index.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/index.js +6 -5
- package/build/_modules/ai/_modules/open-ai/index.js.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +1 -1
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
- package/package.json +1 -1
- package/src/_modules/ai/_modules/open-ai/_services/{oai-doc-chunk-data.service.ts → data-services/oai-doc-chunk-data.service.ts} +8 -8
- package/src/_modules/ai/_modules/open-ai/_services/{oai-doc-page.data-service.ts → data-services/oai-doc-page.data-service.ts} +8 -8
- package/src/_modules/ai/_modules/open-ai/_services/{oai-document.data-service.ts → data-services/oai-document.data-service.ts} +7 -7
- package/src/_modules/ai/_modules/open-ai/_services/{oai-vector-data.service.ts → data-services/oai-vector-data.service.ts} +4 -4
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts +18 -2
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +84 -3
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +240 -5
- package/src/_modules/ai/_modules/open-ai/index.ts +6 -5
- package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +1 -1
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DyNTS_DiAs_Chunk_DataService = void 0;
|
|
4
4
|
const open_ai_1 = require("@futdevpro/fsm-dynamo/ai/open-ai");
|
|
5
5
|
const dai_doc_chunk_data_model_1 = require("../../ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model");
|
|
6
|
-
const oai_doc_chunk_data_service_1 = require("../../ai/_modules/open-ai/_services/oai-doc-chunk-data.service");
|
|
6
|
+
const oai_doc_chunk_data_service_1 = require("../../ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service");
|
|
7
7
|
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
8
8
|
const oai_llm_predefined_requests_conts_1 = require("../../ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts");
|
|
9
9
|
const global_settings_const_1 = require("../../../_collections/global-settings.const");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dias-chunk.data-service.js","sourceRoot":"","sources":["../../../../src/_modules/discord-assistant/_services/dias-chunk.data-service.ts"],"names":[],"mappings":";;;AAAA,8DAAqF;AAErF,yHAA+I;AAC/I
|
|
1
|
+
{"version":3,"file":"dias-chunk.data-service.js","sourceRoot":"","sources":["../../../../src/_modules/discord-assistant/_services/dias-chunk.data-service.ts"],"names":[],"mappings":";;;AAAA,8DAAqF;AAErF,yHAA+I;AAC/I,6HAA6H;AAC7H,sDAAoF;AAOpF,gIAAmI;AAGnI,uFAAoF;AAIpF,MAAsB,4BAKpB,SAAQ,0DAAgF;IAIxF,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;IAC3C,CAAC;IAED,YACE,MAAc,EACd,UAA2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CAAC;QACL,CAAC;IACH,CAAC;CACF;AA9JD,oEA8JC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { DyFM_Array, DyFM_DataModel_Params, DyFM_DataProperties, DyFM_DBFilterSimple, DyFM_Error, DyFM_Log, DyFM_Metadata, DyFM_Async } from '@futdevpro/fsm-dynamo';
|
|
2
2
|
import { DyFM_OAI_Settings, DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
3
3
|
import { DyNTS_OAI_VectorDataService } from './oai-vector-data.service';
|
|
4
|
-
import { DyNTS_DAI_DocChunking_Util } from '
|
|
5
|
-
import { DyNTS_DAI_DocChunk, DyNTS_DAI_docChunk_dataParams } from '
|
|
6
|
-
import { DyNTS_DAI_DocChunkCompareResult } from '
|
|
7
|
-
import { DyNTS_DAI_CompareResult_Type } from '
|
|
8
|
-
import { DyNTS_DAI_DocPage } from '
|
|
9
|
-
import { DyNTS_DAI_DocPageCompareResult } from '
|
|
10
|
-
import { DyNTS_DAI_Document } from '
|
|
4
|
+
import { DyNTS_DAI_DocChunking_Util } from '../../../document-ai/_collections/dai-chunking.util';
|
|
5
|
+
import { DyNTS_DAI_DocChunk, DyNTS_DAI_docChunk_dataParams } from '../../../document-ai/_models/data-models/dai-doc-chunk.data-model';
|
|
6
|
+
import { DyNTS_DAI_DocChunkCompareResult } from '../../../document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface';
|
|
7
|
+
import { DyNTS_DAI_CompareResult_Type } from '../../../document-ai/_enums/dai-compare-result-type.enum';
|
|
8
|
+
import { DyNTS_DAI_DocPage } from '../../../document-ai/_models/data-models/dai-doc-page.data-model';
|
|
9
|
+
import { DyNTS_DAI_DocPageCompareResult } from '../../../document-ai/_models/interfaces/dai-doc-page-compare-result.interface';
|
|
10
|
+
import { DyNTS_DAI_Document } from '../../../document-ai/_models/data-models/dai-document.data-model';
|
|
11
11
|
import { DyNTS_OAI_DocumentDataService } from './oai-document.data-service';
|
|
12
12
|
import { DyNTS_OAI_DocPageDataService } from './oai-doc-page.data-service';
|
|
13
|
-
import { DyNTS_DAI_Document_Util } from '
|
|
13
|
+
import { DyNTS_DAI_Document_Util } from '../../../document-ai/_collections/dai-document.util';
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
export class DyNTS_OAI_DocChunkDataService<
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { DyFM_Array, DyFM_DataModel_Params, DyFM_DBFilter, DyFM_DBFilterExpressions, DyFM_DBFilterSimple, DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
2
2
|
import { DyFM_OAI_Settings } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
3
3
|
|
|
4
|
-
import { DyNTS_DataService } from '
|
|
5
|
-
import { DyNTS_DAI_DocPageCompareResult } from '
|
|
6
|
-
import { DyNTS_DAI_DocChunking_Util } from '
|
|
7
|
-
import { DyNTS_DAI_DocChunk } from '
|
|
8
|
-
import { DyNTS_DAI_DocChunkCompareResult } from '
|
|
9
|
-
import { DyNTS_DAI_DocPage, DyNTS_DAI_docPage_dataParams } from '
|
|
10
|
-
import { DyNTS_DAI_Document, DyNTS_DAI_document_dataParams } from '
|
|
4
|
+
import { DyNTS_DataService } from '../../../../../../_services/base/data.service';
|
|
5
|
+
import { DyNTS_DAI_DocPageCompareResult } from '../../../document-ai/_models/interfaces/dai-doc-page-compare-result.interface';
|
|
6
|
+
import { DyNTS_DAI_DocChunking_Util } from '../../../document-ai/_collections/dai-chunking.util';
|
|
7
|
+
import { DyNTS_DAI_DocChunk } from '../../../document-ai/_models/data-models/dai-doc-chunk.data-model';
|
|
8
|
+
import { DyNTS_DAI_DocChunkCompareResult } from '../../../document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface';
|
|
9
|
+
import { DyNTS_DAI_DocPage, DyNTS_DAI_docPage_dataParams } from '../../../document-ai/_models/data-models/dai-doc-page.data-model';
|
|
10
|
+
import { DyNTS_DAI_Document, DyNTS_DAI_document_dataParams } from '../../../document-ai/_models/data-models/dai-document.data-model';
|
|
11
11
|
|
|
12
12
|
import { DyNTS_OAI_DocChunkDataService } from './oai-doc-chunk-data.service';
|
|
13
13
|
import { DyNTS_OAI_DocumentDataService } from './oai-document.data-service';
|
|
14
|
-
import { DyNTS_DAI_CompareResult_Type } from '
|
|
14
|
+
import { DyNTS_DAI_CompareResult_Type } from '../../../document-ai/_enums/dai-compare-result-type.enum';
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
export class DyNTS_OAI_DocPageDataService<
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DyFM_Array, DyFM_Async, DyFM_DataModel_Params, DyFM_DBFilter, DyFM_DBFilterExpressions, DyFM_DBFilterSimple, DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
2
|
-
import { DyNTS_DataService } from '
|
|
3
|
-
import { DyNTS_DAI_DocChunk } from '
|
|
4
|
-
import { DyNTS_DAI_DocPage } from '
|
|
5
|
-
import { DyNTS_DAI_Document, DyNTS_DAI_document_dataParams } from '
|
|
2
|
+
import { DyNTS_DataService } from '../../../../../../_services/base/data.service';
|
|
3
|
+
import { DyNTS_DAI_DocChunk } from '../../../document-ai/_models/data-models/dai-doc-chunk.data-model';
|
|
4
|
+
import { DyNTS_DAI_DocPage } from '../../../document-ai/_models/data-models/dai-doc-page.data-model';
|
|
5
|
+
import { DyNTS_DAI_Document, DyNTS_DAI_document_dataParams } from '../../../document-ai/_models/data-models/dai-document.data-model';
|
|
6
6
|
import { DyNTS_OAI_DocChunkDataService } from './oai-doc-chunk-data.service';
|
|
7
7
|
import { DyNTS_OAI_DocPageDataService } from './oai-doc-page.data-service';
|
|
8
8
|
import { DyFM_OAI_Settings } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
9
|
-
import { DyNTS_DAI_DocumentCompareResult } from '
|
|
10
|
-
import { DyNTS_DAI_DocPageCompareResult } from '
|
|
11
|
-
import { DyNTS_DAI_CompareResult_Type } from '
|
|
9
|
+
import { DyNTS_DAI_DocumentCompareResult } from '../../../document-ai/_models/interfaces/dai-document-compare-result.interface';
|
|
10
|
+
import { DyNTS_DAI_DocPageCompareResult } from '../../../document-ai/_models/interfaces/dai-doc-page-compare-result.interface';
|
|
11
|
+
import { DyNTS_DAI_CompareResult_Type } from '../../../document-ai/_enums/dai-compare-result-type.enum';
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
export class DyNTS_OAI_DocumentDataService<
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
} from '@futdevpro/fsm-dynamo';
|
|
12
12
|
import { DyFM_OAI_Settings, DyFM_OAI_EmbeddingModel, DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
13
13
|
|
|
14
|
-
import { DyNTS_global_settings } from '
|
|
15
|
-
import { DyNTS_DataService } from '
|
|
16
|
-
import { DyNTS_OAI_Embedding_ControlService } from '
|
|
17
|
-
import { DyNTS_OAI_global_settings } from '
|
|
14
|
+
import { DyNTS_global_settings } from '../../../../../../_collections/global-settings.const';
|
|
15
|
+
import { DyNTS_DataService } from '../../../../../../_services/base/data.service';
|
|
16
|
+
import { DyNTS_OAI_Embedding_ControlService } from '../oai-embedding.control-service';
|
|
17
|
+
import { DyNTS_OAI_global_settings } from '../../_collections/oai-global-settings.const';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Vector Data Service that is connected to the relevant DBServices
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
1
|
+
import { DyFM_OAI_Model, DyFM_OAI_EmbeddingModelDimensions } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
2
2
|
import { DyFM_Error } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
import { DyFM_AI_Provider } from '@futdevpro/fsm-dynamo/ai';
|
|
4
|
+
import { DyFM_DAI_EmbeddingInfo } from '@futdevpro/fsm-dynamo/ai/document-ai';
|
|
3
5
|
|
|
4
6
|
import { DyNTS_OAI_LLM_ServiceBase } from './oai-llm.service-base';
|
|
5
7
|
import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
|
|
6
8
|
import { DyNTS_AI_Embedding_ServiceBase } from '../../../_services/ai-embedding.service-base';
|
|
7
9
|
|
|
8
|
-
export class DyNTS_OAI_Embedding_ControlService extends DyNTS_OAI_LLM_ServiceBase
|
|
10
|
+
export class DyNTS_OAI_Embedding_ControlService extends DyNTS_OAI_LLM_ServiceBase implements DyNTS_AI_Embedding_ServiceBase {
|
|
9
11
|
|
|
10
12
|
async createEmbedding(
|
|
11
13
|
text: string,
|
|
@@ -64,4 +66,18 @@ export class DyNTS_OAI_Embedding_ControlService extends DyNTS_OAI_LLM_ServiceBas
|
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Visszaadja az embedding model információkat
|
|
72
|
+
*
|
|
73
|
+
* Returns embedding model information
|
|
74
|
+
*/
|
|
75
|
+
getEmbeddingInfo(model: string): DyFM_DAI_EmbeddingInfo {
|
|
76
|
+
const dimensions = DyFM_OAI_EmbeddingModelDimensions[model as keyof typeof DyFM_OAI_EmbeddingModelDimensions];
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
provider: DyFM_AI_Provider.OpenAI,
|
|
80
|
+
model: model
|
|
81
|
+
};
|
|
82
|
+
}
|
|
67
83
|
}
|
|
@@ -34,8 +34,41 @@ import {
|
|
|
34
34
|
|
|
35
35
|
// Di Dictionary DiModel DiEz DiAz
|
|
36
36
|
|
|
37
|
-
export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
37
|
+
export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase implements DyNTS_AI_LLMChat_ServiceBase {
|
|
38
38
|
|
|
39
|
+
// History management
|
|
40
|
+
private conversationHistories: Map<string, DyFM_AI_Message[]> = new Map();
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Hozzáad egy üzenetet a conversation history-hoz
|
|
44
|
+
*
|
|
45
|
+
* Adds a message to conversation history
|
|
46
|
+
*/
|
|
47
|
+
addMessageToHistory(message: DyFM_AI_Message, issuer: string): void {
|
|
48
|
+
if (!this.conversationHistories.has(issuer)) {
|
|
49
|
+
this.conversationHistories.set(issuer, []);
|
|
50
|
+
}
|
|
51
|
+
this.conversationHistories.get(issuer).push(message);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Törli a conversation history-t
|
|
56
|
+
*
|
|
57
|
+
* Clears conversation history
|
|
58
|
+
*/
|
|
59
|
+
clearHistory(issuer: string): void {
|
|
60
|
+
this.conversationHistories.delete(issuer);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Visszaadja a conversation history-t
|
|
65
|
+
*
|
|
66
|
+
* Gets conversation history
|
|
67
|
+
*/
|
|
68
|
+
getHistory(issuer: string): DyFM_AI_Message[] {
|
|
69
|
+
return this.conversationHistories.get(issuer) || [];
|
|
70
|
+
}
|
|
71
|
+
|
|
39
72
|
/**
|
|
40
73
|
* Converts generic AI messages to OpenAI-specific format
|
|
41
74
|
*
|
|
@@ -159,7 +192,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
159
192
|
*
|
|
160
193
|
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
|
|
161
194
|
*/
|
|
162
|
-
async
|
|
195
|
+
async multipleSelectQuestionInConversationWithOptions(set: DyFM_AI_ConversationMultiSelect_Input): Promise<string[]> {
|
|
163
196
|
const selectQuestionAddition = this.predefinedRequests.multiselect.replace(
|
|
164
197
|
'{{DyNTS_selectOptions}}',
|
|
165
198
|
this.getTextListAsText(set.options)
|
|
@@ -189,7 +222,7 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
189
222
|
*
|
|
190
223
|
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
|
|
191
224
|
*/
|
|
192
|
-
async
|
|
225
|
+
async requestMultiselectInConversation<T>(
|
|
193
226
|
set: DyFM_AI_ConversationGenericMultiSelect_Input<T>
|
|
194
227
|
): Promise<T[]> {
|
|
195
228
|
const selectQuestionAddition = this.predefinedRequests.multiselect.replace(
|
|
@@ -226,6 +259,19 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
226
259
|
}
|
|
227
260
|
//askJsonQuestionInConversation: typeof this.jsonQuestionInConversation = this.jsonQuestionInConversation;
|
|
228
261
|
|
|
262
|
+
/**
|
|
263
|
+
* Asks the AI to answer a question that must result a JSON object with specific key descriptions
|
|
264
|
+
*
|
|
265
|
+
* If the answer is not a valid JSON object, it will return { unparsableResult: answer }
|
|
266
|
+
*
|
|
267
|
+
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.jsonRequestWithKeysDescription} to ask the question
|
|
268
|
+
*
|
|
269
|
+
* (uses {@link DyFM_safeParseJSON})
|
|
270
|
+
*/
|
|
271
|
+
async JSONQuestionInConversationWithKeysDescription(set: DyFM_AI_ConversationJSONKeysDescription_Input): Promise<object> {
|
|
272
|
+
return this.jsonQuestionWithKeysDescriptionInConversation<any>(set);
|
|
273
|
+
}
|
|
274
|
+
|
|
229
275
|
/**
|
|
230
276
|
* Asks the AI to answer a question that must result a JSON object with specific key descriptions
|
|
231
277
|
*
|
|
@@ -252,6 +298,20 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
252
298
|
}
|
|
253
299
|
//askJsonQuestionWithKeysDescriptionInConversation: typeof this.jsonQuestionWithKeysDescriptionInConversation = this.jsonQuestionWithKeysDescriptionInConversation;
|
|
254
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Asks the AI to answer a question that must result a JSON object with specific keys
|
|
303
|
+
*
|
|
304
|
+
* If the answer is not a valid JSON object, it will return { unparsableResult: answer }
|
|
305
|
+
*
|
|
306
|
+
* Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.jsonRequestWithExactKeys} to ask the question
|
|
307
|
+
*
|
|
308
|
+
* (uses {@link DyFM_safeParseJSON})
|
|
309
|
+
*/
|
|
310
|
+
async JSONQuestionInConversationWithExactKeys(set: DyFM_AI_ConversationJSONExactKeys_Input): Promise<object> {
|
|
311
|
+
const result = await this.jsonQuestionWithExactKeysInConversation<any>(set);
|
|
312
|
+
return typeof result === 'object' ? result : {};
|
|
313
|
+
}
|
|
314
|
+
|
|
255
315
|
/**
|
|
256
316
|
* Asks the AI to answer a question that must result a JSON object with specific keys
|
|
257
317
|
*
|
|
@@ -536,4 +596,25 @@ export class DyNTS_OAI_LLMChat_ServiceBase extends DyNTS_OAI_LLM_ServiceBase {
|
|
|
536
596
|
});
|
|
537
597
|
}
|
|
538
598
|
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Kérdez egy kérdést és JSON választ vár exact keys-szel
|
|
602
|
+
*
|
|
603
|
+
* Asks a question and expects JSON response with exact keys
|
|
604
|
+
*/
|
|
605
|
+
async requestJSONInConversationWithExactKeys<T>(
|
|
606
|
+
set: DyFM_AI_ConversationJSONExactKeys_Input
|
|
607
|
+
): Promise<T> {
|
|
608
|
+
const answer = await this.jsonQuestionWithExactKeysInConversation<any>(set);
|
|
609
|
+
|
|
610
|
+
if ('unparsableResult' in answer) {
|
|
611
|
+
throw new DyFM_Error({
|
|
612
|
+
message: 'Invalid JSON response from AI',
|
|
613
|
+
additionalContent: { answer },
|
|
614
|
+
userMessage: 'Failed to parse AI response'
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
return answer as T;
|
|
619
|
+
}
|
|
539
620
|
}
|
|
@@ -2,14 +2,33 @@ import { OpenAI } from 'openai';
|
|
|
2
2
|
|
|
3
3
|
import { DyFM_OAI_Settings, DyFM_OAI_Model, DyFM_OAI_CallSettings } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
4
4
|
import { DyFM_AnyError, DyFM_Error, DyFM_Error_Settings, DyFM_Log, DyFM_notNull, DyFM_Object } from '@futdevpro/fsm-dynamo';
|
|
5
|
+
import {
|
|
6
|
+
DyFM_AI_Message,
|
|
7
|
+
DyFM_AI_MessageRole,
|
|
8
|
+
DyFM_AI_Provider,
|
|
9
|
+
DyFM_AI_ProviderCapabilities,
|
|
10
|
+
DyFM_AI_CallSettings,
|
|
11
|
+
DyFM_AI_Config,
|
|
12
|
+
DyFM_AI_LLM_Response
|
|
13
|
+
} from '@futdevpro/fsm-dynamo/ai';
|
|
5
14
|
|
|
6
15
|
import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
|
|
7
|
-
import { DyFM_AI_Message, DyFM_AI_MessageRole } from '@futdevpro/fsm-dynamo/ai';
|
|
8
16
|
import { ChatCompletion } from 'openai/resources';
|
|
9
17
|
import { ChatCompletionCreateParamsBase, ChatCompletionMessageParam } from 'openai/resources/chat/completions';
|
|
10
18
|
import { DyNTS_OAI_LLM_Predefined_Requests } from '../_models/interfaces/oai-llm-predefined-requests.interface';
|
|
11
19
|
import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
|
|
12
20
|
import { DyNTS_OAI_LLMDefaultPredefined_Requests } from '../_collections/oai-llm-predefined-requests.conts';
|
|
21
|
+
import { DyNTS_AI_LLM_ServiceBase } from '../../../_services/ai-llm.service-base';
|
|
22
|
+
import {
|
|
23
|
+
DyFM_AI_Question_Input,
|
|
24
|
+
DyFM_AI_ListSelect_Input,
|
|
25
|
+
DyFM_AI_GenericSelect_Input,
|
|
26
|
+
DyFM_AI_MultiSelect_Input,
|
|
27
|
+
DyFM_AI_GenericMultiSelect_Input,
|
|
28
|
+
DyFM_AI_JSONKeysDescription_Input,
|
|
29
|
+
DyFM_AI_JSONExactKeys_Input,
|
|
30
|
+
DyFM_AI_SimpleMessage_Input
|
|
31
|
+
} from '../../../_models/ai-input-interfaces';
|
|
13
32
|
|
|
14
33
|
|
|
15
34
|
/**
|
|
@@ -22,18 +41,33 @@ import { DyNTS_OAI_LLMDefaultPredefined_Requests } from '../_collections/oai-llm
|
|
|
22
41
|
|
|
23
42
|
// Di Dictionary DiModel DiEz DiAz
|
|
24
43
|
|
|
25
|
-
export class DyNTS_OAI_LLM_ServiceBase {
|
|
44
|
+
export class DyNTS_OAI_LLM_ServiceBase extends DyNTS_AI_LLM_ServiceBase {
|
|
26
45
|
|
|
27
46
|
readonly defaultErrorUserMsg: string =
|
|
28
47
|
`We encountered an unhandled Control Service Error, ` +
|
|
29
48
|
`\nplease contact the responsible development team.`;
|
|
30
49
|
|
|
31
|
-
|
|
50
|
+
openai: OpenAI;
|
|
32
51
|
|
|
33
|
-
/* readonly defaultSystemPrompt: string;
|
|
34
|
-
readonly defaultModel: DyFM_OAI_Model | string; */
|
|
35
52
|
readonly defaultSettings: DyFM_OAI_CallSettings;
|
|
36
53
|
|
|
54
|
+
// Provider properties from DyNTS_AI_Provider_ServiceBase
|
|
55
|
+
readonly aiProvider: DyFM_AI_Provider = DyFM_AI_Provider.OpenAI;
|
|
56
|
+
|
|
57
|
+
readonly capabilities: DyFM_AI_ProviderCapabilities = {
|
|
58
|
+
chat: true,
|
|
59
|
+
embeddings: true,
|
|
60
|
+
imageGeneration: true,
|
|
61
|
+
vision: true,
|
|
62
|
+
audioGeneration: true,
|
|
63
|
+
audioAnalysis: true,
|
|
64
|
+
functionCalling: true,
|
|
65
|
+
streaming: true,
|
|
66
|
+
batchOperations: true,
|
|
67
|
+
maxContextLength: 128000,
|
|
68
|
+
supportedModelTypes: ['gpt-4o', 'gpt-4o-mini', 'text-embedding-3-large', 'text-embedding-3-small']
|
|
69
|
+
};
|
|
70
|
+
|
|
37
71
|
get debugLog(): boolean {
|
|
38
72
|
return this.defaultSettings.debugLog;
|
|
39
73
|
}
|
|
@@ -52,6 +86,8 @@ export class DyNTS_OAI_LLM_ServiceBase {
|
|
|
52
86
|
constructor(
|
|
53
87
|
set?: DyFM_OAI_Settings
|
|
54
88
|
) {
|
|
89
|
+
super();
|
|
90
|
+
|
|
55
91
|
DyNTS_global_settings.openAi_settings ??= DyNTS_OAI_global_settings;
|
|
56
92
|
|
|
57
93
|
this.openai = new OpenAI(
|
|
@@ -640,4 +676,203 @@ export class DyNTS_OAI_LLM_ServiceBase {
|
|
|
640
676
|
}
|
|
641
677
|
|
|
642
678
|
//#endregion
|
|
679
|
+
|
|
680
|
+
//#region Provider Methods (from DyNTS_AI_Provider_ServiceBase)
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Inicializálja az OpenAI client-et a megadott config-gal
|
|
684
|
+
*
|
|
685
|
+
* Reinitializes the OpenAI client with the provided config
|
|
686
|
+
*/
|
|
687
|
+
initialize(config: DyFM_AI_Config): void {
|
|
688
|
+
this.openai = new OpenAI(config);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Teszteli a kapcsolatot az OpenAI API-val
|
|
693
|
+
*
|
|
694
|
+
* Tests the connection to OpenAI API
|
|
695
|
+
*/
|
|
696
|
+
async testConnection(issuer: string): Promise<boolean> {
|
|
697
|
+
try {
|
|
698
|
+
await this.openai.models.list();
|
|
699
|
+
return true;
|
|
700
|
+
} catch (error) {
|
|
701
|
+
DyFM_Log.error('DyNTS_OAI_LLM_ServiceBase', 'testConnection', 'Connection test failed', {
|
|
702
|
+
error,
|
|
703
|
+
issuer
|
|
704
|
+
});
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
//#endregion
|
|
710
|
+
|
|
711
|
+
//#region Abstract LLM Methods (from DyNTS_AI_LLM_ServiceBase)
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Meghívja az LLM-et system és user message-szel
|
|
715
|
+
*
|
|
716
|
+
* Calls the LLM with system and user messages
|
|
717
|
+
*/
|
|
718
|
+
async callLLM(
|
|
719
|
+
systemMessage: string,
|
|
720
|
+
userMessage: string,
|
|
721
|
+
settings?: DyFM_AI_CallSettings,
|
|
722
|
+
issuer?: string
|
|
723
|
+
): Promise<string> {
|
|
724
|
+
const result = await this.resolveMessage({
|
|
725
|
+
conversation: [
|
|
726
|
+
{ role: DyFM_AI_MessageRole.system, content: systemMessage },
|
|
727
|
+
{ role: DyFM_AI_MessageRole.user, content: userMessage }
|
|
728
|
+
],
|
|
729
|
+
issuer: issuer ?? 'system',
|
|
730
|
+
settings: this.convertToOAISettings(settings),
|
|
731
|
+
getFullResponse: false
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
if (typeof result === 'string') {
|
|
735
|
+
return result;
|
|
736
|
+
}
|
|
737
|
+
return '';
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* Meghívja az LLM-et üzenet history-val
|
|
742
|
+
*
|
|
743
|
+
* Calls the LLM with message history
|
|
744
|
+
*/
|
|
745
|
+
async callLLMWithHistory(
|
|
746
|
+
messages: DyFM_AI_Message[],
|
|
747
|
+
settings?: DyFM_AI_CallSettings,
|
|
748
|
+
issuer?: string
|
|
749
|
+
): Promise<string> {
|
|
750
|
+
const result = await this.resolveMessage({
|
|
751
|
+
conversation: messages,
|
|
752
|
+
issuer: issuer ?? 'system',
|
|
753
|
+
settings: this.convertToOAISettings(settings),
|
|
754
|
+
getFullResponse: false
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
if (typeof result === 'string') {
|
|
758
|
+
return result;
|
|
759
|
+
}
|
|
760
|
+
return '';
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Meghívja az LLM-et és visszaadja a raw response-t
|
|
765
|
+
*
|
|
766
|
+
* Calls the LLM and returns raw response
|
|
767
|
+
*/
|
|
768
|
+
async callLLMRaw(
|
|
769
|
+
messages: DyFM_AI_Message[],
|
|
770
|
+
settings?: DyFM_AI_CallSettings,
|
|
771
|
+
issuer?: string
|
|
772
|
+
): Promise<DyFM_AI_LLM_Response> {
|
|
773
|
+
const result = await this.resolveMessage({
|
|
774
|
+
conversation: messages,
|
|
775
|
+
issuer: issuer ?? 'system',
|
|
776
|
+
settings: this.convertToOAISettings(settings),
|
|
777
|
+
getFullResponse: true
|
|
778
|
+
}) as ChatCompletion;
|
|
779
|
+
|
|
780
|
+
return {
|
|
781
|
+
content: result.choices[0].message.content,
|
|
782
|
+
usage: result.usage ? {
|
|
783
|
+
promptTokens: result.usage.prompt_tokens,
|
|
784
|
+
completionTokens: result.usage.completion_tokens,
|
|
785
|
+
totalTokens: result.usage.total_tokens
|
|
786
|
+
} : undefined,
|
|
787
|
+
model: result.model,
|
|
788
|
+
finishReason: result.choices[0].finish_reason,
|
|
789
|
+
rawResponse: result
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Küld egy egyszerű üzenetet az LLM-nek
|
|
795
|
+
*
|
|
796
|
+
* Sends a simple message to the LLM
|
|
797
|
+
*/
|
|
798
|
+
async sendMessage(set: DyFM_AI_SimpleMessage_Input): Promise<string> {
|
|
799
|
+
return await this.resolveSimpleUserMessage({
|
|
800
|
+
message: set.message,
|
|
801
|
+
issuer: set.issuer,
|
|
802
|
+
settings: set.settings ? this.convertToOAISettings(set.settings) : undefined
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Kérdez egy kérdést és JSON választ vár exact keys-szel
|
|
808
|
+
*
|
|
809
|
+
* Asks a question and expects JSON response with exact keys
|
|
810
|
+
*/
|
|
811
|
+
async requestJSONWithExactKeys<T = any>(
|
|
812
|
+
set: DyFM_AI_JSONExactKeys_Input
|
|
813
|
+
): Promise<T> {
|
|
814
|
+
const answer = await this.askJSONQuestionWithExactKeys({
|
|
815
|
+
question: set.question,
|
|
816
|
+
keys: set.keys,
|
|
817
|
+
issuer: set.issuer,
|
|
818
|
+
settings: set.settings ? this.convertToOAISettings(set.settings) : undefined,
|
|
819
|
+
debugLog: set.debugLog,
|
|
820
|
+
replaceThisInLog: set.replaceThisInLog
|
|
821
|
+
});
|
|
822
|
+
|
|
823
|
+
if ('unparsableResult' in answer) {
|
|
824
|
+
throw new DyFM_Error({
|
|
825
|
+
message: 'Invalid JSON response from AI',
|
|
826
|
+
additionalContent: { answer },
|
|
827
|
+
userMessage: 'Failed to parse AI response'
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
return answer as T;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Kérdez egy kérdést és több választ vár
|
|
836
|
+
*
|
|
837
|
+
* Asks a question and expects multiple responses
|
|
838
|
+
*/
|
|
839
|
+
async requestMultiselect<T = any>(
|
|
840
|
+
set: DyFM_AI_GenericMultiSelect_Input<T>
|
|
841
|
+
): Promise<T[]> {
|
|
842
|
+
const answer = await this.requestMultipleSelect({
|
|
843
|
+
question: set.question,
|
|
844
|
+
options: set.options,
|
|
845
|
+
issuer: set.issuer,
|
|
846
|
+
settings: set.settings ? this.convertToOAISettings(set.settings) : undefined,
|
|
847
|
+
debugLog: set.debugLog,
|
|
848
|
+
replaceThisInLog: set.replaceThisInLog
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
return answer as T[];
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Konvertálja a generic AI settings-et OpenAI specifikus settings-re
|
|
856
|
+
*
|
|
857
|
+
* Converts generic AI settings to OpenAI-specific settings
|
|
858
|
+
*/
|
|
859
|
+
private convertToOAISettings(settings?: DyFM_AI_CallSettings): DyFM_OAI_CallSettings {
|
|
860
|
+
if (!settings) return undefined;
|
|
861
|
+
|
|
862
|
+
const oaiSettings = new DyFM_OAI_CallSettings();
|
|
863
|
+
|
|
864
|
+
if (settings.systemPrompt) oaiSettings.systemPrompt = settings.systemPrompt;
|
|
865
|
+
if (settings.useModel) oaiSettings.useModel = settings.useModel as DyFM_OAI_Model;
|
|
866
|
+
if (settings.project) oaiSettings.project = settings.project;
|
|
867
|
+
if (settings.debugLog !== undefined) oaiSettings.debugLog = settings.debugLog;
|
|
868
|
+
if (settings.temperature !== undefined) oaiSettings.temperature = settings.temperature;
|
|
869
|
+
if (settings.maxTokens !== undefined) oaiSettings.maxTokens = settings.maxTokens;
|
|
870
|
+
if (settings.topP !== undefined) oaiSettings.topP = settings.topP;
|
|
871
|
+
if (settings.frequencyPenalty !== undefined) oaiSettings.frequencyPenalty = settings.frequencyPenalty;
|
|
872
|
+
if (settings.presencePenalty !== undefined) oaiSettings.presencePenalty = settings.presencePenalty;
|
|
873
|
+
|
|
874
|
+
return oaiSettings;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
//#endregion
|
|
643
878
|
}
|
|
@@ -61,12 +61,13 @@ export * from './_services/oai-llm-chat.service';
|
|
|
61
61
|
export * from './_services/oai-embedding.service'; */
|
|
62
62
|
/* export * from './_services/oai-doc-chunk.service'; */
|
|
63
63
|
|
|
64
|
-
//
|
|
65
|
-
export * from './_services/oai-doc-chunk-data.service';
|
|
66
|
-
export * from './_services/oai-doc-page.data-service';
|
|
67
|
-
export * from './_services/oai-document.data-service';
|
|
64
|
+
// SERVICES
|
|
68
65
|
export * from './_services/oai-embedding.control-service';
|
|
69
66
|
export * from './_services/oai-llm-chat.service-base';
|
|
70
67
|
export * from './_services/oai-llm.service-base';
|
|
71
|
-
|
|
68
|
+
// services/DATA-SERVICES
|
|
69
|
+
export * from './_services/data-services/oai-doc-chunk-data.service';
|
|
70
|
+
export * from './_services/data-services/oai-doc-page.data-service';
|
|
71
|
+
export * from './_services/data-services/oai-document.data-service';
|
|
72
|
+
export * from './_services/data-services/oai-vector-data.service';
|
|
72
73
|
/* export * from './_services/oai-doc-chunk.service-base'; */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DyFM_OAI_Model, DyFM_OAI_Settings } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
2
2
|
import { DyNTS_OAI_LLMChat_ServiceBase } from './../../ai/_modules/open-ai/_services/oai-llm-chat.service-base';
|
|
3
3
|
import { DyNTS_DAI_DocChunk, DyNTS_DAI_docChunk_dataParams } from '../../ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model';
|
|
4
|
-
import { DyNTS_OAI_DocChunkDataService } from '../../ai/_modules/open-ai/_services/oai-doc-chunk-data.service';
|
|
4
|
+
import { DyNTS_OAI_DocChunkDataService } from '../../ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service';
|
|
5
5
|
import { DyFM_DataModel_Params, DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
6
6
|
// TODO: Fix imports when FSM package exports are updated
|
|
7
7
|
// import { DyFM_OAI_Settings } from '@futdevpro/fsm-dynamo';
|