@futdevpro/nts-dynamo 1.14.35 → 1.14.37

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 (58) hide show
  1. package/build/_modules/ai/_models/ai-input-interfaces.d.ts +20 -28
  2. package/build/_modules/ai/_models/ai-input-interfaces.d.ts.map +1 -1
  3. package/build/_modules/ai/_models/ai-input-interfaces.js +3 -0
  4. package/build/_modules/ai/_models/ai-input-interfaces.js.map +1 -1
  5. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +14 -58
  6. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -1
  7. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js +138 -147
  8. package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -1
  9. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +27 -180
  10. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
  11. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +147 -328
  12. package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
  13. package/build/_modules/ai/_services/ai-llm-chat.service-base.d.ts +22 -14
  14. package/build/_modules/ai/_services/ai-llm-chat.service-base.d.ts.map +1 -1
  15. package/build/_modules/ai/_services/ai-llm-chat.service-base.js.map +1 -1
  16. package/build/_modules/ai/_services/ai-llm.service-base.d.ts +52 -21
  17. package/build/_modules/ai/_services/ai-llm.service-base.d.ts.map +1 -1
  18. package/build/_modules/ai/_services/ai-llm.service-base.js +171 -0
  19. package/build/_modules/ai/_services/ai-llm.service-base.js.map +1 -1
  20. package/build/_modules/ai/_services/ai-provider.service-base.d.ts +1 -1
  21. package/build/_modules/ai/_services/ai-provider.service-base.d.ts.map +1 -1
  22. package/build/_modules/assistant/_services/ass-io.control-service.js +2 -2
  23. package/build/_modules/assistant/_services/ass-io.control-service.js.map +1 -1
  24. package/build/_modules/bot/_models/bot-channel-wrapper.interface.d.ts +8 -2
  25. package/build/_modules/bot/_models/bot-channel-wrapper.interface.d.ts.map +1 -1
  26. package/build/_modules/bot/_models/bot-channel-wrapper.interface.js +31 -0
  27. package/build/_modules/bot/_models/bot-channel-wrapper.interface.js.map +1 -1
  28. package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts +6 -1
  29. package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts.map +1 -1
  30. package/build/_modules/bot/_models/bot-message-wrapper.interface.js +39 -0
  31. package/build/_modules/bot/_models/bot-message-wrapper.interface.js.map +1 -1
  32. package/build/_modules/bot/_models/bot-user-wrapper.interface.d.ts +2 -1
  33. package/build/_modules/bot/_models/bot-user-wrapper.interface.d.ts.map +1 -1
  34. package/build/_modules/bot/_models/bot-user-wrapper.interface.js +18 -0
  35. package/build/_modules/bot/_models/bot-user-wrapper.interface.js.map +1 -1
  36. package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.js +9 -6
  37. package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.js.map +1 -1
  38. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.js +9 -6
  39. package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.js.map +1 -1
  40. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +9 -9
  41. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -1
  42. package/build/_modules/discord-assistant/_services/dias-io.control-service.js +2 -2
  43. package/build/_modules/discord-assistant/_services/dias-io.control-service.js.map +1 -1
  44. package/package.json +1 -1
  45. package/src/_modules/ai/_models/ai-input-interfaces.ts +63 -26
  46. package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +99 -139
  47. package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +246 -294
  48. package/src/_modules/ai/_services/ai-llm-chat.service-base.ts +36 -16
  49. package/src/_modules/ai/_services/ai-llm.service-base.ts +272 -28
  50. package/src/_modules/ai/_services/ai-provider.service-base.ts +1 -1
  51. package/src/_modules/assistant/_services/ass-io.control-service.ts +2 -2
  52. package/src/_modules/bot/_models/bot-channel-wrapper.interface.ts +30 -4
  53. package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +24 -2
  54. package/src/_modules/bot/_models/bot-user-wrapper.interface.ts +8 -2
  55. package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.ts +6 -6
  56. package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.ts +6 -6
  57. package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +9 -9
  58. package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +2 -2
@@ -38,12 +38,12 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
38
38
  maxContextLength: 128000,
39
39
  supportedModelTypes: ['gpt-4o', 'gpt-4o-mini', 'text-embedding-3-large', 'text-embedding-3-small']
40
40
  };
41
- get debugLog() {
42
- return this.defaultSettings.debugLog;
43
- }
44
- get defaultSystemPrompt() {
45
- return this.defaultSettings.systemPrompt;
46
- }
41
+ /* get _debugLog(): boolean {
42
+ return this.defaultSettings.debugLog;
43
+ } */
44
+ /* get defaultSystemPrompt(): string {
45
+ return this.defaultSettings.systemPrompt;
46
+ } */
47
47
  get defaultModel() {
48
48
  return this.defaultSettings.useModel;
49
49
  }
@@ -61,7 +61,15 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
61
61
  oai_global_settings_const_1.DyNTS_OAI_global_settings.defaultSettings ??
62
62
  new open_ai_1.DyFM_OAI_CallSettings();
63
63
  }
64
- defaultLogReplacer = '...long-context...';
64
+ /**
65
+ * Inicializálja az OpenAI client-et a megadott config-gal
66
+ *
67
+ * Reinitializes the OpenAI client with the provided config
68
+ */
69
+ setup(config) {
70
+ this.openai = new openai_1.OpenAI(config);
71
+ }
72
+ /* readonly defaultLogReplacer: string = '...long-context...'; */
65
73
  //#region Ask Questions
66
74
  /**
67
75
  * Asks the AI to answer a yes/no question
@@ -69,49 +77,50 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
69
77
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.yesNo.request} to ask the question,
70
78
  * and the {@link DyNTS_OAI_LLM_Predefined_Requests.yesNo.upperCaseYes} to check the answer
71
79
  */
72
- async askYesNoQuestion(set) {
73
- set.question += this.predefinedRequests.yesNo.request;
74
- const answer = await this.askQuestion(set);
75
- return answer.toUpperCase().includes(this.predefinedRequests.yesNo.upperCaseYes);
80
+ async requestYesNo(set) {
81
+ set.message += this.predefinedRequests.yesNo.request;
82
+ const answer = await this.requestSimpleMessage(set);
83
+ return this.convertAnswerToBoolean(answer);
76
84
  }
77
- /** the exact same as {@link askYesNoQuestion} */
85
+ /** the exact same as {@link requestYesNo} */
78
86
  //yesNoQuestion = this.askYesNoQuestion;
79
87
  /**
80
88
  * Asks the AI to answer a percentage question
81
89
  *
82
90
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.percentageOnly} to ask the question
83
91
  */
84
- async askPercentageQuestion(set) {
85
- set.question += this.predefinedRequests.percentageOnly;
86
- const answer = await this.askQuestion(set);
87
- if (isNaN(+answer)) {
88
- fsm_dynamo_1.DyFM_Log.error('GPT_ServiceBase', 'asykPercentageQuestion', 'Invalid answer', {
89
- question: set.question,
90
- answer,
91
- });
92
- return null;
93
- }
94
- return +answer;
92
+ async requestPercentage(set) {
93
+ set.message += this.predefinedRequests.percentageOnly;
94
+ const answer = await this.requestSimpleMessage(set);
95
+ return this.convertAnswerToNumber(answer, set.message);
95
96
  }
96
- /** the exact same as {@link askPercentageQuestion} */
97
+ /** the exact same as {@link requestPercentage} */
97
98
  //percentageQuestion = this.askPercentageQuestion;
98
99
  /**
99
100
  * Asks the AI to select one of the options from the list
100
101
  *
101
102
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.selectRequest} to ask the question
102
103
  */
103
- async askSelectQuestion(set) {
104
- // replace the {{DyNTS_selectOptions}} with the list of options
105
- const selectQuestionAddition = this.predefinedRequests.selectRequest.replace('{{DyNTS_selectOptions}}', this.getTextListAsText(set.selectFrom));
106
- set.question += selectQuestionAddition;
107
- let answer = await this.askQuestion(set);
108
- answer = answer.toLocaleUpperCase();
109
- for (const item of set.selectFrom) {
110
- if (answer.includes(item.toLocaleUpperCase()))
111
- return item;
112
- }
113
- return null;
114
- }
104
+ /* async askSelectQuestion(
105
+ set: DyFM_AI_GenericSelect_Input<string>
106
+ ): Promise<string> {
107
+ // replace the {{DyNTS_selectOptions}} with the list of options
108
+ const selectQuestionAddition = this.predefinedRequests.selectRequest.replace(
109
+ '{{DyNTS_selectOptions}}',
110
+ this.getTextListAsText(set.selectFrom)
111
+ );
112
+ set.message += selectQuestionAddition;
113
+
114
+ let answer = await this.requestSimpleMessage(set);
115
+
116
+ answer = answer.toLocaleUpperCase();
117
+
118
+ for (const item of set.selectFrom) {
119
+ if (answer.includes(item.toLocaleUpperCase())) return item;
120
+ }
121
+
122
+ return null;
123
+ } */
115
124
  /** the exact same as {@link askSelectQuestion} */
116
125
  //selectQuestion = this.askSelectQuestion;
117
126
  /**
@@ -122,10 +131,11 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
122
131
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.selectRequest} to ask the question
123
132
  */
124
133
  async requestSelect(set) {
125
- const selectQuestionAddition = this.predefinedRequests.selectRequest.replace('{{DyNTS_selectOptions}}', this.getTextListAsText(set.selectFrom.map(item => `"${JSON.stringify(item)}"`)));
126
- set.question += selectQuestionAddition;
127
- const answer = await this.askQuestion(set);
128
- return fsm_dynamo_1.DyFM_Object.safeParseJSON(answer);
134
+ const options = this.stringifySelectOptions(set.selectFrom);
135
+ const selectQuestionAddition = this.predefinedRequests.selectRequest.replace('{{DyNTS_selectOptions}}', this.getTextListAsText(options));
136
+ set.message += selectQuestionAddition;
137
+ const answer = await this.requestSimpleMessage(set);
138
+ return this.convertAnswerToSelectOption(answer, set.message, set.selectFrom);
129
139
  }
130
140
  /** the exact same as {@link requestSelect} */
131
141
  //selectRequest = this.requestSelect;
@@ -134,18 +144,32 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
134
144
  *
135
145
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
136
146
  */
137
- async askMultipleSelectQuestionWithOptions(set) {
138
- const selectQuestionAddition = this.predefinedRequests.multiselect.replace('{{DyNTS_selectOptions}}', this.getTextListAsText(set.options));
139
- set.question += selectQuestionAddition;
140
- let answer = await this.askQuestion(set);
147
+ async requestMultiselect(set) {
148
+ const options = this.stringifySelectOptions(set.options);
149
+ const selectQuestionAddition = this.predefinedRequests.multiselect.replace('{{DyNTS_selectOptions}}', this.getTextListAsText(options));
150
+ set.message += selectQuestionAddition;
151
+ let answer = await this.requestSimpleMessage(set);
141
152
  answer = answer.toLocaleUpperCase();
142
- const result = [];
143
- for (const item of set.options) {
144
- if (answer.includes(item.toLocaleUpperCase())) {
145
- result.push(item);
153
+ return this.convertAnswerToSelectOptions(answer, set.message, set.options);
154
+ /* const result: T[] = [];
155
+
156
+ for (const item of options) {
157
+ if (answer.includes(item.toLocaleUpperCase())) {
158
+ const parsedItem: T | { unparsableResult: string } = DyFM_Object.safeParseJSON<T>(item);
159
+ if ((parsedItem as { unparsableResult: string }).unparsableResult) {
160
+ result.push(item as any);
161
+ } else {
162
+ result.push(parsedItem as T);
146
163
  }
164
+
165
+ }
166
+ }
167
+
168
+ if (!result.length && !answer.trim().length) {
169
+ return { unparsableResult: answer };
147
170
  }
148
- return result;
171
+
172
+ return result; */
149
173
  }
150
174
  /** the exact same as {@link askMultipleSelectQuestionWithOptions} */
151
175
  //multipleSelectQuestion = this.askMultipleSelectQuestionWithOptions;
@@ -156,12 +180,19 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
156
180
  *
157
181
  * Uses the {@link DyNTS_OAI_LLM_Predefined_Requests.multiselect} to ask the question
158
182
  */
159
- async requestMultipleSelect(set) {
160
- const selectQuestionAddition = this.predefinedRequests.multiselect.replace('{{DyNTS_selectOptions}}', this.getTextListAsText(set.options.map(item => `"${JSON.stringify(item)}"`)));
161
- set.question += selectQuestionAddition;
162
- const answer = await this.askQuestion(set);
163
- return fsm_dynamo_1.DyFM_Object.safeParseList(answer);
164
- }
183
+ /* async requestMultiselect<T>(
184
+ set: DyFM_AI_GenericMultiSelect_Input<T, DyFM_OAI_CallSettings>
185
+ ): Promise<T[]> {
186
+ const selectQuestionAddition = this.predefinedRequests.multiselect.replace(
187
+ '{{DyNTS_selectOptions}}',
188
+ this.getTextListAsText(set.options.map(item => `"${JSON.stringify(item)}"`))
189
+ );
190
+ set.message += selectQuestionAddition;
191
+
192
+ const answer = await this.requestSimpleMessage(set);
193
+
194
+ return DyFM_Object.safeParseList<T[]>(answer);
195
+ } */
165
196
  /** the exact same as {@link requestMultipleSelect} */
166
197
  //multipleSelectRequest = this.requestMultipleSelect;
167
198
  /**
@@ -173,10 +204,10 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
173
204
  *
174
205
  * (uses {@link DyFM_safeParseJSON})
175
206
  */
176
- async askJSONQuestion(set) {
177
- set.question += this.predefinedRequests.jsonRequest;
178
- const answer = await this.askQuestion(set);
179
- return fsm_dynamo_1.DyFM_Object.safeParseJSON(answer);
207
+ async requestJSON(set) {
208
+ set.message += this.predefinedRequests.jsonRequest;
209
+ const answer = await this.requestSimpleMessage(set);
210
+ return this.convertAnswerToJSON(answer, set.message);
180
211
  }
181
212
  /** the exact same as {@link askJSONQuestion} */
182
213
  //jsonQuestion = this.askJSONQuestion;
@@ -189,13 +220,13 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
189
220
  *
190
221
  * (uses {@link DyFM_safeParseJSON})
191
222
  */
192
- async askJSONQuestionWithKeysDescription(set) {
223
+ async requestJSONQuestionWithKeysDescription(set) {
193
224
  const jsonRequestWithKeysDescription = this.predefinedRequests.jsonRequestWithKeysDescription.replace('{{DyNTS_jsonKeysDescription}}', set.keysDescription);
194
- set.question += jsonRequestWithKeysDescription;
195
- const answer = await this.askQuestion(set);
196
- return fsm_dynamo_1.DyFM_Object.safeParseJSON(answer);
225
+ set.message += jsonRequestWithKeysDescription;
226
+ const answer = await this.requestSimpleMessage(set);
227
+ return this.convertAnswerToJSON(answer, set.message);
197
228
  }
198
- /** the exact same as {@link askJSONQuestionWithKeysDescription} */
229
+ /** the exact same as {@link requestJSONQuestionWithKeysDescription} */
199
230
  //jsonQuestionWithKeysDescription = this.askJSONQuestionWithKeysDescription;
200
231
  /**
201
232
  * Asks the AI to answer a question that must result a JSON object with specific keys
@@ -206,11 +237,11 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
206
237
  *
207
238
  * (uses {@link DyFM_safeParseJSON})
208
239
  */
209
- async askJSONQuestionWithExactKeys(set) {
240
+ async requestJSONWithExactKeys(set) {
210
241
  const jsonRequestWithExactKeys = this.predefinedRequests.jsonRequestWithExactKeys.replace('{{DyNTS_jsonKeys}}', this.getTextListAsText(set.keys));
211
- set.question += jsonRequestWithExactKeys;
212
- const answer = await this.askQuestion(set);
213
- return fsm_dynamo_1.DyFM_Object.safeParseJSON(answer);
242
+ set.message += jsonRequestWithExactKeys;
243
+ const answer = await this.requestSimpleMessage(set);
244
+ return this.convertAnswerToJSON(answer, set.message);
214
245
  }
215
246
  /** the exact same as {@link askJSONQuestionWithExactKeys} */
216
247
  //jsonQuestionWithExactKeys = this.askJSONQuestionWithExactKeys;
@@ -223,67 +254,62 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
223
254
  *
224
255
  * (uses {@link DyFM_Object.safeParseList})
225
256
  */
226
- async askListQuestion(set) {
227
- set.question += this.predefinedRequests.listRequest;
228
- const answer = await this.askQuestion(set);
229
- return fsm_dynamo_1.DyFM_Object.safeParseList(answer);
230
- }
257
+ /* async requestList(
258
+ set: DyFM_AI_Base_Input<DyFM_OAI_CallSettings>
259
+ ): Promise<string[]> {
260
+ set.message += this.predefinedRequests.listRequest;
261
+
262
+ const answer = await this.requestSimpleMessage(set);
263
+
264
+ return this.convertAnswerToList<string>(answer, set.message);
265
+ } */
231
266
  /** the exact same as {@link askListQuestion} */
232
267
  //listQuestion = this.askListQuestion;
233
268
  /** the exact same as {@link askListQuestion} */
234
269
  //listRequest = this.askListQuestion;
270
+ async requestList(set) {
271
+ set.message += this.predefinedRequests.listRequest;
272
+ const answer = await this.requestSimpleMessage(set);
273
+ return this.convertAnswerToList(answer, set.message);
274
+ }
235
275
  /**
236
276
  * Asks the AI to answer a question
237
277
  *
238
278
  * Uses the {@link resolveSimpleUserMessage}
239
279
  */
240
- async askQuestion(set) {
280
+ async requestSimpleMessage(set) {
241
281
  this.logQuestion(set);
242
- const answer = await this.resolveSimpleUserMessage({
243
- message: set.question,
244
- issuer: set.issuer,
245
- settings: set.settings,
282
+ const answer = await this.resolveMessage({
283
+ ...set,
284
+ conversation: [{ role: ai_1.DyFM_AI_MessageRole.user, content: set.message }],
285
+ getFullResponse: false,
246
286
  });
247
- if (this.debugLog) {
248
- console.log(' - ', answer);
249
- }
287
+ this.logAnswer(answer);
250
288
  return answer;
251
289
  }
252
- /** the exact same as {@link askQuestion} */
290
+ /** the exact same as {@link requestSimpleMessage} */
253
291
  //answer = this.askQuestion;
254
- /** the exact same as {@link askQuestion} */
292
+ /** the exact same as {@link requestSimpleMessage} */
255
293
  //getQuestionAnswer = this.askQuestion;
256
- /** the exact same as {@link askQuestion} */
294
+ /** the exact same as {@link requestSimpleMessage} */
257
295
  //simpleQuestion = this.askQuestion;
258
- /** the exact same as {@link askQuestion} */
296
+ /** the exact same as {@link requestSimpleMessage} */
259
297
  //askSimpleQuestion = this.askQuestion;
260
- // async askJSONListQuestion(
261
- // question: string,
262
- // issuer: string,
263
- // settings?: DyFM_OAI_CallSettings,
264
- // debugLog?: boolean,
265
- // /** this is used to readably replace too long contents to eg '...' in logs */
266
- // replaceThisInLog?: string,
267
- // ): Promise<{ key: string, input: string }[]> {
268
- // question += this.predefinedRequests.jsonListRequest;
269
- //
270
- // const answer = await this.askQuestion(question, issuer, settings, debugLog, replaceThisInLog);
271
- //
272
- // return DyFM_Object.safeParseList<{ key: string, input: string }[]>(answer);
273
- // }
274
298
  /**
275
299
  * Resolves a simple user message and returns the answer as string
276
300
  *
277
301
  * Uses the {@link resolveMessage}
278
302
  */
279
- async resolveSimpleUserMessage(set) {
280
- return this.resolveMessage({
281
- conversation: [{ role: ai_1.DyFM_AI_MessageRole.user, content: set.message }],
282
- issuer: set.issuer,
283
- settings: set.settings,
284
- getFullResponse: false,
285
- });
286
- }
303
+ /* async resolveSimpleUserMessage(
304
+ set: DyFM_AI_Base_Input<DyFM_OAI_CallSettings>
305
+ ): Promise<string> {
306
+ return this.resolveMessage({
307
+ conversation: [{ role: DyFM_AI_MessageRole.user, content: set.message }],
308
+ issuer: set.issuer ?? 'unknown',
309
+ settings: set.settings ?? this.defaultSettings,
310
+ getFullResponse: false,
311
+ }) as Promise<string>;
312
+ } */
287
313
  /** the exact same as {@link resolveSimpleUserMessage} */
288
314
  //simpleUserMessage = this.resolveSimpleUserMessage;
289
315
  //#endregion
@@ -292,7 +318,20 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
292
318
  *
293
319
  * Uses the {@link getMessageCreateInput}
294
320
  */
295
- async resolveMessage(set) {
321
+ async resolveMessage(set
322
+ /* {
323
+ conversation: [{ role: DyFM_AI_MessageRole.user, content: set.message }],
324
+ issuer: set.issuer ?? 'unknown',
325
+ settings: set.settings ?? this.defaultSettings,
326
+ getFullResponse: false,
327
+ } */
328
+ /* {
329
+ conversation: DyFM_AI_Message[],
330
+ issuer: string,
331
+ settings?: DyFM_OAI_CallSettings,
332
+ getFullResponse?: boolean
333
+ } */
334
+ ) {
296
335
  try {
297
336
  set.conversation.unshift(this.getDefaultSystemMessage(set.settings));
298
337
  const result = await this.openai.chat.completions.create(this.getMessageCreateInput(set));
@@ -308,28 +347,6 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
308
347
  });
309
348
  }
310
349
  }
311
- //#region Tools
312
- /**
313
- * Logs the question if the debugLog is true
314
- */
315
- logQuestion(set) {
316
- if (set.debugLog ?? this.debugLog) {
317
- if (set.replaceThisInLog) {
318
- set.question = set.question.replace(set.replaceThisInLog, this.defaultLogReplacer);
319
- }
320
- console.log('\n - ', set.question);
321
- }
322
- }
323
- /**
324
- * olvasható mondatszerű-listaszerű formába teszi a listaelemeket
325
- * pl.: ['a', 'b', 'c'] -> '"a", "b" or "c"'
326
- */
327
- getTextListAsText(list) {
328
- list = list.filter(item => item?.trim()).map(item => `"${item}"`);
329
- /* list = list.map(item => item.toLocaleLowerCase()); */
330
- list.push(list.pop() + ' or ' + list.pop());
331
- return list.join(', ');
332
- }
333
350
  /**
334
351
  * Creates a message create input
335
352
  *
@@ -369,61 +386,6 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
369
386
  });
370
387
  }
371
388
  }
372
- getDefaultSystemMessage(settings) {
373
- return {
374
- role: ai_1.DyFM_AI_MessageRole.system,
375
- content: settings?.systemPrompt || this.defaultSystemPrompt,
376
- };
377
- }
378
- validateConversation(conversation) {
379
- conversation.forEach((message, index) => {
380
- if (!message.role) {
381
- throw new fsm_dynamo_1.DyFM_Error({
382
- message: `Message has no role at index ${index}`,
383
- additionalContent: {
384
- invalidMessage: message,
385
- conversation: conversation,
386
- }
387
- });
388
- }
389
- if (!message.content) {
390
- throw new fsm_dynamo_1.DyFM_Error({
391
- message: `Message has no content at index ${index}`,
392
- additionalContent: {
393
- invalidMessage: message,
394
- conversation: conversation,
395
- }
396
- });
397
- }
398
- });
399
- }
400
- /* protected getDefaultErrorSettings(
401
- fnName: string,
402
- error: DyFM_AnyError,
403
- issuer: string
404
- ): DyFM_Error_Settings {
405
- return {
406
- status: (error as DyFM_Error)?.___status ?? 500,
407
- message: (error as Error)?.message ??
408
- (error as DyFM_Error)?._message ??
409
- `${fnName} was UNSUCCESSFUL (${DyNTS_global_settings.systemShortCodeName})`,
410
- addECToUserMsg: !(error as DyFM_Error)?.__userMessage,
411
- userMessage: (error as DyFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
412
- issuer: issuer,
413
- issuerService: this.constructor?.name,
414
- error: error,
415
- };
416
- } */
417
- //#endregion
418
- //#region Provider Methods (from DyNTS_AI_Provider_ServiceBase)
419
- /**
420
- * Inicializálja az OpenAI client-et a megadott config-gal
421
- *
422
- * Reinitializes the OpenAI client with the provided config
423
- */
424
- initialize(config) {
425
- this.openai = new openai_1.OpenAI(config);
426
- }
427
389
  /**
428
390
  * Teszteli a kapcsolatot az OpenAI API-val
429
391
  *
@@ -442,149 +404,6 @@ class DyNTS_OAI_LLM_ServiceBase extends ai_llm_service_base_1.DyNTS_AI_LLM_Servi
442
404
  return false;
443
405
  }
444
406
  }
445
- //#endregion
446
- //#region Abstract LLM Methods (from DyNTS_AI_LLM_ServiceBase)
447
- /**
448
- * Meghívja az LLM-et system és user message-szel
449
- *
450
- * Calls the LLM with system and user messages
451
- */
452
- async callLLM(systemMessage, userMessage, settings, issuer) {
453
- const result = await this.resolveMessage({
454
- conversation: [
455
- { role: ai_1.DyFM_AI_MessageRole.system, content: systemMessage },
456
- { role: ai_1.DyFM_AI_MessageRole.user, content: userMessage }
457
- ],
458
- issuer: issuer ?? 'system',
459
- settings: this.convertToOAISettings(settings),
460
- getFullResponse: false
461
- });
462
- if (typeof result === 'string') {
463
- return result;
464
- }
465
- return '';
466
- }
467
- /**
468
- * Meghívja az LLM-et üzenet history-val
469
- *
470
- * Calls the LLM with message history
471
- */
472
- async callLLMWithHistory(messages, settings, issuer) {
473
- const result = await this.resolveMessage({
474
- conversation: messages,
475
- issuer: issuer ?? 'system',
476
- settings: this.convertToOAISettings(settings),
477
- getFullResponse: false
478
- });
479
- if (typeof result === 'string') {
480
- return result;
481
- }
482
- return '';
483
- }
484
- /**
485
- * Meghívja az LLM-et és visszaadja a raw response-t
486
- *
487
- * Calls the LLM and returns raw response
488
- */
489
- async callLLMRaw(messages, settings, issuer) {
490
- const result = await this.resolveMessage({
491
- conversation: messages,
492
- issuer: issuer ?? 'system',
493
- settings: this.convertToOAISettings(settings),
494
- getFullResponse: true
495
- });
496
- return {
497
- content: result.choices[0].message.content,
498
- usage: result.usage ? {
499
- promptTokens: result.usage.prompt_tokens,
500
- completionTokens: result.usage.completion_tokens,
501
- totalTokens: result.usage.total_tokens
502
- } : undefined,
503
- model: result.model,
504
- finishReason: result.choices[0].finish_reason,
505
- rawResponse: result
506
- };
507
- }
508
- /**
509
- * Küld egy egyszerű üzenetet az LLM-nek
510
- *
511
- * Sends a simple message to the LLM
512
- */
513
- async sendMessage(set) {
514
- return await this.resolveSimpleUserMessage({
515
- message: set.message,
516
- issuer: set.issuer,
517
- settings: set.settings ? this.convertToOAISettings(set.settings) : undefined
518
- });
519
- }
520
- /**
521
- * Kérdez egy kérdést és JSON választ vár exact keys-szel
522
- *
523
- * Asks a question and expects JSON response with exact keys
524
- */
525
- async requestJSONWithExactKeys(set) {
526
- const answer = await this.askJSONQuestionWithExactKeys({
527
- question: set.question,
528
- keys: set.keys,
529
- issuer: set.issuer,
530
- settings: set.settings ? this.convertToOAISettings(set.settings) : undefined,
531
- debugLog: set.debugLog,
532
- replaceThisInLog: set.replaceThisInLog
533
- });
534
- if ('unparsableResult' in answer) {
535
- throw new fsm_dynamo_1.DyFM_Error({
536
- message: 'Invalid JSON response from AI',
537
- additionalContent: { answer },
538
- userMessage: 'Failed to parse AI response'
539
- });
540
- }
541
- return answer;
542
- }
543
- /**
544
- * Kérdez egy kérdést és több választ vár
545
- *
546
- * Asks a question and expects multiple responses
547
- */
548
- async requestMultiselect(set) {
549
- const answer = await this.requestMultipleSelect({
550
- question: set.question,
551
- options: set.options,
552
- issuer: set.issuer,
553
- settings: set.settings ? this.convertToOAISettings(set.settings) : undefined,
554
- debugLog: set.debugLog,
555
- replaceThisInLog: set.replaceThisInLog
556
- });
557
- return answer;
558
- }
559
- /**
560
- * Konvertálja a generic AI settings-et OpenAI specifikus settings-re
561
- *
562
- * Converts generic AI settings to OpenAI-specific settings
563
- */
564
- convertToOAISettings(settings) {
565
- if (!settings)
566
- return undefined;
567
- const oaiSettings = new open_ai_1.DyFM_OAI_CallSettings();
568
- if (settings.systemPrompt)
569
- oaiSettings.systemPrompt = settings.systemPrompt;
570
- if (settings.useModel)
571
- oaiSettings.useModel = settings.useModel;
572
- if (settings.project)
573
- oaiSettings.project = settings.project;
574
- if (settings.debugLog !== undefined)
575
- oaiSettings.debugLog = settings.debugLog;
576
- if (settings.temperature !== undefined)
577
- oaiSettings.temperature = settings.temperature;
578
- if (settings.maxTokens !== undefined)
579
- oaiSettings.maxTokens = settings.maxTokens;
580
- if (settings.topP !== undefined)
581
- oaiSettings.topP = settings.topP;
582
- if (settings.frequencyPenalty !== undefined)
583
- oaiSettings.frequencyPenalty = settings.frequencyPenalty;
584
- if (settings.presencePenalty !== undefined)
585
- oaiSettings.presencePenalty = settings.presencePenalty;
586
- return oaiSettings;
587
- }
588
407
  }
589
408
  exports.DyNTS_OAI_LLM_ServiceBase = DyNTS_OAI_LLM_ServiceBase;
590
409
  //# sourceMappingURL=oai-llm.service-base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"oai-llm.service-base.js","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base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