@yrpri/api 9.0.112 → 9.0.114
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.
|
@@ -54,21 +54,22 @@ export class NewAiModelSetup {
|
|
|
54
54
|
const anthropicSonnet = await PsAiModel.findOne({
|
|
55
55
|
where: { name: "Anthropic Sonnet 3.5" },
|
|
56
56
|
});
|
|
57
|
+
const anthropicSonnetConfig = {
|
|
58
|
+
type: PsAiModelType.Text,
|
|
59
|
+
modelSize: PsAiModelSize.Medium,
|
|
60
|
+
provider: "anthropic",
|
|
61
|
+
prices: {
|
|
62
|
+
costInTokensPerMillion: 3,
|
|
63
|
+
costOutTokensPerMillion: 15,
|
|
64
|
+
costInCachedContextTokensPerMillion: 0.3,
|
|
65
|
+
currency: "USD",
|
|
66
|
+
},
|
|
67
|
+
maxTokensOut: 8000,
|
|
68
|
+
defaultTemperature: 0.7,
|
|
69
|
+
model: "claude-3-5-sonnet-20240620",
|
|
70
|
+
active: true,
|
|
71
|
+
};
|
|
57
72
|
if (!anthropicSonnet) {
|
|
58
|
-
const anthropicSonnetConfig = {
|
|
59
|
-
type: PsAiModelType.Text,
|
|
60
|
-
modelSize: PsAiModelSize.Medium,
|
|
61
|
-
provider: "anthropic",
|
|
62
|
-
prices: {
|
|
63
|
-
costInTokensPerMillion: 3,
|
|
64
|
-
costOutTokensPerMillion: 15,
|
|
65
|
-
currency: "USD",
|
|
66
|
-
},
|
|
67
|
-
maxTokensOut: 8000,
|
|
68
|
-
defaultTemperature: 0.7,
|
|
69
|
-
model: "claude-3-5-sonnet-20240620",
|
|
70
|
-
active: true,
|
|
71
|
-
};
|
|
72
73
|
const createdModel = await PsAiModel.create({
|
|
73
74
|
name: "Anthropic Sonnet 3.5",
|
|
74
75
|
organization_id: 1,
|
|
@@ -79,6 +80,9 @@ export class NewAiModelSetup {
|
|
|
79
80
|
}
|
|
80
81
|
else {
|
|
81
82
|
console.log("Anthropic model already exists: Anthropic Sonnet 3.5");
|
|
83
|
+
anthropicSonnet.set("configuration", anthropicSonnetConfig);
|
|
84
|
+
anthropicSonnet.changed("configuration", true);
|
|
85
|
+
await anthropicSonnet.save();
|
|
82
86
|
}
|
|
83
87
|
}
|
|
84
88
|
static async seedAnthropic37Models(userId) {
|
|
@@ -92,6 +96,7 @@ export class NewAiModelSetup {
|
|
|
92
96
|
prices: {
|
|
93
97
|
costInTokensPerMillion: 3,
|
|
94
98
|
costOutTokensPerMillion: 15,
|
|
99
|
+
costInCachedContextTokensPerMillion: 0.3,
|
|
95
100
|
currency: "USD",
|
|
96
101
|
},
|
|
97
102
|
maxTokensOut: 8000,
|
|
@@ -110,6 +115,9 @@ export class NewAiModelSetup {
|
|
|
110
115
|
}
|
|
111
116
|
else {
|
|
112
117
|
console.log("Anthropic model already exists: Anthropic Sonnet 3.7");
|
|
118
|
+
anthropicSonnet.set("configuration", anthropicSonnetConfig);
|
|
119
|
+
anthropicSonnet.changed("configuration", true);
|
|
120
|
+
await anthropicSonnet.save();
|
|
113
121
|
}
|
|
114
122
|
}
|
|
115
123
|
/**
|
|
@@ -129,6 +137,7 @@ export class NewAiModelSetup {
|
|
|
129
137
|
prices: {
|
|
130
138
|
costInTokensPerMillion: 2.5,
|
|
131
139
|
costOutTokensPerMillion: 10,
|
|
140
|
+
costInCachedContextTokensPerMillion: 1.25,
|
|
132
141
|
currency: "USD",
|
|
133
142
|
},
|
|
134
143
|
maxTokensOut: 16384,
|
|
@@ -155,21 +164,22 @@ export class NewAiModelSetup {
|
|
|
155
164
|
const openAiGpt4Mini = await PsAiModel.findOne({
|
|
156
165
|
where: { name: "GPT-4o Mini" },
|
|
157
166
|
});
|
|
167
|
+
const openAiGpt4oMiniConfig = {
|
|
168
|
+
type: PsAiModelType.Text,
|
|
169
|
+
modelSize: PsAiModelSize.Small,
|
|
170
|
+
provider: "openai",
|
|
171
|
+
prices: {
|
|
172
|
+
costInTokensPerMillion: 0.15,
|
|
173
|
+
costOutTokensPerMillion: 0.6,
|
|
174
|
+
costInCachedContextTokensPerMillion: 0.075,
|
|
175
|
+
currency: "USD",
|
|
176
|
+
},
|
|
177
|
+
maxTokensOut: 16384,
|
|
178
|
+
defaultTemperature: 0.0,
|
|
179
|
+
model: "gpt-4o-mini",
|
|
180
|
+
active: true,
|
|
181
|
+
};
|
|
158
182
|
if (!openAiGpt4Mini) {
|
|
159
|
-
const openAiGpt4oMiniConfig = {
|
|
160
|
-
type: PsAiModelType.Text,
|
|
161
|
-
modelSize: PsAiModelSize.Small,
|
|
162
|
-
provider: "openai",
|
|
163
|
-
prices: {
|
|
164
|
-
costInTokensPerMillion: 0.15,
|
|
165
|
-
costOutTokensPerMillion: 0.6,
|
|
166
|
-
currency: "USD",
|
|
167
|
-
},
|
|
168
|
-
maxTokensOut: 16384,
|
|
169
|
-
defaultTemperature: 0.0,
|
|
170
|
-
model: "gpt-4o-mini",
|
|
171
|
-
active: true,
|
|
172
|
-
};
|
|
173
183
|
await PsAiModel.create({
|
|
174
184
|
name: "GPT-4o Mini",
|
|
175
185
|
organization_id: 1,
|
|
@@ -179,27 +189,31 @@ export class NewAiModelSetup {
|
|
|
179
189
|
console.log("Created OpenAI model: GPT-4o Mini");
|
|
180
190
|
}
|
|
181
191
|
else {
|
|
192
|
+
openAiGpt4Mini.set("configuration", openAiGpt4oMiniConfig);
|
|
193
|
+
openAiGpt4Mini.changed("configuration", true);
|
|
194
|
+
await openAiGpt4Mini.save();
|
|
182
195
|
console.log("OpenAI model already exists: GPT-4o Mini");
|
|
183
196
|
}
|
|
184
197
|
// o1 Mini
|
|
185
198
|
const openAio1Mini = await PsAiModel.findOne({
|
|
186
199
|
where: { name: "o1 Mini" },
|
|
187
200
|
});
|
|
201
|
+
const openAio1MiniConfig = {
|
|
202
|
+
type: PsAiModelType.TextReasoning,
|
|
203
|
+
modelSize: PsAiModelSize.Small,
|
|
204
|
+
provider: "openai",
|
|
205
|
+
prices: {
|
|
206
|
+
costInTokensPerMillion: 1.1,
|
|
207
|
+
costOutTokensPerMillion: 4.4,
|
|
208
|
+
costInCachedContextTokensPerMillion: 0.55,
|
|
209
|
+
currency: "USD",
|
|
210
|
+
},
|
|
211
|
+
maxTokensOut: 32000,
|
|
212
|
+
defaultTemperature: 0.0,
|
|
213
|
+
model: "o1-mini",
|
|
214
|
+
active: true,
|
|
215
|
+
};
|
|
188
216
|
if (!openAio1Mini) {
|
|
189
|
-
const openAio1MiniConfig = {
|
|
190
|
-
type: PsAiModelType.TextReasoning,
|
|
191
|
-
modelSize: PsAiModelSize.Small,
|
|
192
|
-
provider: "openai",
|
|
193
|
-
prices: {
|
|
194
|
-
costInTokensPerMillion: 3.0,
|
|
195
|
-
costOutTokensPerMillion: 12.0,
|
|
196
|
-
currency: "USD",
|
|
197
|
-
},
|
|
198
|
-
maxTokensOut: 32000,
|
|
199
|
-
defaultTemperature: 0.0,
|
|
200
|
-
model: "o1-mini",
|
|
201
|
-
active: true,
|
|
202
|
-
};
|
|
203
217
|
await PsAiModel.create({
|
|
204
218
|
name: "o1 Mini",
|
|
205
219
|
organization_id: 1,
|
|
@@ -209,27 +223,31 @@ export class NewAiModelSetup {
|
|
|
209
223
|
console.log("Created OpenAI model: o1 Mini");
|
|
210
224
|
}
|
|
211
225
|
else {
|
|
226
|
+
openAio1Mini.set("configuration", openAio1MiniConfig);
|
|
227
|
+
openAio1Mini.changed("configuration", true);
|
|
228
|
+
await openAio1Mini.save();
|
|
212
229
|
console.log("OpenAI model already exists: o1 Mini");
|
|
213
230
|
}
|
|
214
231
|
// o1 Preview
|
|
215
232
|
const openAio1Preview = await PsAiModel.findOne({
|
|
216
233
|
where: { name: "o1 Preview" },
|
|
217
234
|
});
|
|
235
|
+
const openAio1PreviewConfig = {
|
|
236
|
+
type: PsAiModelType.TextReasoning,
|
|
237
|
+
modelSize: PsAiModelSize.Medium,
|
|
238
|
+
provider: "openai",
|
|
239
|
+
prices: {
|
|
240
|
+
costInTokensPerMillion: 15.0,
|
|
241
|
+
costOutTokensPerMillion: 60.0,
|
|
242
|
+
costInCachedContextTokensPerMillion: 7.5,
|
|
243
|
+
currency: "USD",
|
|
244
|
+
},
|
|
245
|
+
maxTokensOut: 32000,
|
|
246
|
+
defaultTemperature: 0.0,
|
|
247
|
+
model: "o1-preview",
|
|
248
|
+
active: true,
|
|
249
|
+
};
|
|
218
250
|
if (!openAio1Preview) {
|
|
219
|
-
const openAio1PreviewConfig = {
|
|
220
|
-
type: PsAiModelType.TextReasoning,
|
|
221
|
-
modelSize: PsAiModelSize.Medium,
|
|
222
|
-
provider: "openai",
|
|
223
|
-
prices: {
|
|
224
|
-
costInTokensPerMillion: 15.0,
|
|
225
|
-
costOutTokensPerMillion: 60.0,
|
|
226
|
-
currency: "USD",
|
|
227
|
-
},
|
|
228
|
-
maxTokensOut: 32000,
|
|
229
|
-
defaultTemperature: 0.0,
|
|
230
|
-
model: "o1-preview",
|
|
231
|
-
active: true,
|
|
232
|
-
};
|
|
233
251
|
await PsAiModel.create({
|
|
234
252
|
name: "o1 Preview",
|
|
235
253
|
organization_id: 1,
|
|
@@ -239,6 +257,9 @@ export class NewAiModelSetup {
|
|
|
239
257
|
console.log("Created OpenAI model: o1 Preview");
|
|
240
258
|
}
|
|
241
259
|
else {
|
|
260
|
+
openAio1Preview.set("configuration", openAio1PreviewConfig);
|
|
261
|
+
openAio1Preview.changed("configuration", true);
|
|
262
|
+
await openAio1Preview.save();
|
|
242
263
|
console.log("OpenAI model already exists: o1 Preview");
|
|
243
264
|
}
|
|
244
265
|
// o1 24
|
|
@@ -252,6 +273,7 @@ export class NewAiModelSetup {
|
|
|
252
273
|
prices: {
|
|
253
274
|
costInTokensPerMillion: 15.0,
|
|
254
275
|
costOutTokensPerMillion: 60.0,
|
|
276
|
+
costInCachedContextTokensPerMillion: 7.5,
|
|
255
277
|
currency: "USD",
|
|
256
278
|
},
|
|
257
279
|
maxTokensOut: 100000,
|
|
@@ -278,21 +300,22 @@ export class NewAiModelSetup {
|
|
|
278
300
|
const openAio3Mini = await PsAiModel.findOne({
|
|
279
301
|
where: { name: "o3 mini" },
|
|
280
302
|
});
|
|
303
|
+
const openAio3MiniConfig = {
|
|
304
|
+
type: PsAiModelType.TextReasoning,
|
|
305
|
+
modelSize: PsAiModelSize.Small,
|
|
306
|
+
provider: "openai",
|
|
307
|
+
prices: {
|
|
308
|
+
costInTokensPerMillion: 1.1,
|
|
309
|
+
costOutTokensPerMillion: 4.4,
|
|
310
|
+
costInCachedContextTokensPerMillion: 0.55,
|
|
311
|
+
currency: "USD",
|
|
312
|
+
},
|
|
313
|
+
maxTokensOut: 100000,
|
|
314
|
+
defaultTemperature: 0.0,
|
|
315
|
+
model: "o3-mini",
|
|
316
|
+
active: true,
|
|
317
|
+
};
|
|
281
318
|
if (!openAio3Mini) {
|
|
282
|
-
const openAio3MiniConfig = {
|
|
283
|
-
type: PsAiModelType.TextReasoning,
|
|
284
|
-
modelSize: PsAiModelSize.Small,
|
|
285
|
-
provider: "openai",
|
|
286
|
-
prices: {
|
|
287
|
-
costInTokensPerMillion: 1.1,
|
|
288
|
-
costOutTokensPerMillion: 4.4,
|
|
289
|
-
currency: "USD",
|
|
290
|
-
},
|
|
291
|
-
maxTokensOut: 100000,
|
|
292
|
-
defaultTemperature: 0.0,
|
|
293
|
-
model: "o3-mini",
|
|
294
|
-
active: true,
|
|
295
|
-
};
|
|
296
319
|
await PsAiModel.create({
|
|
297
320
|
name: "o3 mini",
|
|
298
321
|
organization_id: 1,
|
|
@@ -302,6 +325,9 @@ export class NewAiModelSetup {
|
|
|
302
325
|
console.log("Created OpenAI model: o3 mini");
|
|
303
326
|
}
|
|
304
327
|
else {
|
|
328
|
+
openAio3Mini.set("configuration", openAio3MiniConfig);
|
|
329
|
+
openAio3Mini.changed("configuration", true);
|
|
330
|
+
await openAio3Mini.save();
|
|
305
331
|
console.log("OpenAI model already exists: o3 mini");
|
|
306
332
|
}
|
|
307
333
|
const openAiGpt45 = await PsAiModel.findOne({
|
|
@@ -314,6 +340,7 @@ export class NewAiModelSetup {
|
|
|
314
340
|
prices: {
|
|
315
341
|
costInTokensPerMillion: 75,
|
|
316
342
|
costOutTokensPerMillion: 150,
|
|
343
|
+
costInCachedContextTokensPerMillion: 37.5,
|
|
317
344
|
currency: "USD",
|
|
318
345
|
},
|
|
319
346
|
maxTokensOut: 100000,
|
|
@@ -331,7 +358,10 @@ export class NewAiModelSetup {
|
|
|
331
358
|
console.log("Created OpenAI model: GPT-4.5 Preview");
|
|
332
359
|
}
|
|
333
360
|
else {
|
|
334
|
-
|
|
361
|
+
openAiGpt45.set("configuration", openAiGpt45Config);
|
|
362
|
+
openAiGpt45.changed("configuration", true);
|
|
363
|
+
await openAiGpt45.save();
|
|
364
|
+
console.log("OpenAI model already exists: GPT-4.5 Preview");
|
|
335
365
|
}
|
|
336
366
|
const openAio3 = await PsAiModel.findOne({
|
|
337
367
|
where: { name: "o3" },
|
|
@@ -343,7 +373,7 @@ export class NewAiModelSetup {
|
|
|
343
373
|
prices: {
|
|
344
374
|
costInTokensPerMillion: 10.0,
|
|
345
375
|
costOutTokensPerMillion: 40.0,
|
|
346
|
-
|
|
376
|
+
costInCachedContextTokensPerMillion: 2.5,
|
|
347
377
|
currency: "USD",
|
|
348
378
|
},
|
|
349
379
|
maxTokensOut: 100000,
|
|
@@ -376,7 +406,7 @@ export class NewAiModelSetup {
|
|
|
376
406
|
prices: {
|
|
377
407
|
costInTokensPerMillion: 1.1,
|
|
378
408
|
costOutTokensPerMillion: 4.4,
|
|
379
|
-
|
|
409
|
+
costInCachedContextTokensPerMillion: 0.275,
|
|
380
410
|
currency: "USD",
|
|
381
411
|
},
|
|
382
412
|
maxTokensOut: 100000,
|
|
@@ -394,6 +424,9 @@ export class NewAiModelSetup {
|
|
|
394
424
|
console.log("Created OpenAI model: o4 mini");
|
|
395
425
|
}
|
|
396
426
|
else {
|
|
427
|
+
openAio4mini.set("configuration", openAio4miniConfig);
|
|
428
|
+
openAio4mini.changed("configuration", true);
|
|
429
|
+
await openAio4mini.save();
|
|
397
430
|
console.log("OpenAI model already exists: o4 mini");
|
|
398
431
|
}
|
|
399
432
|
const openAiGpt41 = await PsAiModel.findOne({
|
|
@@ -407,7 +440,7 @@ export class NewAiModelSetup {
|
|
|
407
440
|
costInTokensPerMillion: 2,
|
|
408
441
|
costOutTokensPerMillion: 8,
|
|
409
442
|
currency: "USD",
|
|
410
|
-
|
|
443
|
+
costInCachedContextTokensPerMillion: 0.5,
|
|
411
444
|
},
|
|
412
445
|
maxTokensOut: 100000,
|
|
413
446
|
defaultTemperature: 0.7,
|
|
@@ -424,6 +457,9 @@ export class NewAiModelSetup {
|
|
|
424
457
|
console.log("Created OpenAI model: GPT-4.1");
|
|
425
458
|
}
|
|
426
459
|
else {
|
|
460
|
+
openAiGpt41.set("configuration", openAiGpt41Config);
|
|
461
|
+
openAiGpt41.changed("configuration", true);
|
|
462
|
+
await openAiGpt41.save();
|
|
427
463
|
console.log("OpenAI model already exists: GPT-4.1");
|
|
428
464
|
}
|
|
429
465
|
}
|
|
@@ -436,21 +472,22 @@ export class NewAiModelSetup {
|
|
|
436
472
|
const geminiPro = await PsAiModel.findOne({
|
|
437
473
|
where: { name: "Gemini 1.5 Pro 2" },
|
|
438
474
|
});
|
|
475
|
+
const geminiProConfig = {
|
|
476
|
+
type: PsAiModelType.Text,
|
|
477
|
+
modelSize: PsAiModelSize.Medium,
|
|
478
|
+
provider: "google",
|
|
479
|
+
prices: {
|
|
480
|
+
costInTokensPerMillion: 1.25,
|
|
481
|
+
costOutTokensPerMillion: 5.0,
|
|
482
|
+
costInCachedContextTokensPerMillion: 0.875,
|
|
483
|
+
currency: "USD",
|
|
484
|
+
},
|
|
485
|
+
maxTokensOut: 8192,
|
|
486
|
+
defaultTemperature: 0.0,
|
|
487
|
+
model: "gemini-1.5-pro-002",
|
|
488
|
+
active: true,
|
|
489
|
+
};
|
|
439
490
|
if (!geminiPro) {
|
|
440
|
-
const geminiProConfig = {
|
|
441
|
-
type: PsAiModelType.Text,
|
|
442
|
-
modelSize: PsAiModelSize.Medium,
|
|
443
|
-
provider: "google",
|
|
444
|
-
prices: {
|
|
445
|
-
costInTokensPerMillion: 1.25,
|
|
446
|
-
costOutTokensPerMillion: 5.0,
|
|
447
|
-
currency: "USD",
|
|
448
|
-
},
|
|
449
|
-
maxTokensOut: 8192,
|
|
450
|
-
defaultTemperature: 0.0,
|
|
451
|
-
model: "gemini-1.5-pro-002",
|
|
452
|
-
active: true,
|
|
453
|
-
};
|
|
454
491
|
await PsAiModel.create({
|
|
455
492
|
name: "Gemini 1.5 Pro 2",
|
|
456
493
|
organization_id: 1,
|
|
@@ -460,27 +497,31 @@ export class NewAiModelSetup {
|
|
|
460
497
|
console.log("Created Google model: Gemini 1.5 Pro 2");
|
|
461
498
|
}
|
|
462
499
|
else {
|
|
500
|
+
geminiPro.set("configuration", geminiProConfig);
|
|
501
|
+
geminiPro.changed("configuration", true);
|
|
502
|
+
await geminiPro.save();
|
|
463
503
|
console.log("Google model already exists: Gemini 1.5 Pro 2");
|
|
464
504
|
}
|
|
465
505
|
// Gemini 1.5 Flash 2
|
|
466
506
|
const geminiPro15Flash = await PsAiModel.findOne({
|
|
467
507
|
where: { name: "Gemini 1.5 Flash 2" },
|
|
468
508
|
});
|
|
509
|
+
const geminiPro15FlashConfig = {
|
|
510
|
+
type: PsAiModelType.Text,
|
|
511
|
+
modelSize: PsAiModelSize.Small,
|
|
512
|
+
provider: "google",
|
|
513
|
+
prices: {
|
|
514
|
+
costInTokensPerMillion: 0.075,
|
|
515
|
+
costOutTokensPerMillion: 0.3,
|
|
516
|
+
costInCachedContextTokensPerMillion: 0.525,
|
|
517
|
+
currency: "USD",
|
|
518
|
+
},
|
|
519
|
+
maxTokensOut: 8192,
|
|
520
|
+
defaultTemperature: 0.0,
|
|
521
|
+
model: "gemini-1.5-flash-002",
|
|
522
|
+
active: true,
|
|
523
|
+
};
|
|
469
524
|
if (!geminiPro15Flash) {
|
|
470
|
-
const geminiPro15FlashConfig = {
|
|
471
|
-
type: PsAiModelType.Text,
|
|
472
|
-
modelSize: PsAiModelSize.Small,
|
|
473
|
-
provider: "google",
|
|
474
|
-
prices: {
|
|
475
|
-
costInTokensPerMillion: 0.075,
|
|
476
|
-
costOutTokensPerMillion: 0.3,
|
|
477
|
-
currency: "USD",
|
|
478
|
-
},
|
|
479
|
-
maxTokensOut: 8192,
|
|
480
|
-
defaultTemperature: 0.0,
|
|
481
|
-
model: "gemini-1.5-flash-002",
|
|
482
|
-
active: true,
|
|
483
|
-
};
|
|
484
525
|
await PsAiModel.create({
|
|
485
526
|
name: "Gemini 1.5 Flash 2",
|
|
486
527
|
organization_id: 1,
|
|
@@ -490,27 +531,31 @@ export class NewAiModelSetup {
|
|
|
490
531
|
console.log("Created Google model: Gemini 1.5 Flash 2");
|
|
491
532
|
}
|
|
492
533
|
else {
|
|
534
|
+
geminiPro15Flash.set("configuration", geminiPro15FlashConfig);
|
|
535
|
+
geminiPro15Flash.changed("configuration", true);
|
|
536
|
+
await geminiPro15Flash.save();
|
|
493
537
|
console.log("Google model already exists: Gemini 1.5 Flash 2");
|
|
494
538
|
}
|
|
495
539
|
// Gemini 2.0 Flash
|
|
496
540
|
const gemini20Flash = await PsAiModel.findOne({
|
|
497
541
|
where: { name: "Gemini 2.0 Flash" },
|
|
498
542
|
});
|
|
543
|
+
const gemini20FlashConfig = {
|
|
544
|
+
type: PsAiModelType.Text,
|
|
545
|
+
modelSize: PsAiModelSize.Medium,
|
|
546
|
+
provider: "google",
|
|
547
|
+
prices: {
|
|
548
|
+
costInTokensPerMillion: 0.1,
|
|
549
|
+
costOutTokensPerMillion: 0.4,
|
|
550
|
+
costInCachedContextTokensPerMillion: 0.07,
|
|
551
|
+
currency: "USD",
|
|
552
|
+
},
|
|
553
|
+
maxTokensOut: 8192,
|
|
554
|
+
defaultTemperature: 0.0,
|
|
555
|
+
model: "gemini-2.0-flash",
|
|
556
|
+
active: true,
|
|
557
|
+
};
|
|
499
558
|
if (!gemini20Flash) {
|
|
500
|
-
const gemini20FlashConfig = {
|
|
501
|
-
type: PsAiModelType.Text,
|
|
502
|
-
modelSize: PsAiModelSize.Medium,
|
|
503
|
-
provider: "google",
|
|
504
|
-
prices: {
|
|
505
|
-
costInTokensPerMillion: 0.1,
|
|
506
|
-
costOutTokensPerMillion: 0.4,
|
|
507
|
-
currency: "USD",
|
|
508
|
-
},
|
|
509
|
-
maxTokensOut: 8192,
|
|
510
|
-
defaultTemperature: 0.0,
|
|
511
|
-
model: "gemini-2.0-flash",
|
|
512
|
-
active: true,
|
|
513
|
-
};
|
|
514
559
|
await PsAiModel.create({
|
|
515
560
|
name: "Gemini 2.0 Flash",
|
|
516
561
|
organization_id: 1,
|
|
@@ -520,8 +565,85 @@ export class NewAiModelSetup {
|
|
|
520
565
|
console.log("Created Google model: Gemini 2.0 Flash");
|
|
521
566
|
}
|
|
522
567
|
else {
|
|
568
|
+
gemini20Flash.set("configuration", gemini20FlashConfig);
|
|
569
|
+
gemini20Flash.changed("configuration", true);
|
|
570
|
+
await gemini20Flash.save();
|
|
523
571
|
console.log("Google model already exists: Gemini 2.0 Flash");
|
|
524
572
|
}
|
|
573
|
+
const gemini25ProPreview1 = await PsAiModel.findOne({
|
|
574
|
+
where: { name: "Gemini 2.5 Pro Preview 1" },
|
|
575
|
+
});
|
|
576
|
+
const gemini25ProPreview1Config = {
|
|
577
|
+
type: PsAiModelType.TextReasoning,
|
|
578
|
+
modelSize: PsAiModelSize.Medium,
|
|
579
|
+
provider: "google",
|
|
580
|
+
prices: {
|
|
581
|
+
costInTokensPerMillion: 1.25,
|
|
582
|
+
costOutTokensPerMillion: 10,
|
|
583
|
+
costInCachedContextTokensPerMillion: 0.875,
|
|
584
|
+
longContextTokenThreshold: 200000,
|
|
585
|
+
longContextCostInTokensPerMillion: 2.5,
|
|
586
|
+
longContextCostInCachedContextTokensPerMillion: 1.75,
|
|
587
|
+
longContextCostOutTokensPerMillion: 15,
|
|
588
|
+
currency: "USD",
|
|
589
|
+
},
|
|
590
|
+
model: "gemini-2.5-pro-preview-04-17",
|
|
591
|
+
active: true,
|
|
592
|
+
maxTokensOut: 100000,
|
|
593
|
+
defaultTemperature: 0.0
|
|
594
|
+
};
|
|
595
|
+
if (!gemini25ProPreview1) {
|
|
596
|
+
await PsAiModel.create({
|
|
597
|
+
name: "Gemini 2.5 Pro Preview 1",
|
|
598
|
+
organization_id: 1,
|
|
599
|
+
user_id: userId,
|
|
600
|
+
configuration: gemini25ProPreview1Config,
|
|
601
|
+
});
|
|
602
|
+
console.log("Created Google model: Gemini 2.5 Pro Preview 1");
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
gemini25ProPreview1.set("configuration", gemini25ProPreview1Config);
|
|
606
|
+
gemini25ProPreview1.changed("configuration", true);
|
|
607
|
+
await gemini25ProPreview1.save();
|
|
608
|
+
console.log("Google model already exists: Gemini 2.5 Pro Preview 1");
|
|
609
|
+
}
|
|
610
|
+
const gemini25ProPreview2 = await PsAiModel.findOne({
|
|
611
|
+
where: { name: "Gemini 2.5 Pro Preview 2" },
|
|
612
|
+
});
|
|
613
|
+
const gemini25ProConfig = {
|
|
614
|
+
type: PsAiModelType.TextReasoning,
|
|
615
|
+
modelSize: PsAiModelSize.Medium,
|
|
616
|
+
provider: "google",
|
|
617
|
+
prices: {
|
|
618
|
+
costInTokensPerMillion: 1.25,
|
|
619
|
+
costOutTokensPerMillion: 10,
|
|
620
|
+
costInCachedContextTokensPerMillion: 0.875,
|
|
621
|
+
longContextTokenThreshold: 200000,
|
|
622
|
+
longContextCostInTokensPerMillion: 2.5,
|
|
623
|
+
longContextCostInCachedContextTokensPerMillion: 1.75,
|
|
624
|
+
longContextCostOutTokensPerMillion: 15,
|
|
625
|
+
currency: "USD",
|
|
626
|
+
},
|
|
627
|
+
model: "gemini-2.5-pro-preview-05-06",
|
|
628
|
+
active: true,
|
|
629
|
+
maxTokensOut: 100000,
|
|
630
|
+
defaultTemperature: 0.0
|
|
631
|
+
};
|
|
632
|
+
if (!gemini25ProPreview2) {
|
|
633
|
+
await PsAiModel.create({
|
|
634
|
+
name: "Gemini 2.5 Pro Preview 2",
|
|
635
|
+
organization_id: 1,
|
|
636
|
+
user_id: userId,
|
|
637
|
+
configuration: gemini25ProConfig,
|
|
638
|
+
});
|
|
639
|
+
console.log("Created Google model: Gemini 2.5 Pro");
|
|
640
|
+
}
|
|
641
|
+
else {
|
|
642
|
+
gemini25ProPreview2.set("configuration", gemini25ProConfig);
|
|
643
|
+
gemini25ProPreview2.changed("configuration", true);
|
|
644
|
+
await gemini25ProPreview2.save();
|
|
645
|
+
console.log("Google model already exists: Gemini 2.5 Pro");
|
|
646
|
+
}
|
|
525
647
|
}
|
|
526
648
|
/**
|
|
527
649
|
* Master seeding function which calls the provider-specific functions
|
|
@@ -629,6 +751,8 @@ export class NewAiModelSetup {
|
|
|
629
751
|
{ name: "Gemini 1.5 Pro 2", envKey: "GEMINI_API_KEY" },
|
|
630
752
|
{ name: "Gemini 1.5 Flash 2", envKey: "GEMINI_API_KEY" },
|
|
631
753
|
{ name: "Gemini 2.0 Flash", envKey: "GEMINI_API_KEY" },
|
|
754
|
+
{ name: "Gemini 2.5 Pro Preview 1", envKey: "GEMINI_API_KEY" },
|
|
755
|
+
{ name: "Gemini 2.5 Pro Preview 2", envKey: "GEMINI_API_KEY" },
|
|
632
756
|
{ name: "o1 24", envKey: "OPENAI_API_KEY" },
|
|
633
757
|
{ name: "o3 mini", envKey: "OPENAI_API_KEY" },
|
|
634
758
|
{ name: "o4 mini", envKey: "OPENAI_API_KEY" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrpri/api",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.114",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Bjarnason & Citizens Foundation",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@google-cloud/vertexai": "^1.10.0",
|
|
26
26
|
"@google-cloud/vision": "^5.1.0",
|
|
27
27
|
"@node-saml/passport-saml": "^5.0.1",
|
|
28
|
-
"@policysynth/agents": "^1.3.
|
|
28
|
+
"@policysynth/agents": "^1.3.94",
|
|
29
29
|
"async": "^3.2.6",
|
|
30
30
|
"authorized": "^1.0.0",
|
|
31
31
|
"aws-sdk": "^2.1692.0",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export function replaceBetterReykjavikCategoryId(id: any): 1 | 2 | 5 | 4 | 7 | 3 | 6 | 10 |
|
|
1
|
+
export function replaceBetterReykjavikCategoryId(id: any): 1 | 2 | 5 | 4 | 7 | 3 | 6 | 10 | 8 | 9 | 12 | 11 | 13 | undefined;
|
|
2
2
|
export function clean(string: any): any;
|
|
3
3
|
export function shuffleArray(array: any): any;
|
package/src/models/index.d.ts
CHANGED
|
@@ -33,6 +33,14 @@ declare module "models/index.cjs" { // Module path relative to baseUrl ("server_
|
|
|
33
33
|
type RatingInstance = ModelInstance<YpRatingData>;
|
|
34
34
|
type UserInstance = ModelInstance<YpUserData>;
|
|
35
35
|
type VideoInstance = ModelInstance<YpVideoData>;
|
|
36
|
+
type AcActivityInstance = ModelInstance<AcActivityData>;
|
|
37
|
+
type AcBackgroundJobInstance = ModelInstance<AcBackgroundJobData>;
|
|
38
|
+
type AcClientActivityInstance = ModelInstance<AcClientActivityData>;
|
|
39
|
+
type AcDelayedNotificationInstance = ModelInstance<AcDelayedNotificationData>;
|
|
40
|
+
type AcFollowingInstance = ModelInstance<AcFollowingData>;
|
|
41
|
+
type AcMuteInstance = ModelInstance<AcMuteData>;
|
|
42
|
+
type AcNotificationInstance = ModelInstance<AcNotificationData>;
|
|
43
|
+
type AcTranslationCacheInstance = ModelInstance<AcTranslationCacheData>;
|
|
36
44
|
// Add other specific instance types if new models are included
|
|
37
45
|
|
|
38
46
|
// --- Interface for the Exported DB Object (local to this module declaration) ---
|
|
@@ -58,6 +66,16 @@ declare module "models/index.cjs" { // Module path relative to baseUrl ("server_
|
|
|
58
66
|
Rating: ModelStatic<RatingInstance>;
|
|
59
67
|
User: ModelStatic<UserInstance>;
|
|
60
68
|
Video: ModelStatic<VideoInstance>;
|
|
69
|
+
AcActivity: ModelStatic<AcActivityInstance>;
|
|
70
|
+
AcBackgroundJob: ModelStatic<AcBackgroundJobInstance>;
|
|
71
|
+
AcCampaign: ModelStatic<AcCampaignInstance>;
|
|
72
|
+
AcClientActivity: ModelStatic<AcClientActivityInstance>;
|
|
73
|
+
AcDelayedNotification: ModelStatic<AcDelayedNotificationInstance>;
|
|
74
|
+
AcFollowing: ModelStatic<AcFollowingInstance>;
|
|
75
|
+
AcMute: ModelStatic<AcMuteInstance>;
|
|
76
|
+
AcNotification: ModelStatic<AcNotificationInstance>;
|
|
77
|
+
AcTranslationCache: ModelStatic<AcTranslationCacheInstance>;
|
|
78
|
+
|
|
61
79
|
// Add other ModelStatic types as new models are included
|
|
62
80
|
}
|
|
63
81
|
|