@yrpri/api 9.0.88 → 9.0.90
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/active-citizen/engine/notifications/emails_utils.cjs +3 -0
- package/active-citizen/llms/baseChatBot.js +19 -13
- package/active-citizen/workers/queue.cjs +1 -1
- package/agents/assistants/baseAssistant.js +12 -7
- package/agents/assistants/modes/tools/models/subscriptions.js +5 -1
- package/agents/assistants/modes/tools/navigationTools.js +27 -10
- package/agents/assistants/voiceAssistant.js +1 -1
- package/agents/controllers/policySynthAgents.js +23 -376
- package/agents/managers/newAiModelSetup.js +488 -0
- package/agents/models/testData/old/updateAgentWorkflowConfiguration.js +230 -0
- package/agents/models/testData/updateAgentWorkflowConfiguration.js +38 -38
- package/controllers/nonSpa.cjs +1 -1
- package/package.json +1 -1
- package/scripts/cleanups/deleteAnonNotifications.cjs +91 -0
- package/scripts/cleanups/deleteYearOldNotifications.cjs +72 -0
- package/utils/sitemap_generator.cjs +12 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
import express from "express";
|
|
3
2
|
import { AgentQueueManager } from "@policysynth/agents/operations/agentQueueManager.js";
|
|
4
3
|
import { AgentCostManager } from "@policysynth/agents/operations/agentCostsManager.js";
|
|
@@ -8,53 +7,14 @@ import { AgentRegistryManager } from "@policysynth/agents/operations/agentRegist
|
|
|
8
7
|
import { PsAiModel } from "@policysynth/agents/dbModels/aiModel.js";
|
|
9
8
|
import auth from "../../authorization.cjs";
|
|
10
9
|
import models from "../../models/index.cjs";
|
|
11
|
-
import {
|
|
12
|
-
import { PsAgentClass } from "@policysynth/agents/dbModels/agentClass.js";
|
|
13
|
-
import { PsAgent } from "@policysynth/agents/dbModels/agent.js";
|
|
14
|
-
import { PsAgentAuditLog } from "@policysynth/agents/dbModels/agentAuditLog.js";
|
|
15
|
-
import { PsAgentConnector } from "@policysynth/agents/dbModels/agentConnector.js";
|
|
16
|
-
import { PsAgentConnectorClass } from "@policysynth/agents/dbModels/agentConnectorClass.js";
|
|
17
|
-
import { PsAgentRegistry } from "@policysynth/agents/dbModels/agentRegistry.js";
|
|
18
|
-
import { PsExternalApiUsage } from "@policysynth/agents/dbModels/externalApiUsage.js";
|
|
19
|
-
import { PsExternalApi } from "@policysynth/agents/dbModels/externalApis.js";
|
|
20
|
-
import { PsModelUsage } from "@policysynth/agents/dbModels/modelUsage.js";
|
|
21
|
-
import { sequelize as psSequelize } from "@policysynth/agents/dbModels/index.js";
|
|
22
|
-
import { PsAgentClassCategories } from "@policysynth/agents/agentCategories.js";
|
|
10
|
+
import { NewAiModelSetup } from "../managers/newAiModelSetup.js";
|
|
23
11
|
const dbModels = models;
|
|
24
12
|
const Group = dbModels.Group;
|
|
25
13
|
const User = dbModels.User;
|
|
26
|
-
const psModels = {
|
|
27
|
-
PsAgentClass,
|
|
28
|
-
PsExternalApiUsage,
|
|
29
|
-
PsModelUsage,
|
|
30
|
-
PsAgentConnector,
|
|
31
|
-
PsAgent,
|
|
32
|
-
PsAgentAuditLog,
|
|
33
|
-
PsAgentConnectorClass,
|
|
34
|
-
PsAgentRegistry,
|
|
35
|
-
PsAiModel,
|
|
36
|
-
PsExternalApi,
|
|
37
|
-
};
|
|
38
14
|
export class PolicySynthAgentsController {
|
|
39
15
|
constructor(wsClients) {
|
|
40
16
|
this.path = "/api/agents";
|
|
41
17
|
this.router = express.Router();
|
|
42
|
-
this.initializeModels = async () => {
|
|
43
|
-
try {
|
|
44
|
-
console.log(`All Models Loaded Init`);
|
|
45
|
-
// Call associate method to set up associations
|
|
46
|
-
for (const modelName of Object.keys(psModels)) {
|
|
47
|
-
if (psModels[modelName].associate) {
|
|
48
|
-
await psModels[modelName].associate(psSequelize.models);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
console.log("All models initialized successfully.");
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
console.error("Error initializing models:", error);
|
|
55
|
-
process.exit(1);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
18
|
this.replaceAgentMemory = async (req, res) => {
|
|
59
19
|
try {
|
|
60
20
|
const { groupId, agentId } = req.params;
|
|
@@ -69,12 +29,16 @@ export class PolicySynthAgentsController {
|
|
|
69
29
|
}
|
|
70
30
|
catch (jsonError) {
|
|
71
31
|
console.log(`Received invalid JSON for agent ${agentId}`);
|
|
72
|
-
return res
|
|
32
|
+
return res
|
|
33
|
+
.status(400)
|
|
34
|
+
.json({ error: "Invalid JSON format for memory" });
|
|
73
35
|
}
|
|
74
36
|
const memoryKey = await this.agentManager.getSubAgentMemoryKey(groupId, parseInt(agentId));
|
|
75
37
|
if (!memoryKey) {
|
|
76
38
|
console.log(`Memory key not found for agent ${agentId}`);
|
|
77
|
-
return res
|
|
39
|
+
return res
|
|
40
|
+
.status(404)
|
|
41
|
+
.json({ error: "Memory key not found for the specified agent" });
|
|
78
42
|
}
|
|
79
43
|
console.log(`Memory key found: ${memoryKey}`);
|
|
80
44
|
await req.redisClient.set(memoryKey, JSON.stringify(memory));
|
|
@@ -101,7 +65,9 @@ export class PolicySynthAgentsController {
|
|
|
101
65
|
}
|
|
102
66
|
try {
|
|
103
67
|
await this.agentConnectorManager.addExistingConnector(parseInt(groupId), parseInt(agentId), parseInt(connectorId), type);
|
|
104
|
-
res.status(200).json({
|
|
68
|
+
res.status(200).json({
|
|
69
|
+
message: `Existing ${connectorId} connector added successfully`,
|
|
70
|
+
});
|
|
105
71
|
}
|
|
106
72
|
catch (error) {
|
|
107
73
|
console.error(`Error adding existing ${connectorId} connector:`, error);
|
|
@@ -117,21 +83,20 @@ export class PolicySynthAgentsController {
|
|
|
117
83
|
try {
|
|
118
84
|
const { groupId, agentId } = req.params;
|
|
119
85
|
console.log(`Attempting to get memory for agent ${agentId} in group ${groupId}`);
|
|
120
|
-
// Get the memory key for the specified agent
|
|
121
86
|
const memoryKey = await this.agentManager.getSubAgentMemoryKey(groupId, parseInt(agentId));
|
|
122
87
|
if (!memoryKey) {
|
|
123
88
|
console.log(`Memory key not found for agent ${agentId}`);
|
|
124
|
-
return res
|
|
89
|
+
return res
|
|
90
|
+
.status(404)
|
|
91
|
+
.json({ error: "Memory key not found for the specified agent" });
|
|
125
92
|
}
|
|
126
93
|
console.log(`Memory key found: ${memoryKey}`);
|
|
127
|
-
// Use the Redis client to get the memory contents
|
|
128
94
|
const memoryContents = await req.redisClient.get(memoryKey);
|
|
129
95
|
if (!memoryContents) {
|
|
130
96
|
console.log(`Memory contents not found for key ${memoryKey}`);
|
|
131
97
|
return res.status(404).json({ error: "Memory contents not found" });
|
|
132
98
|
}
|
|
133
99
|
console.log(`Memory contents retrieved successfully`);
|
|
134
|
-
// Parse the memory contents (assuming it's stored as JSON)
|
|
135
100
|
const parsedMemoryContents = JSON.parse(memoryContents);
|
|
136
101
|
res.json(parsedMemoryContents);
|
|
137
102
|
}
|
|
@@ -394,261 +359,17 @@ export class PolicySynthAgentsController {
|
|
|
394
359
|
this.agentConnectorManager = new AgentConnectorManager();
|
|
395
360
|
this.agentRegistryManager = new AgentRegistryManager();
|
|
396
361
|
this.initializeRoutes();
|
|
397
|
-
|
|
398
|
-
|
|
362
|
+
// Call our separated model setup methods.
|
|
363
|
+
NewAiModelSetup.initializeModels();
|
|
364
|
+
// Using a hardcoded userId (1) for seeding test AI models.
|
|
365
|
+
NewAiModelSetup.setupAiModels(1);
|
|
399
366
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
async seedTestAiModels(userId) {
|
|
407
|
-
const testModel = await PsAiModel.findOne({
|
|
408
|
-
where: {
|
|
409
|
-
name: "Anthropic Sonnet 3.5",
|
|
410
|
-
},
|
|
411
|
-
});
|
|
412
|
-
if (!testModel) {
|
|
413
|
-
const anthropicSonnetConfig = {
|
|
414
|
-
type: PsAiModelType.Text,
|
|
415
|
-
modelSize: PsAiModelSize.Medium,
|
|
416
|
-
provider: "anthropic",
|
|
417
|
-
prices: {
|
|
418
|
-
costInTokensPerMillion: 3,
|
|
419
|
-
costOutTokensPerMillion: 15,
|
|
420
|
-
currency: "USD",
|
|
421
|
-
},
|
|
422
|
-
maxTokensOut: 8000,
|
|
423
|
-
defaultTemperature: 0.7,
|
|
424
|
-
model: "claude-3-5-sonnet-20240620",
|
|
425
|
-
active: true,
|
|
426
|
-
};
|
|
427
|
-
const anthropicSonnet = await PsAiModel.create({
|
|
428
|
-
name: "Anthropic Sonnet 3.5",
|
|
429
|
-
organization_id: 1,
|
|
430
|
-
user_id: userId,
|
|
431
|
-
configuration: anthropicSonnetConfig,
|
|
432
|
-
});
|
|
433
|
-
console.log("Created test AI model:", anthropicSonnet);
|
|
434
|
-
const openAiGpt4oConfig = {
|
|
435
|
-
type: PsAiModelType.Text,
|
|
436
|
-
modelSize: PsAiModelSize.Medium,
|
|
437
|
-
provider: "openai",
|
|
438
|
-
prices: {
|
|
439
|
-
costInTokensPerMillion: 5,
|
|
440
|
-
costOutTokensPerMillion: 15,
|
|
441
|
-
currency: "USD",
|
|
442
|
-
},
|
|
443
|
-
maxTokensOut: 4096,
|
|
444
|
-
defaultTemperature: 0.7,
|
|
445
|
-
model: "gpt-4o",
|
|
446
|
-
active: true,
|
|
447
|
-
};
|
|
448
|
-
const openAiGpt4oMiniConfig = {
|
|
449
|
-
type: PsAiModelType.Text,
|
|
450
|
-
modelSize: PsAiModelSize.Small,
|
|
451
|
-
provider: "openai",
|
|
452
|
-
prices: {
|
|
453
|
-
costInTokensPerMillion: 0.15,
|
|
454
|
-
costOutTokensPerMillion: 0.6,
|
|
455
|
-
currency: "USD",
|
|
456
|
-
},
|
|
457
|
-
maxTokensOut: 16000,
|
|
458
|
-
defaultTemperature: 0.0,
|
|
459
|
-
model: "gpt-4o-mini",
|
|
460
|
-
active: true,
|
|
461
|
-
};
|
|
462
|
-
const openAiGpt4 = await PsAiModel.create({
|
|
463
|
-
name: "GPT-4o",
|
|
464
|
-
organization_id: 1,
|
|
465
|
-
user_id: userId,
|
|
466
|
-
configuration: openAiGpt4oConfig,
|
|
467
|
-
});
|
|
468
|
-
console.log("Created test AI model:", openAiGpt4);
|
|
469
|
-
const openAiGpt4Mini = await PsAiModel.create({
|
|
470
|
-
name: "GPT-4o Mini",
|
|
471
|
-
organization_id: 1,
|
|
472
|
-
user_id: userId,
|
|
473
|
-
configuration: openAiGpt4oMiniConfig,
|
|
474
|
-
});
|
|
475
|
-
console.log("Created test AI model:", openAiGpt4Mini);
|
|
476
|
-
const topLevelAgentClassConfig = {
|
|
477
|
-
category: PsAgentClassCategories.PolicySynthTopLevel,
|
|
478
|
-
subCategory: "group",
|
|
479
|
-
hasPublicAccess: true,
|
|
480
|
-
description: "A top-level agent that coordinates other agents",
|
|
481
|
-
queueName: "noqueue",
|
|
482
|
-
imageUrl: "https://yrpri-eu-direct-assets.s3.eu-west-1.amazonaws.com/topLevelAgent.png",
|
|
483
|
-
iconName: "coordinator",
|
|
484
|
-
capabilities: [
|
|
485
|
-
"process coordination",
|
|
486
|
-
"task management",
|
|
487
|
-
"result aggregation",
|
|
488
|
-
],
|
|
489
|
-
questions: [],
|
|
490
|
-
requestedAiModelSizes: ["large", "medium", "small"],
|
|
491
|
-
supportedConnectors: [],
|
|
492
|
-
};
|
|
493
|
-
await PsAgentClass.create({
|
|
494
|
-
class_base_id: "c375c1fb-58ca-4372-a567-0e02b2c3d479",
|
|
495
|
-
name: "Operations",
|
|
496
|
-
version: 1,
|
|
497
|
-
available: true,
|
|
498
|
-
configuration: topLevelAgentClassConfig,
|
|
499
|
-
user_id: userId,
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
else {
|
|
503
|
-
console.log("Test AI models already exist");
|
|
504
|
-
}
|
|
505
|
-
const testOMiniModel = await PsAiModel.findOne({
|
|
506
|
-
where: {
|
|
507
|
-
name: "o1 Mini",
|
|
508
|
-
},
|
|
509
|
-
});
|
|
510
|
-
if (!testOMiniModel) {
|
|
511
|
-
const openAio1MiniConfig = {
|
|
512
|
-
type: PsAiModelType.TextReasoning,
|
|
513
|
-
modelSize: PsAiModelSize.Small,
|
|
514
|
-
provider: "openai",
|
|
515
|
-
prices: {
|
|
516
|
-
costInTokensPerMillion: 3.0,
|
|
517
|
-
costOutTokensPerMillion: 12.0,
|
|
518
|
-
currency: "USD",
|
|
519
|
-
},
|
|
520
|
-
maxTokensOut: 32000,
|
|
521
|
-
defaultTemperature: 0.0,
|
|
522
|
-
model: "o1-mini",
|
|
523
|
-
active: true,
|
|
524
|
-
};
|
|
525
|
-
const openAio1Mini = await PsAiModel.create({
|
|
526
|
-
name: "o1 Mini",
|
|
527
|
-
organization_id: 1,
|
|
528
|
-
user_id: userId,
|
|
529
|
-
configuration: openAio1MiniConfig,
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
else {
|
|
533
|
-
console.log("Test O models already exist");
|
|
534
|
-
}
|
|
535
|
-
const testOPreviewModel = await PsAiModel.findOne({
|
|
536
|
-
where: {
|
|
537
|
-
name: "o1 Preview",
|
|
538
|
-
},
|
|
539
|
-
});
|
|
540
|
-
if (!testOPreviewModel) {
|
|
541
|
-
const openAio1PreviewConfig = {
|
|
542
|
-
type: PsAiModelType.TextReasoning,
|
|
543
|
-
modelSize: PsAiModelSize.Medium,
|
|
544
|
-
provider: "openai",
|
|
545
|
-
prices: {
|
|
546
|
-
costInTokensPerMillion: 15.0,
|
|
547
|
-
costOutTokensPerMillion: 60.0,
|
|
548
|
-
currency: "USD",
|
|
549
|
-
},
|
|
550
|
-
maxTokensOut: 32000,
|
|
551
|
-
defaultTemperature: 0.0,
|
|
552
|
-
model: "o1-preview",
|
|
553
|
-
active: true,
|
|
554
|
-
};
|
|
555
|
-
const openAio1Preview = await PsAiModel.create({
|
|
556
|
-
name: "o1 Preview",
|
|
557
|
-
organization_id: 1,
|
|
558
|
-
user_id: userId,
|
|
559
|
-
configuration: openAio1PreviewConfig,
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
else {
|
|
563
|
-
console.log("Test O preview models already exist");
|
|
564
|
-
}
|
|
565
|
-
const testO1712Model = await PsAiModel.findOne({
|
|
566
|
-
where: {
|
|
567
|
-
name: "o1 24",
|
|
568
|
-
},
|
|
569
|
-
});
|
|
570
|
-
if (!testO1712Model) {
|
|
571
|
-
const openAio11712Config = {
|
|
572
|
-
type: PsAiModelType.TextReasoning,
|
|
573
|
-
modelSize: PsAiModelSize.Medium,
|
|
574
|
-
provider: "openai",
|
|
575
|
-
prices: {
|
|
576
|
-
costInTokensPerMillion: 15.0,
|
|
577
|
-
costOutTokensPerMillion: 60.0,
|
|
578
|
-
currency: "USD",
|
|
579
|
-
},
|
|
580
|
-
maxTokensOut: 100000,
|
|
581
|
-
defaultTemperature: 0.0,
|
|
582
|
-
model: "o1-2024-12-17",
|
|
583
|
-
active: true,
|
|
584
|
-
};
|
|
585
|
-
const openAio11712 = await PsAiModel.create({
|
|
586
|
-
name: "o1 24",
|
|
587
|
-
organization_id: 1,
|
|
588
|
-
user_id: userId,
|
|
589
|
-
configuration: openAio11712Config,
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
else {
|
|
593
|
-
console.log("Test o1 1712 models already exist");
|
|
594
|
-
}
|
|
595
|
-
const geminiProModel = await PsAiModel.findOne({
|
|
596
|
-
where: {
|
|
597
|
-
name: "Gemini 1.5 Pro 2",
|
|
598
|
-
},
|
|
599
|
-
});
|
|
600
|
-
if (!geminiProModel) {
|
|
601
|
-
const geminiProConfig = {
|
|
602
|
-
type: PsAiModelType.Text,
|
|
603
|
-
modelSize: PsAiModelSize.Medium,
|
|
604
|
-
provider: "google",
|
|
605
|
-
prices: {
|
|
606
|
-
costInTokensPerMillion: 1.25,
|
|
607
|
-
costOutTokensPerMillion: 5.0,
|
|
608
|
-
currency: "USD",
|
|
609
|
-
},
|
|
610
|
-
maxTokensOut: 8192,
|
|
611
|
-
defaultTemperature: 0.0,
|
|
612
|
-
model: "gemini-1.5-pro-002",
|
|
613
|
-
active: true,
|
|
614
|
-
};
|
|
615
|
-
const geminiPro = await PsAiModel.create({
|
|
616
|
-
name: "Gemini 1.5 Pro 2",
|
|
617
|
-
organization_id: 1,
|
|
618
|
-
user_id: userId,
|
|
619
|
-
configuration: geminiProConfig,
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
else {
|
|
623
|
-
console.log("Gemini 1.5 Pro 2 models already exist");
|
|
624
|
-
}
|
|
625
|
-
const geminiPro15FlashModel = await PsAiModel.findOne({
|
|
626
|
-
where: {
|
|
627
|
-
name: "Gemini 1.5 Flash 2",
|
|
628
|
-
},
|
|
629
|
-
});
|
|
630
|
-
if (!geminiPro15FlashModel) {
|
|
631
|
-
const geminiPro15FlashConfig = {
|
|
632
|
-
type: PsAiModelType.Text,
|
|
633
|
-
modelSize: PsAiModelSize.Small,
|
|
634
|
-
provider: "google",
|
|
635
|
-
prices: {
|
|
636
|
-
costInTokensPerMillion: 0.075,
|
|
637
|
-
costOutTokensPerMillion: 0.3,
|
|
638
|
-
currency: "USD",
|
|
639
|
-
},
|
|
640
|
-
maxTokensOut: 8192,
|
|
641
|
-
defaultTemperature: 0.0,
|
|
642
|
-
model: "gemini-1.5-flash-002",
|
|
643
|
-
active: true,
|
|
644
|
-
};
|
|
645
|
-
const geminiPro15Flash = await PsAiModel.create({
|
|
646
|
-
name: "Gemini 1.5 Flash 2",
|
|
647
|
-
organization_id: 1,
|
|
648
|
-
user_id: userId,
|
|
649
|
-
configuration: geminiPro15FlashConfig,
|
|
650
|
-
});
|
|
651
|
-
}
|
|
367
|
+
/**
|
|
368
|
+
* A proxy for setting up API keys for a group.
|
|
369
|
+
* @param group The group instance to configure
|
|
370
|
+
*/
|
|
371
|
+
static async setupApiKeysForGroup(group) {
|
|
372
|
+
return NewAiModelSetup.setupApiKeysForGroup(group);
|
|
652
373
|
}
|
|
653
374
|
initializeRoutes() {
|
|
654
375
|
this.router.get("/:groupId", auth.can("view group"), this.getAgent);
|
|
@@ -672,77 +393,3 @@ export class PolicySynthAgentsController {
|
|
|
672
393
|
this.router.post("/:groupId/:agentId/:type(input|output)Connectors/existing", auth.can("edit group"), this.addExistingConnector);
|
|
673
394
|
}
|
|
674
395
|
}
|
|
675
|
-
_a = PolicySynthAgentsController;
|
|
676
|
-
PolicySynthAgentsController.setupApiKeysForGroup = async (group) => {
|
|
677
|
-
const findLatestActiveModel = async (name) => {
|
|
678
|
-
return await PsAiModel.findOne({
|
|
679
|
-
where: {
|
|
680
|
-
name,
|
|
681
|
-
configuration: {
|
|
682
|
-
active: true
|
|
683
|
-
}
|
|
684
|
-
},
|
|
685
|
-
order: [['created_at', 'DESC']],
|
|
686
|
-
});
|
|
687
|
-
};
|
|
688
|
-
const anthropicSonnet = await findLatestActiveModel("Anthropic Sonnet 3.5");
|
|
689
|
-
const openAiGpt4 = await findLatestActiveModel("GPT-4o");
|
|
690
|
-
const openAiGpt4Mini = await findLatestActiveModel("GPT-4o Mini");
|
|
691
|
-
const geminiPro = await findLatestActiveModel("Gemini 1.5 Pro 2");
|
|
692
|
-
const geminiPro15Flash = await findLatestActiveModel("Gemini 1.5 Flash 2");
|
|
693
|
-
const openAio1Preview = await findLatestActiveModel("o1 Preview");
|
|
694
|
-
const openAio1Mini = await findLatestActiveModel("o1 Mini");
|
|
695
|
-
const openAio11712 = await findLatestActiveModel("o1 24");
|
|
696
|
-
const groupAccessConfig = [];
|
|
697
|
-
if (anthropicSonnet && process.env.ANTHROPIC_CLAUDE_API_KEY) {
|
|
698
|
-
groupAccessConfig.push({
|
|
699
|
-
aiModelId: anthropicSonnet.id,
|
|
700
|
-
apiKey: process.env.ANTHROPIC_CLAUDE_API_KEY,
|
|
701
|
-
});
|
|
702
|
-
}
|
|
703
|
-
if (openAiGpt4 && process.env.OPENAI_API_KEY) {
|
|
704
|
-
groupAccessConfig.push({
|
|
705
|
-
aiModelId: openAiGpt4.id,
|
|
706
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
if (openAiGpt4Mini && process.env.OPENAI_API_KEY) {
|
|
710
|
-
groupAccessConfig.push({
|
|
711
|
-
aiModelId: openAiGpt4Mini.id,
|
|
712
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
if (openAio1Preview && process.env.OPENAI_API_KEY) {
|
|
716
|
-
groupAccessConfig.push({
|
|
717
|
-
aiModelId: openAio1Preview.id,
|
|
718
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
if (openAio1Mini && process.env.OPENAI_API_KEY) {
|
|
722
|
-
groupAccessConfig.push({
|
|
723
|
-
aiModelId: openAio1Mini.id,
|
|
724
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
if (geminiPro && process.env.GEMINI_API_KEY) {
|
|
728
|
-
groupAccessConfig.push({
|
|
729
|
-
aiModelId: geminiPro.id,
|
|
730
|
-
apiKey: process.env.GEMINI_API_KEY,
|
|
731
|
-
});
|
|
732
|
-
}
|
|
733
|
-
if (geminiPro15Flash && process.env.GEMINI_API_KEY) {
|
|
734
|
-
groupAccessConfig.push({
|
|
735
|
-
aiModelId: geminiPro15Flash.id,
|
|
736
|
-
apiKey: process.env.GEMINI_API_KEY,
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
|
-
if (openAio11712 && process.env.OPENAI_API_KEY) {
|
|
740
|
-
groupAccessConfig.push({
|
|
741
|
-
aiModelId: openAio11712.id,
|
|
742
|
-
apiKey: process.env.OPENAI_API_KEY,
|
|
743
|
-
});
|
|
744
|
-
}
|
|
745
|
-
group.set("private_access_configuration", groupAccessConfig);
|
|
746
|
-
group.changed("private_access_configuration", true);
|
|
747
|
-
await group.save();
|
|
748
|
-
};
|