@futdevpro/nts-dynamo 1.15.110 → 1.15.112
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/.dynamo/logs/cicd-pipeline/output.log +1639 -1634
- package/.dynamo/logs/cicd-pipeline/status.json +32 -32
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.d.ts +8 -0
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.d.ts.map +1 -1
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.js +2 -1
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.js.map +1 -1
- package/build/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.d.ts +21 -9
- package/build/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.d.ts.map +1 -1
- package/build/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.js +19 -10
- package/build/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.js.map +1 -1
- package/build/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.d.ts +9 -0
- package/build/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.d.ts.map +1 -0
- package/build/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.js +163 -0
- package/build/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.js.map +1 -0
- package/build/_modules/ai/_modules/ai-mock/index.d.ts +1 -0
- package/build/_modules/ai/_modules/ai-mock/index.d.ts.map +1 -1
- package/build/_modules/ai/_modules/ai-mock/index.js +2 -0
- package/build/_modules/ai/_modules/ai-mock/index.js.map +1 -1
- package/package.json +2 -2
- package/scripts/_seed-out/aim-seed.fixtures.ts +161 -0
- package/scripts/_seed-out/seed-raw.json +153 -0
- package/scripts/ai-fixture-seed.js +126 -0
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.ts +11 -1
- package/src/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.ts +22 -9
- package/src/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.ts +161 -0
- package/src/_modules/ai/_modules/ai-mock/index.ts +3 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { DyNTS_AIMock_Fixture } from '../_models/interfaces/aim-fixture.interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Valodi AI-generalasbol beegetve (live capture 2026-07-21). Kezzel NE szerkeszd.
|
|
5
|
+
*
|
|
6
|
+
* Determinisztikus sorrend (match-kulcs szerint) + rendezett objektum-kulcsok, hogy az ujra-generalas
|
|
7
|
+
* ne okozzon zajos diff-et. Forras: `DyNTS_AIMock_FixtureSerializer_Util`.
|
|
8
|
+
*/
|
|
9
|
+
export const DyNTS_AIMock_TextFixtures: DyNTS_AIMock_Fixture[] = [
|
|
10
|
+
{
|
|
11
|
+
"capturedAt": "2026-07-22T00:58:38.792Z",
|
|
12
|
+
"config": {
|
|
13
|
+
"temperature": 0
|
|
14
|
+
},
|
|
15
|
+
"input": "Reply with exactly: PONG",
|
|
16
|
+
"inputHash": "0fb5aed1b51b28b04409b7963b2453fe1597d198c3b8396fc8ebd072104511de",
|
|
17
|
+
"modality": "text",
|
|
18
|
+
"model": "gpt-4o-mini",
|
|
19
|
+
"output": {
|
|
20
|
+
"content": "PONG",
|
|
21
|
+
"finish_reason": "stop",
|
|
22
|
+
"usage": {
|
|
23
|
+
"completion_tokens": 2,
|
|
24
|
+
"completion_tokens_details": {
|
|
25
|
+
"accepted_prediction_tokens": 0,
|
|
26
|
+
"audio_tokens": 0,
|
|
27
|
+
"reasoning_tokens": 0,
|
|
28
|
+
"rejected_prediction_tokens": 0
|
|
29
|
+
},
|
|
30
|
+
"prompt_tokens": 13,
|
|
31
|
+
"prompt_tokens_details": {
|
|
32
|
+
"audio_tokens": 0,
|
|
33
|
+
"cached_tokens": 0
|
|
34
|
+
},
|
|
35
|
+
"total_tokens": 15
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"provider": "open-ai",
|
|
39
|
+
"sourceModel": "gpt-4o-mini"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"capturedAt": "2026-07-22T00:58:37.828Z",
|
|
43
|
+
"config": {
|
|
44
|
+
"temperature": 0
|
|
45
|
+
},
|
|
46
|
+
"input": "Reply with exactly: PONG",
|
|
47
|
+
"inputHash": "0fb5aed1b51b28b04409b7963b2453fe1597d198c3b8396fc8ebd072104511de",
|
|
48
|
+
"modality": "text",
|
|
49
|
+
"model": "gpt-5.4-nano",
|
|
50
|
+
"output": {
|
|
51
|
+
"content": "PONG",
|
|
52
|
+
"finish_reason": "stop",
|
|
53
|
+
"usage": {
|
|
54
|
+
"completion_tokens": 5,
|
|
55
|
+
"completion_tokens_details": {
|
|
56
|
+
"accepted_prediction_tokens": 0,
|
|
57
|
+
"audio_tokens": 0,
|
|
58
|
+
"reasoning_tokens": 0,
|
|
59
|
+
"rejected_prediction_tokens": 0
|
|
60
|
+
},
|
|
61
|
+
"prompt_tokens": 12,
|
|
62
|
+
"prompt_tokens_details": {
|
|
63
|
+
"audio_tokens": 0,
|
|
64
|
+
"cached_tokens": 0
|
|
65
|
+
},
|
|
66
|
+
"total_tokens": 17
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"provider": "open-ai",
|
|
70
|
+
"sourceModel": "gpt-5.4-nano"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"capturedAt": "2026-07-22T00:58:38.316Z",
|
|
74
|
+
"config": {
|
|
75
|
+
"temperature": 0
|
|
76
|
+
},
|
|
77
|
+
"input": "What is the capital of Hungary? One word.",
|
|
78
|
+
"inputHash": "85c5b3ea12c8e34d97a18cb75ae55936aeb2ef0af90eb2f395a44ace6ce997e8",
|
|
79
|
+
"modality": "text",
|
|
80
|
+
"model": "gpt-5.4-nano",
|
|
81
|
+
"output": {
|
|
82
|
+
"content": "Budapest",
|
|
83
|
+
"finish_reason": "stop",
|
|
84
|
+
"usage": {
|
|
85
|
+
"completion_tokens": 5,
|
|
86
|
+
"completion_tokens_details": {
|
|
87
|
+
"accepted_prediction_tokens": 0,
|
|
88
|
+
"audio_tokens": 0,
|
|
89
|
+
"reasoning_tokens": 0,
|
|
90
|
+
"rejected_prediction_tokens": 0
|
|
91
|
+
},
|
|
92
|
+
"prompt_tokens": 16,
|
|
93
|
+
"prompt_tokens_details": {
|
|
94
|
+
"audio_tokens": 0,
|
|
95
|
+
"cached_tokens": 0
|
|
96
|
+
},
|
|
97
|
+
"total_tokens": 21
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"provider": "open-ai",
|
|
101
|
+
"sourceModel": "gpt-5.4-nano"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"capturedAt": "2026-07-22T00:58:39.151Z",
|
|
105
|
+
"config": {},
|
|
106
|
+
"input": "artificial intelligence",
|
|
107
|
+
"inputHash": "803b3eb2b6af027151950019f2d5ede506a6636a9eafd262b27c23e3f834056f",
|
|
108
|
+
"modality": "embedding",
|
|
109
|
+
"model": "text-embedding-3-small",
|
|
110
|
+
"output": {
|
|
111
|
+
"dimensions": 1536,
|
|
112
|
+
"embeddingHead": [
|
|
113
|
+
0.0005774497985839844,
|
|
114
|
+
-0.012481689453125,
|
|
115
|
+
-0.01143646240234375,
|
|
116
|
+
-0.0247344970703125,
|
|
117
|
+
0.011383056640625,
|
|
118
|
+
-0.006069183349609375,
|
|
119
|
+
-0.0209503173828125,
|
|
120
|
+
0.03741455078125
|
|
121
|
+
],
|
|
122
|
+
"model": "text-embedding-3-small",
|
|
123
|
+
"object": "list",
|
|
124
|
+
"usage": {
|
|
125
|
+
"prompt_tokens": 3,
|
|
126
|
+
"total_tokens": 3
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"provider": "open-ai",
|
|
130
|
+
"sourceModel": "text-embedding-3-small"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"capturedAt": "2026-07-22T00:58:39.020Z",
|
|
134
|
+
"config": {},
|
|
135
|
+
"input": "the quick brown fox",
|
|
136
|
+
"inputHash": "9ecb36561341d18eb65484e833efea61edc74b84cf5e6ae1b81c63533e25fc8f",
|
|
137
|
+
"modality": "embedding",
|
|
138
|
+
"model": "text-embedding-3-small",
|
|
139
|
+
"output": {
|
|
140
|
+
"dimensions": 1536,
|
|
141
|
+
"embeddingHead": [
|
|
142
|
+
-0.033355712890625,
|
|
143
|
+
-0.00183868408203125,
|
|
144
|
+
0.005237579345703125,
|
|
145
|
+
-0.06304931640625,
|
|
146
|
+
-0.04779052734375,
|
|
147
|
+
0.0018625259399414062,
|
|
148
|
+
0.016876220703125,
|
|
149
|
+
0.034820556640625
|
|
150
|
+
],
|
|
151
|
+
"model": "text-embedding-3-small",
|
|
152
|
+
"object": "list",
|
|
153
|
+
"usage": {
|
|
154
|
+
"prompt_tokens": 4,
|
|
155
|
+
"total_tokens": 4
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"provider": "open-ai",
|
|
159
|
+
"sourceModel": "text-embedding-3-small"
|
|
160
|
+
}
|
|
161
|
+
];
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"provider": "open-ai",
|
|
4
|
+
"model": "gpt-5.4-nano",
|
|
5
|
+
"modality": "text",
|
|
6
|
+
"config": {
|
|
7
|
+
"temperature": 0
|
|
8
|
+
},
|
|
9
|
+
"input": "Reply with exactly: PONG",
|
|
10
|
+
"inputHash": "0fb5aed1b51b28b04409b7963b2453fe1597d198c3b8396fc8ebd072104511de",
|
|
11
|
+
"output": {
|
|
12
|
+
"content": "PONG",
|
|
13
|
+
"finish_reason": "stop",
|
|
14
|
+
"usage": {
|
|
15
|
+
"prompt_tokens": 12,
|
|
16
|
+
"completion_tokens": 5,
|
|
17
|
+
"total_tokens": 17,
|
|
18
|
+
"prompt_tokens_details": {
|
|
19
|
+
"cached_tokens": 0,
|
|
20
|
+
"audio_tokens": 0
|
|
21
|
+
},
|
|
22
|
+
"completion_tokens_details": {
|
|
23
|
+
"reasoning_tokens": 0,
|
|
24
|
+
"audio_tokens": 0,
|
|
25
|
+
"accepted_prediction_tokens": 0,
|
|
26
|
+
"rejected_prediction_tokens": 0
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"capturedAt": "2026-07-22T00:58:37.828Z",
|
|
31
|
+
"sourceModel": "gpt-5.4-nano"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"provider": "open-ai",
|
|
35
|
+
"model": "gpt-5.4-nano",
|
|
36
|
+
"modality": "text",
|
|
37
|
+
"config": {
|
|
38
|
+
"temperature": 0
|
|
39
|
+
},
|
|
40
|
+
"input": "What is the capital of Hungary? One word.",
|
|
41
|
+
"inputHash": "85c5b3ea12c8e34d97a18cb75ae55936aeb2ef0af90eb2f395a44ace6ce997e8",
|
|
42
|
+
"output": {
|
|
43
|
+
"content": "Budapest",
|
|
44
|
+
"finish_reason": "stop",
|
|
45
|
+
"usage": {
|
|
46
|
+
"prompt_tokens": 16,
|
|
47
|
+
"completion_tokens": 5,
|
|
48
|
+
"total_tokens": 21,
|
|
49
|
+
"prompt_tokens_details": {
|
|
50
|
+
"cached_tokens": 0,
|
|
51
|
+
"audio_tokens": 0
|
|
52
|
+
},
|
|
53
|
+
"completion_tokens_details": {
|
|
54
|
+
"reasoning_tokens": 0,
|
|
55
|
+
"audio_tokens": 0,
|
|
56
|
+
"accepted_prediction_tokens": 0,
|
|
57
|
+
"rejected_prediction_tokens": 0
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"capturedAt": "2026-07-22T00:58:38.316Z",
|
|
62
|
+
"sourceModel": "gpt-5.4-nano"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"provider": "open-ai",
|
|
66
|
+
"model": "gpt-4o-mini",
|
|
67
|
+
"modality": "text",
|
|
68
|
+
"config": {
|
|
69
|
+
"temperature": 0
|
|
70
|
+
},
|
|
71
|
+
"input": "Reply with exactly: PONG",
|
|
72
|
+
"inputHash": "0fb5aed1b51b28b04409b7963b2453fe1597d198c3b8396fc8ebd072104511de",
|
|
73
|
+
"output": {
|
|
74
|
+
"content": "PONG",
|
|
75
|
+
"finish_reason": "stop",
|
|
76
|
+
"usage": {
|
|
77
|
+
"prompt_tokens": 13,
|
|
78
|
+
"completion_tokens": 2,
|
|
79
|
+
"total_tokens": 15,
|
|
80
|
+
"prompt_tokens_details": {
|
|
81
|
+
"cached_tokens": 0,
|
|
82
|
+
"audio_tokens": 0
|
|
83
|
+
},
|
|
84
|
+
"completion_tokens_details": {
|
|
85
|
+
"reasoning_tokens": 0,
|
|
86
|
+
"audio_tokens": 0,
|
|
87
|
+
"accepted_prediction_tokens": 0,
|
|
88
|
+
"rejected_prediction_tokens": 0
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"capturedAt": "2026-07-22T00:58:38.792Z",
|
|
93
|
+
"sourceModel": "gpt-4o-mini"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"provider": "open-ai",
|
|
97
|
+
"model": "text-embedding-3-small",
|
|
98
|
+
"modality": "embedding",
|
|
99
|
+
"config": {},
|
|
100
|
+
"input": "the quick brown fox",
|
|
101
|
+
"inputHash": "9ecb36561341d18eb65484e833efea61edc74b84cf5e6ae1b81c63533e25fc8f",
|
|
102
|
+
"output": {
|
|
103
|
+
"object": "list",
|
|
104
|
+
"model": "text-embedding-3-small",
|
|
105
|
+
"dimensions": 1536,
|
|
106
|
+
"embeddingHead": [
|
|
107
|
+
-0.033355712890625,
|
|
108
|
+
-0.00183868408203125,
|
|
109
|
+
0.005237579345703125,
|
|
110
|
+
-0.06304931640625,
|
|
111
|
+
-0.04779052734375,
|
|
112
|
+
0.0018625259399414062,
|
|
113
|
+
0.016876220703125,
|
|
114
|
+
0.034820556640625
|
|
115
|
+
],
|
|
116
|
+
"usage": {
|
|
117
|
+
"prompt_tokens": 4,
|
|
118
|
+
"total_tokens": 4
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"capturedAt": "2026-07-22T00:58:39.020Z",
|
|
122
|
+
"sourceModel": "text-embedding-3-small"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"provider": "open-ai",
|
|
126
|
+
"model": "text-embedding-3-small",
|
|
127
|
+
"modality": "embedding",
|
|
128
|
+
"config": {},
|
|
129
|
+
"input": "artificial intelligence",
|
|
130
|
+
"inputHash": "803b3eb2b6af027151950019f2d5ede506a6636a9eafd262b27c23e3f834056f",
|
|
131
|
+
"output": {
|
|
132
|
+
"object": "list",
|
|
133
|
+
"model": "text-embedding-3-small",
|
|
134
|
+
"dimensions": 1536,
|
|
135
|
+
"embeddingHead": [
|
|
136
|
+
0.0005774497985839844,
|
|
137
|
+
-0.012481689453125,
|
|
138
|
+
-0.01143646240234375,
|
|
139
|
+
-0.0247344970703125,
|
|
140
|
+
0.011383056640625,
|
|
141
|
+
-0.006069183349609375,
|
|
142
|
+
-0.0209503173828125,
|
|
143
|
+
0.03741455078125
|
|
144
|
+
],
|
|
145
|
+
"usage": {
|
|
146
|
+
"prompt_tokens": 3,
|
|
147
|
+
"total_tokens": 3
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"capturedAt": "2026-07-22T00:58:39.151Z",
|
|
151
|
+
"sourceModel": "text-embedding-3-small"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FIZETOS fixture-seed (MP-3 SP-3.3) — a VALODI `DyNTS_AIMock_FixtureHarness_Service`-en es a
|
|
3
|
+
* `DyNTS_AIMock_FixtureSerializer_Util`-on keresztul, hogy a sajat kodutunkat is bizonyitsa (dogfooding).
|
|
4
|
+
*
|
|
5
|
+
* ⚠️ EZ PENZT KOLT. Szandekosan KICSI es KORLATOZOTT:
|
|
6
|
+
* - csak a legolcsobb engedett modellek (`gpt-5.4-nano` text, `text-embedding-3-small` embedding)
|
|
7
|
+
* - rovid promptok + szuk `max_completion_tokens`
|
|
8
|
+
* - kep-generalas NINCS (kulon dontes targya)
|
|
9
|
+
* - MINDEN fixture AZONNAL lemezre irodik (runbook §2c) — kvota-kifogyas nem viszi el az addigi munkat
|
|
10
|
+
* - 429 eseten az adott provider leall, a tobbi megy tovabb
|
|
11
|
+
* - a futas vegen kiirja a TENYLEGES token-fogyast
|
|
12
|
+
*
|
|
13
|
+
* Futtatas: node scripts/ai-fixture-seed.js
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const fs = require('fs');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
const ENV_PATH = path.resolve(__dirname, '../../../fdp-devops/.env');
|
|
20
|
+
const AIMOCK = path.resolve(__dirname, '../build/_modules/ai/_modules/ai-mock');
|
|
21
|
+
const OUT_DIR = path.resolve(__dirname, '_seed-out');
|
|
22
|
+
const RAW_FILE = path.join(OUT_DIR, 'seed-raw.json');
|
|
23
|
+
|
|
24
|
+
const { DyNTS_AIMock_FixtureHarness_Service } = require(path.join(AIMOCK, '_services/aim-fixture-harness.service'));
|
|
25
|
+
const { DyNTS_AIMock_FixtureSerializer_Util } = require(path.join(AIMOCK, '_collections/aim-fixture-serializer.util'));
|
|
26
|
+
const { DyNTS_AIMock_Modality } = require(path.join(AIMOCK, '_enums/aim-modality.enum'));
|
|
27
|
+
const { DyFM_OAI_Models } = require('@futdevpro/fsm-dynamo/ai/open-ai');
|
|
28
|
+
|
|
29
|
+
function loadKey() {
|
|
30
|
+
for (const line of fs.readFileSync(ENV_PATH, 'utf8').split(/\r?\n/)) {
|
|
31
|
+
const m = line.match(/^OPENAI_API_KEY=(.*)$/);
|
|
32
|
+
if (m) { return m[1].trim().replace(/^["']|["']$/g, ''); }
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const usage = { prompt: 0, completion: 0, calls: 0 };
|
|
38
|
+
let quotaStop = false;
|
|
39
|
+
|
|
40
|
+
/** VALODI generator — ez az egyetlen pont, ahol penz folyik. */
|
|
41
|
+
function makeGenerator(key) {
|
|
42
|
+
return async (request) => {
|
|
43
|
+
if (request.modality === DyNTS_AIMock_Modality.embedding) {
|
|
44
|
+
const r = await fetch('https://api.openai.com/v1/embeddings', {
|
|
45
|
+
method: 'POST',
|
|
46
|
+
headers: { Authorization: `Bearer ${key}`, 'content-type': 'application/json' },
|
|
47
|
+
body: JSON.stringify({ model: request.model, input: request.input, ...(request.config || {}) }),
|
|
48
|
+
});
|
|
49
|
+
if (r.status === 429) { quotaStop = true; throw new Error('429 quota'); }
|
|
50
|
+
const j = await r.json();
|
|
51
|
+
if (j.error) { throw new Error(j.error.message); }
|
|
52
|
+
usage.prompt += j.usage?.prompt_tokens || 0;
|
|
53
|
+
usage.calls++;
|
|
54
|
+
// a teljes vektor helyett a dimenziot + az elso 8 erteket orizzuk (a fixture-fajl maradjon kezelheto)
|
|
55
|
+
return { object: j.object, model: j.model, dimensions: j.data[0].embedding.length,
|
|
56
|
+
embeddingHead: j.data[0].embedding.slice(0, 8), usage: j.usage };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const r = await fetch('https://api.openai.com/v1/chat/completions', {
|
|
60
|
+
method: 'POST',
|
|
61
|
+
headers: { Authorization: `Bearer ${key}`, 'content-type': 'application/json' },
|
|
62
|
+
body: JSON.stringify({ model: request.model, messages: [ { role: 'user', content: request.input } ],
|
|
63
|
+
max_completion_tokens: 64, ...(request.config || {}) }),
|
|
64
|
+
});
|
|
65
|
+
if (r.status === 429) { quotaStop = true; throw new Error('429 quota'); }
|
|
66
|
+
const j = await r.json();
|
|
67
|
+
if (j.error) { throw new Error(j.error.message); }
|
|
68
|
+
usage.prompt += j.usage?.prompt_tokens || 0;
|
|
69
|
+
usage.completion += j.usage?.completion_tokens || 0;
|
|
70
|
+
usage.calls++;
|
|
71
|
+
return { content: j.choices[0].message.content, finish_reason: j.choices[0].finish_reason, usage: j.usage };
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const SEED = [
|
|
76
|
+
{ model: 'gpt-5.4-nano', modality: DyNTS_AIMock_Modality.text, config: { temperature: 0 }, input: 'Reply with exactly: PONG' },
|
|
77
|
+
{ model: 'gpt-5.4-nano', modality: DyNTS_AIMock_Modality.text, config: { temperature: 0 }, input: 'What is the capital of Hungary? One word.' },
|
|
78
|
+
{ model: 'gpt-4o-mini', modality: DyNTS_AIMock_Modality.text, config: { temperature: 0 }, input: 'Reply with exactly: PONG' },
|
|
79
|
+
{ model: 'text-embedding-3-small', modality: DyNTS_AIMock_Modality.embedding, config: {}, input: 'the quick brown fox' },
|
|
80
|
+
{ model: 'text-embedding-3-small', modality: DyNTS_AIMock_Modality.embedding, config: {}, input: 'artificial intelligence' },
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
(async () => {
|
|
84
|
+
const key = loadKey();
|
|
85
|
+
if (!key) { console.error('OPENAI_API_KEY hianyzik'); process.exit(1); }
|
|
86
|
+
|
|
87
|
+
const harness = new DyNTS_AIMock_FixtureHarness_Service({
|
|
88
|
+
generator: makeGenerator(key),
|
|
89
|
+
registry: DyFM_OAI_Models,
|
|
90
|
+
allowRealSpend: true, // ⚠️ JOVAHAGYOTT futas (G1). Alapertelmezesben ez false.
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
fs.mkdirSync(OUT_DIR, { recursive: true });
|
|
94
|
+
const fixtures = [];
|
|
95
|
+
|
|
96
|
+
console.log('FIZETOS seed — kicsi es korlatozott, fixture-onkent lemezre irva\n');
|
|
97
|
+
|
|
98
|
+
for (const s of SEED) {
|
|
99
|
+
if (quotaStop) { console.log(` KIHAGYVA (kvota): ${s.model} / ${s.input.slice(0, 30)}`); continue; }
|
|
100
|
+
try {
|
|
101
|
+
const f = await harness.capture({ provider: 'open-ai', model: s.model, modality: s.modality,
|
|
102
|
+
config: s.config, input: s.input });
|
|
103
|
+
fixtures.push(f);
|
|
104
|
+
fs.writeFileSync(RAW_FILE, JSON.stringify(fixtures, null, 2)); // INKREMENTALIS
|
|
105
|
+
console.log(` ✅ ${s.model} [${s.modality}] "${s.input.slice(0, 32)}"`);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
console.log(` ❌ ${s.model}: ${e.message.slice(0, 90)}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (fixtures.length) {
|
|
112
|
+
const src = DyNTS_AIMock_FixtureSerializer_Util.toConstantFile({
|
|
113
|
+
constName: 'DyNTS_AIMock_TextFixtures', fixtures, importPath: '../_models/interfaces/aim-fixture.interface',
|
|
114
|
+
headerNote: 'Valodi AI-generalasbol beegetve (live capture 2026-07-21). Kezzel NE szerkeszd.',
|
|
115
|
+
});
|
|
116
|
+
const again = DyNTS_AIMock_FixtureSerializer_Util.toConstantFile({
|
|
117
|
+
constName: 'DyNTS_AIMock_TextFixtures', fixtures, importPath: '../_models/interfaces/aim-fixture.interface',
|
|
118
|
+
headerNote: 'Valodi AI-generalasbol beegetve (live capture 2026-07-21). Kezzel NE szerkeszd.',
|
|
119
|
+
});
|
|
120
|
+
fs.writeFileSync(path.join(OUT_DIR, 'aim-seed.fixtures.ts'), src);
|
|
121
|
+
console.log(`\n determinizmus (ketszer szerializalva byte-azonos): ${src === again ? '✅ IGEN' : '❌ NEM'}`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
console.log(`\n📊 TENYLEGES fogyas: ${usage.calls} hivas · prompt ${usage.prompt} token · completion ${usage.completion} token`);
|
|
125
|
+
console.log(` ${fixtures.length} fixture → ${OUT_DIR}`);
|
|
126
|
+
})();
|
|
@@ -22,6 +22,14 @@ export class DyNTS_AIMock_FixtureSerializer_Util {
|
|
|
22
22
|
constName: string,
|
|
23
23
|
fixtures: DyNTS_AIMock_Fixture[],
|
|
24
24
|
headerNote?: string,
|
|
25
|
+
/**
|
|
26
|
+
* A generalt fajl import-utvonala a `DyNTS_AIMock_Fixture` tipushoz.
|
|
27
|
+
*
|
|
28
|
+
* Default a publikus package-utvonal (KULSO consumer fixture-fajljaihoz). **A csomagon BELULRE**
|
|
29
|
+
* kerulo fixture-oknel relativ utat kell adni (pl. `'../_models/interfaces/aim-fixture.interface'`),
|
|
30
|
+
* kulonben a fajl onmagara hivatkozna a package-nevvel, ami build-kor nem oldodik fel.
|
|
31
|
+
*/
|
|
32
|
+
importPath?: string,
|
|
25
33
|
}
|
|
26
34
|
): string {
|
|
27
35
|
const sorted: DyNTS_AIMock_Fixture[] = this.sortFixtures(set.fixtures);
|
|
@@ -31,8 +39,10 @@ export class DyNTS_AIMock_FixtureSerializer_Util {
|
|
|
31
39
|
|
|
32
40
|
const note: string = set.headerNote ?? 'Auto-generalt fixture-keszlet — kezzel NE szerkeszd.';
|
|
33
41
|
|
|
42
|
+
const importPath: string = set.importPath ?? '@futdevpro/nts-dynamo/ai/ai-mock';
|
|
43
|
+
|
|
34
44
|
return [
|
|
35
|
-
`import { DyNTS_AIMock_Fixture } from '
|
|
45
|
+
`import { DyNTS_AIMock_Fixture } from '${importPath}';`,
|
|
36
46
|
'',
|
|
37
47
|
'/**',
|
|
38
48
|
` * ${note}`,
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Az AI-mock által kezelt modalitások.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Az AI-mock által kezelt modalitások.
|
|
3
|
+
*
|
|
4
|
+
* **NEM `enum`, hanem const-objektum + azonos nevű string-literal union** (declaration merging).
|
|
5
|
+
* Ok — a beégetett fixture-fájloknak EGYSZERRE kell két dolgot teljesíteniük:
|
|
6
|
+
* 1. **JSON-érvényesnek** maradniuk (`"modality": "text"`), mert erre épül a `dc ai-mock-list` beolvasója
|
|
7
|
+
* és az end-to-end pipeline-bizonyíték (capture → szerializálás → visszaolvasás → replay);
|
|
8
|
+
* 2. **típushelyesnek** lenniük a csomagon BELÜL is (`DyNTS_AIMock_Fixture[]`).
|
|
9
|
+
*
|
|
10
|
+
* Egy TS `enum` ezt kizárja: a `"text"` string nem értékadható enum-típusnak (`TS2322`), ezért a
|
|
11
|
+
* szerializált fixture nem fordult. A const-objektum + union mindkettőt megadja, és a hívó oldalon a
|
|
12
|
+
* megszokott `DyNTS_AIMock_Modality.text` írásmód VÁLTOZATLANUL működik.
|
|
13
|
+
*
|
|
14
|
+
* (A fájlnév `.enum.ts` marad: fogalmilag továbbra is felsorolás, csak a TS-megvalósítás más.)
|
|
5
15
|
*/
|
|
6
|
-
export
|
|
16
|
+
export const DyNTS_AIMock_Modality = {
|
|
7
17
|
/** Szöveg-completion (chat / LLM). */
|
|
8
|
-
text
|
|
18
|
+
text: 'text',
|
|
9
19
|
/** Embedding-vektor kimenet. */
|
|
10
|
-
embedding
|
|
20
|
+
embedding: 'embedding',
|
|
11
21
|
/** Kép-generálás (base64 kimenet). */
|
|
12
|
-
image
|
|
22
|
+
image: 'image',
|
|
13
23
|
/** Hang: transcription (audio→szöveg) vagy TTS (szöveg→base64-audio). */
|
|
14
|
-
audio
|
|
15
|
-
}
|
|
24
|
+
audio: 'audio',
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
/** A modalitás-értékek uniója — string-literálok, ezért JSON-ból is közvetlenül értékadható. */
|
|
28
|
+
export type DyNTS_AIMock_Modality = typeof DyNTS_AIMock_Modality[keyof typeof DyNTS_AIMock_Modality];
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { DyNTS_AIMock_Fixture } from '../_models/interfaces/aim-fixture.interface';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Valodi AI-generalasbol beegetve (live capture 2026-07-21). Kezzel NE szerkeszd.
|
|
5
|
+
*
|
|
6
|
+
* Determinisztikus sorrend (match-kulcs szerint) + rendezett objektum-kulcsok, hogy az ujra-generalas
|
|
7
|
+
* ne okozzon zajos diff-et. Forras: `DyNTS_AIMock_FixtureSerializer_Util`.
|
|
8
|
+
*/
|
|
9
|
+
export const DyNTS_AIMock_TextFixtures: DyNTS_AIMock_Fixture[] = [
|
|
10
|
+
{
|
|
11
|
+
"capturedAt": "2026-07-22T00:58:38.792Z",
|
|
12
|
+
"config": {
|
|
13
|
+
"temperature": 0
|
|
14
|
+
},
|
|
15
|
+
"input": "Reply with exactly: PONG",
|
|
16
|
+
"inputHash": "0fb5aed1b51b28b04409b7963b2453fe1597d198c3b8396fc8ebd072104511de",
|
|
17
|
+
"modality": "text",
|
|
18
|
+
"model": "gpt-4o-mini",
|
|
19
|
+
"output": {
|
|
20
|
+
"content": "PONG",
|
|
21
|
+
"finish_reason": "stop",
|
|
22
|
+
"usage": {
|
|
23
|
+
"completion_tokens": 2,
|
|
24
|
+
"completion_tokens_details": {
|
|
25
|
+
"accepted_prediction_tokens": 0,
|
|
26
|
+
"audio_tokens": 0,
|
|
27
|
+
"reasoning_tokens": 0,
|
|
28
|
+
"rejected_prediction_tokens": 0
|
|
29
|
+
},
|
|
30
|
+
"prompt_tokens": 13,
|
|
31
|
+
"prompt_tokens_details": {
|
|
32
|
+
"audio_tokens": 0,
|
|
33
|
+
"cached_tokens": 0
|
|
34
|
+
},
|
|
35
|
+
"total_tokens": 15
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"provider": "open-ai",
|
|
39
|
+
"sourceModel": "gpt-4o-mini"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"capturedAt": "2026-07-22T00:58:37.828Z",
|
|
43
|
+
"config": {
|
|
44
|
+
"temperature": 0
|
|
45
|
+
},
|
|
46
|
+
"input": "Reply with exactly: PONG",
|
|
47
|
+
"inputHash": "0fb5aed1b51b28b04409b7963b2453fe1597d198c3b8396fc8ebd072104511de",
|
|
48
|
+
"modality": "text",
|
|
49
|
+
"model": "gpt-5.4-nano",
|
|
50
|
+
"output": {
|
|
51
|
+
"content": "PONG",
|
|
52
|
+
"finish_reason": "stop",
|
|
53
|
+
"usage": {
|
|
54
|
+
"completion_tokens": 5,
|
|
55
|
+
"completion_tokens_details": {
|
|
56
|
+
"accepted_prediction_tokens": 0,
|
|
57
|
+
"audio_tokens": 0,
|
|
58
|
+
"reasoning_tokens": 0,
|
|
59
|
+
"rejected_prediction_tokens": 0
|
|
60
|
+
},
|
|
61
|
+
"prompt_tokens": 12,
|
|
62
|
+
"prompt_tokens_details": {
|
|
63
|
+
"audio_tokens": 0,
|
|
64
|
+
"cached_tokens": 0
|
|
65
|
+
},
|
|
66
|
+
"total_tokens": 17
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"provider": "open-ai",
|
|
70
|
+
"sourceModel": "gpt-5.4-nano"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"capturedAt": "2026-07-22T00:58:38.316Z",
|
|
74
|
+
"config": {
|
|
75
|
+
"temperature": 0
|
|
76
|
+
},
|
|
77
|
+
"input": "What is the capital of Hungary? One word.",
|
|
78
|
+
"inputHash": "85c5b3ea12c8e34d97a18cb75ae55936aeb2ef0af90eb2f395a44ace6ce997e8",
|
|
79
|
+
"modality": "text",
|
|
80
|
+
"model": "gpt-5.4-nano",
|
|
81
|
+
"output": {
|
|
82
|
+
"content": "Budapest",
|
|
83
|
+
"finish_reason": "stop",
|
|
84
|
+
"usage": {
|
|
85
|
+
"completion_tokens": 5,
|
|
86
|
+
"completion_tokens_details": {
|
|
87
|
+
"accepted_prediction_tokens": 0,
|
|
88
|
+
"audio_tokens": 0,
|
|
89
|
+
"reasoning_tokens": 0,
|
|
90
|
+
"rejected_prediction_tokens": 0
|
|
91
|
+
},
|
|
92
|
+
"prompt_tokens": 16,
|
|
93
|
+
"prompt_tokens_details": {
|
|
94
|
+
"audio_tokens": 0,
|
|
95
|
+
"cached_tokens": 0
|
|
96
|
+
},
|
|
97
|
+
"total_tokens": 21
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"provider": "open-ai",
|
|
101
|
+
"sourceModel": "gpt-5.4-nano"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"capturedAt": "2026-07-22T00:58:39.151Z",
|
|
105
|
+
"config": {},
|
|
106
|
+
"input": "artificial intelligence",
|
|
107
|
+
"inputHash": "803b3eb2b6af027151950019f2d5ede506a6636a9eafd262b27c23e3f834056f",
|
|
108
|
+
"modality": "embedding",
|
|
109
|
+
"model": "text-embedding-3-small",
|
|
110
|
+
"output": {
|
|
111
|
+
"dimensions": 1536,
|
|
112
|
+
"embeddingHead": [
|
|
113
|
+
0.0005774497985839844,
|
|
114
|
+
-0.012481689453125,
|
|
115
|
+
-0.01143646240234375,
|
|
116
|
+
-0.0247344970703125,
|
|
117
|
+
0.011383056640625,
|
|
118
|
+
-0.006069183349609375,
|
|
119
|
+
-0.0209503173828125,
|
|
120
|
+
0.03741455078125
|
|
121
|
+
],
|
|
122
|
+
"model": "text-embedding-3-small",
|
|
123
|
+
"object": "list",
|
|
124
|
+
"usage": {
|
|
125
|
+
"prompt_tokens": 3,
|
|
126
|
+
"total_tokens": 3
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"provider": "open-ai",
|
|
130
|
+
"sourceModel": "text-embedding-3-small"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"capturedAt": "2026-07-22T00:58:39.020Z",
|
|
134
|
+
"config": {},
|
|
135
|
+
"input": "the quick brown fox",
|
|
136
|
+
"inputHash": "9ecb36561341d18eb65484e833efea61edc74b84cf5e6ae1b81c63533e25fc8f",
|
|
137
|
+
"modality": "embedding",
|
|
138
|
+
"model": "text-embedding-3-small",
|
|
139
|
+
"output": {
|
|
140
|
+
"dimensions": 1536,
|
|
141
|
+
"embeddingHead": [
|
|
142
|
+
-0.033355712890625,
|
|
143
|
+
-0.00183868408203125,
|
|
144
|
+
0.005237579345703125,
|
|
145
|
+
-0.06304931640625,
|
|
146
|
+
-0.04779052734375,
|
|
147
|
+
0.0018625259399414062,
|
|
148
|
+
0.016876220703125,
|
|
149
|
+
0.034820556640625
|
|
150
|
+
],
|
|
151
|
+
"model": "text-embedding-3-small",
|
|
152
|
+
"object": "list",
|
|
153
|
+
"usage": {
|
|
154
|
+
"prompt_tokens": 4,
|
|
155
|
+
"total_tokens": 4
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"provider": "open-ai",
|
|
159
|
+
"sourceModel": "text-embedding-3-small"
|
|
160
|
+
}
|
|
161
|
+
];
|
|
@@ -19,6 +19,9 @@ export * from './_services/ai-embedding-mock.service';
|
|
|
19
19
|
// ENUMS
|
|
20
20
|
export * from './_enums/aim-modality.enum';
|
|
21
21
|
|
|
22
|
+
// FIXTURES — valódi AI-generálásból beégetve (live capture 2026-07-21). Git-tracked, determinisztikus (D6).
|
|
23
|
+
export * from './fixtures/aim-text.fixtures';
|
|
24
|
+
|
|
22
25
|
// MODELS / INTERFACES — fixture-shape (MP-3 SP-3.1)
|
|
23
26
|
export * from './_models/interfaces/aim-request.interface';
|
|
24
27
|
export * from './_models/interfaces/aim-error.interface';
|