@yrpri/api 9.0.139 → 9.0.140
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/agents/assistants/agentAssistant.js +4 -3
- package/agents/assistants/baseAssistant.js +72 -71
- package/agents/assistants/baseAssistantWithVoice.js +6 -5
- package/agents/assistants/modes/agentDirectConnection.js +8 -7
- package/agents/assistants/modes/agentSelectionMode.js +2 -1
- package/agents/assistants/modes/baseAssistantMode.js +3 -2
- package/agents/assistants/modes/tools/agentTools.js +11 -10
- package/agents/assistants/modes/tools/loginTools.js +7 -6
- package/agents/assistants/modes/tools/models/agents.js +6 -5
- package/agents/assistants/modes/tools/models/subscriptions.js +7 -6
- package/agents/assistants/modes/tools/navigationTools.js +7 -6
- package/agents/assistants/modes/tools/subscriptionTools.js +12 -11
- package/agents/assistants/modes/tools/workflowConverstationTools.js +7 -6
- package/agents/assistants/voiceAssistant.js +45 -44
- package/agents/controllers/agentProductController.js +8 -7
- package/agents/controllers/agentSubscriptionController.js +13 -12
- package/agents/controllers/assistantsController.js +45 -44
- package/agents/controllers/policySynthAgents.js +33 -32
- package/agents/managers/emailInvitesManager.js +4 -3
- package/agents/managers/newAiModelSetup.js +45 -44
- package/agents/managers/notificationAgentQueueManager.js +55 -54
- package/agents/managers/subscriptionManager.js +24 -23
- package/agents/models/agentProduct.js +2 -1
- package/agents/models/agentProductBoosterPurchase.js +2 -1
- package/agents/models/testData/createEvolyAgentProduct.js +7 -6
- package/agents/models/testData/old/updateAgentWorkflowConfiguration.js +5 -4
- package/agents/models/testData/updateAgentWorkflowConfiguration.js +5 -4
- package/agents/tools/setTemplateWorkflowCommunityId.js +6 -5
- package/app.d.ts +2 -1
- package/app.js +60 -34
- package/authorization.cjs +4 -4
- package/controllers/allOurIdeas.js +45 -44
- package/controllers/groups.cjs +4 -9
- package/controllers/images.cjs +8 -8
- package/controllers/index.cjs +1 -1
- package/controllers/points.cjs +1 -1
- package/controllers/posts.cjs +3 -3
- package/deleteUnwantedDeclerations.cjs +5 -5
- package/models/community.cjs +1 -1
- package/models/domain.cjs +7 -7
- package/models/image.cjs +2 -2
- package/models/index.cjs +8 -4
- package/models/post.cjs +10 -10
- package/models/user.cjs +1 -1
- package/models/video.cjs +4 -4
- package/package.json +5 -5
- package/scripts/addRatingUsersToGroup.js +1 -1
- package/scripts/addUserToOrganization.js +8 -8
- package/scripts/agents/changeModelForWorkflowGroupTemplate.js +13 -12
- package/scripts/agents/generateAgentWorkflowTemplateFromAgentClass.js +5 -4
- package/scripts/analyseRatingsForCommunity.js +2 -2
- package/scripts/analyzeAndFixBrokenPointUsers.js +3 -3
- package/scripts/analyzeEndorsementsByCountry.js +7 -7
- package/scripts/analyzePostsForCommunity.js +1 -1
- package/scripts/bulkStatusUpdates/listUpdates.js +2 -2
- package/scripts/bulkStatusUpdates/mergeLatestPostsToUpdate.js +5 -5
- package/scripts/bulkStatusUpdates/performUpdate.js +9 -9
- package/scripts/bulkStatusUpdates/performUpdateForGroup.cjs +11 -11
- package/scripts/bulkStatusUpdates/performUpdateForStatus.js +15 -15
- package/scripts/change/changeVideoAspectTo.js +3 -3
- package/scripts/change/setUseNewVersion.cjs +4 -4
- package/scripts/changeCommunityGroupcount.js +3 -3
- package/scripts/changeCommunityPostCount.js +3 -3
- package/scripts/changeGroupPostCount.js +3 -3
- package/scripts/changeLanguage.js +4 -4
- package/scripts/changeOfficalStatus.js +3 -3
- package/scripts/cleanups/deleteAnonNotifications.cjs +7 -7
- package/scripts/cleanups/deleteLinkGroupsWithDeletedCommunities.js +8 -8
- package/scripts/cleanups/deleteYearOldNotifications.cjs +5 -5
- package/scripts/cleanups/removeAllUsersFromHiddenPublicGroup.js +5 -5
- package/scripts/clearAllEndorsementInGroup.js +5 -5
- package/scripts/cloning/clearUsersForCommunitiesFromUrl.js +3 -3
- package/scripts/cloning/cloneFromUrlScript.js +4 -4
- package/scripts/cloning/cloneWBFromUrlScriptAndCreateLinks.js +6 -6
- package/scripts/cloning/cloneWBFromUrlScriptNoUsersOrPoints.js +6 -6
- package/scripts/cloning/cloneWBSerbianFromUrlScriptAndCreateLinks.js +6 -6
- package/scripts/cloning/copyCommunityConfigAndTranslationsFromURL.js +3 -3
- package/scripts/cloning/copyCommunityOneGroupToDomainNoUsersNoEndorsements.js +2 -2
- package/scripts/cloning/copyCommunityToDomainNoUsersNoEndorsements.js +2 -2
- package/scripts/cloning/copyCommunityToDomainWithEverything.js +2 -2
- package/scripts/cloning/copyCommunityToDomainWithOnlyGroups.js +3 -3
- package/scripts/cloning/copyGroupConfigAndTranslationsFromURL.js +3 -3
- package/scripts/cloning/copyPostToGroupOld.js +12 -12
- package/scripts/cloning/copyPostVideosFromURL.js +3 -3
- package/scripts/cloning/copyPostWithOutAnyVotingOrActivities.js +2 -2
- package/scripts/cloning/deepCloneSerbianWBFromUrlScriptAndCreateLinks.js +7 -7
- package/scripts/cloning/deepCloneWBFromUrlScriptAndCreateLinks.js +6 -6
- package/scripts/cloning/setAdminsFromURL.js +5 -5
- package/scripts/cloning/setExternalIdsFromURL.js +3 -3
- package/scripts/countCommunity.js +11 -11
- package/scripts/countCommunityUsers.js +4 -4
- package/scripts/countDelayedNotifications.js +3 -3
- package/scripts/countGroup.js +11 -11
- package/scripts/countStuff.js +3 -3
- package/scripts/countUniqueVotersInAGroup.js +3 -3
- package/scripts/createInvitesAndShow.js +2 -2
- package/scripts/database/sync_database.js +2 -2
- package/scripts/database/sync_dev_database.js +3 -3
- package/scripts/debugNotifications.js +5 -5
- package/scripts/deleteAllNewsFeeds.js +2 -2
- package/scripts/deleteCategory.js +1 -1
- package/scripts/deleteOldAppActivities.js +5 -4
- package/scripts/deletePostContactDataForCommunity.js +5 -4
- package/scripts/destroy/destroy_all_but_one_domain.js +59 -59
- package/scripts/displayAuthorForPost.js +1 -1
- package/scripts/domains/createDomain.js +5 -4
- package/scripts/domains/importDomainsFromXls.js +7 -6
- package/scripts/endorsementFraudDetection/analyseEndorsementsForCommunity.js +2 -2
- package/scripts/endorsementFraudDetection/bulkDeleteDuplicateEndorsmentsFromUrl.js +9 -9
- package/scripts/exportAllStatusChanges.js +5 -5
- package/scripts/exportEndorsementsForCommunity.js +5 -5
- package/scripts/exportPointQualitiesForCommunity.js +5 -5
- package/scripts/exportPostsAndPointsForCommunity.js +9 -9
- package/scripts/exportPostsDataSetForDomain.js +12 -12
- package/scripts/exportPostsForGroup.js +7 -7
- package/scripts/exportRatingsForPost.js +2 -2
- package/scripts/exportUserEndorsementsWithUserAnalysis.js +6 -6
- package/scripts/exportUsersForCommunity.js +3 -3
- package/scripts/exportUsersForDomain.js +3 -3
- package/scripts/exportUsersForGroup.js +3 -3
- package/scripts/exports/ratingDistribution.js +6 -6
- package/scripts/exports/whoEndorsedWhatByCommunity.js +2 -2
- package/scripts/findUnusedClientImports.js +2 -2
- package/scripts/fixAllPostPointCounts.js +1 -1
- package/scripts/fixAnonNotificationsSettings.js +5 -5
- package/scripts/fixCountKopavogur.js +1 -1
- package/scripts/fixEndorsementsAfterCopyPostToGroup.js +10 -10
- package/scripts/fixExternalUserId.js +2 -2
- package/scripts/fixGroupAccess.js +3 -3
- package/scripts/fixGroupIdeasAndPointsCount.js +2 -2
- package/scripts/fixNotificationSettings.js +4 -4
- package/scripts/fixSurveyRadioBakedInSubCodes.js +6 -6
- package/scripts/fixWrongUserIdForStatusUpdates.js +6 -5
- package/scripts/gallery/exportGalleryData.js +2 -2
- package/scripts/gallery/importGalleryForCommunity.js +14 -14
- package/scripts/gallery/readJsonAndDownloadImagesVersion2.js +6 -6
- package/scripts/gallery/refreshAcApiPostIdsForCommunity.js +5 -5
- package/scripts/genderAnalysis.js +10 -10
- package/scripts/genderAnalysisByStatus.js +4 -4
- package/scripts/importAllLocalesFromLocalFolders.js +7 -7
- package/scripts/importDomain.js +131 -131
- package/scripts/keys/addOidcToDomain.cjs +9 -9
- package/scripts/landUseGame/export3Ddata.js +15 -15
- package/scripts/listLanguagesForGroup.js +6 -6
- package/scripts/loadTestCreateDummyContentForGroup.js +2 -2
- package/scripts/makeRecursiveMapData.js +4 -4
- package/scripts/mapping/community_map_csv.js +5 -5
- package/scripts/moveCommunityToDomain.js +3 -3
- package/scripts/moveGroupToCommunity.js +3 -3
- package/scripts/movePostToGroup.js +5 -5
- package/scripts/movePostsToGroupsRecountGroupFromUrl.js +6 -6
- package/scripts/oldMovePostToGroup.js +9 -9
- package/scripts/processCsvForPdfUrls.js +2 -2
- package/scripts/processCsvForTranslationAndToxicity.js +10 -10
- package/scripts/recount/recount_recursive_communities.js +6 -6
- package/scripts/recountALLCommunityGroupCounts.js +4 -4
- package/scripts/recountAll.js +3 -3
- package/scripts/recountCommunitesFromUrl.js +3 -3
- package/scripts/recountCommunity.js +2 -2
- package/scripts/recountGroup.js +5 -5
- package/scripts/recountGroupNoUserChange.js +5 -5
- package/scripts/resetAllEndorsementsForGroup.js +3 -3
- package/scripts/resetEnTranslationForGroup.js +5 -5
- package/scripts/setAdminOnAll.cjs +14 -14
- package/scripts/setDomainAdmin.cjs +6 -6
- package/scripts/setDomainLocales.js +2 -2
- package/scripts/setEarlQuestionIdOnGroup.cjs +4 -4
- package/scripts/setLanguageOnGroupCommunitesFromUrl.js +3 -3
- package/scripts/setMemberOfAll.js +14 -14
- package/scripts/setNewUserForContentOfCommunity.js +9 -9
- package/scripts/setOfficialStatusOnAllPostsForCommunity.js +1 -1
- package/scripts/setUserOnAll.js +14 -14
- package/scripts/showCategoryForGroup.js +1 -1
- package/scripts/showOldActivityTypes.js +3 -3
- package/scripts/showPostsMissingCategoryForGroup.js +2 -2
- package/scripts/showStatuses.js +4 -4
- package/scripts/showUniqueVotersInCommunity.js +4 -4
- package/scripts/showUserAgentsAndIpsForEmails.js +4 -4
- package/scripts/simpleExportForGroupsForCommunity.js +5 -5
- package/scripts/simpleExportForPointsForCommunity.js +5 -5
- package/scripts/simpleExportForPostsForCommunity.js +5 -5
- package/scripts/testForEndorsments.js +4 -4
- package/scripts/undeleteGroupAndAllContent.js +8 -8
- package/scripts/undeletePost.js +7 -7
- package/scripts/unlinkSsn.js +4 -4
- package/scripts/updateFromAlthingi.js +8 -8
- package/scripts/users/createUserAddDomain.js +6 -5
- package/scripts/users/importUsersForDomainsFromXls.js +4 -3
- package/scripts/users/listDomainUsersWithSsn.js +6 -5
- package/scripts/users/removeUserFromDomain.js +6 -5
- package/scripts/users/updatePasswordFromSsn.js +5 -4
- package/scripts/users/updateUserSsnFromEmail.js +5 -4
- package/services/controllers/activities.cjs +1 -1
- package/services/controllers/news_feeds.cjs +1 -1
- package/services/controllers/notifications.cjs +1 -1
- package/services/controllers/recommendations.cjs +1 -1
- package/services/engine/allOurIdeas/aiHelper.js +10 -9
- package/services/engine/analytics/export_anon_community_activities.js +3 -3
- package/services/engine/analytics/importer.js +10 -10
- package/services/engine/analytics/plausible/manager.cjs +4 -4
- package/services/engine/analytics/statsCalc.cjs +1 -1
- package/services/engine/analytics/utils.cjs +10 -10
- package/services/engine/moderation/fraud/CreateFraudAuditReport.cjs +2 -1
- package/services/engine/moderation/fraud/FraudBase.cjs +2 -2
- package/services/engine/moderation/fraud/FraudDeleteBase.cjs +4 -4
- package/services/engine/moderation/fraud/FraudGetBase.cjs +1 -1
- package/services/engine/moderation/fraud/FraudGetEndorsements.cjs +1 -1
- package/services/engine/moderation/fraud/FraudGetPointQualities.cjs +1 -1
- package/services/engine/moderation/fraud/FraudGetPoints.cjs +1 -1
- package/services/engine/moderation/fraud/FraudGetPosts.cjs +1 -1
- package/services/engine/moderation/fraud/FraudGetRatings.cjs +1 -1
- package/services/engine/moderation/fraud/FraudScannerNotifier.cjs +9 -9
- package/services/engine/moderation/get_moderation_items.cjs +1 -1
- package/services/engine/moderation/image_labeling/ImageLabelingBase.cjs +1 -1
- package/services/engine/moderation/process_moderation_items.cjs +1 -1
- package/services/engine/moderation/toxicity_analysis.cjs +1 -1
- package/services/engine/news_feeds/generate_dynamically.cjs +1 -1
- package/services/engine/news_feeds/generate_from_notifications.cjs +1 -1
- package/services/engine/notifications/emails_utils.cjs +2 -2
- package/services/engine/notifications/generate_point_notifications.cjs +1 -1
- package/services/engine/notifications/generate_post_notifications.cjs +1 -1
- package/services/engine/notifications/process_delayed_notifications.cjs +38 -38
- package/services/engine/old/exporters/categories_dataset.js +11 -11
- package/services/engine/old/exporters/sentiment_dataset.js +12 -12
- package/services/engine/recommendations/events_importer.cjs +5 -5
- package/services/engine/recommendations/events_manager.cjs +1 -1
- package/services/engine/reports/add_points_to_sheet.cjs +2 -2
- package/services/engine/reports/commonUtils.js +3 -2
- package/services/engine/reports/common_utils.cjs +8 -8
- package/services/engine/reports/docx_group_report.cjs +1 -1
- package/services/engine/reports/xlsAllOurIdeasExport.js +16 -15
- package/services/engine/reports/xls_community_users_report.cjs +2 -2
- package/services/engine/reports/xls_group_report.cjs +1 -1
- package/services/llms/baseChatBot.js +12 -11
- package/services/llms/imageGeneration/chatGptImageGenerator.js +3 -2
- package/services/llms/imageGeneration/collectionImageGenerator.js +7 -6
- package/services/llms/imageGeneration/dalleImageGenerator.js +6 -5
- package/services/llms/imageGeneration/fluxImageGenerator.js +5 -4
- package/services/llms/imageGeneration/imageProcessorService.js +2 -1
- package/services/llms/imageGeneration/imagenImageGenerator.js +8 -7
- package/services/llms/imageGeneration/s3Service.js +12 -11
- package/services/llms/llmTranslation.js +30 -29
- package/services/models/ac_activity.cjs +1 -1
- package/services/models/ac_notification.cjs +1 -1
- package/services/models/ac_translation_cache.cjs +11 -11
- package/services/scripts/analytics/setup_all_plausible_goals.cjs +2 -2
- package/services/scripts/fix_old_delayed_notifications.js +3 -3
- package/services/scripts/kue_status.js +11 -11
- package/services/scripts/kue_watch_stuck_jobs.js +6 -6
- package/services/scripts/translation_clear_language.js +21 -21
- package/services/scripts/translation_delete.js +4 -4
- package/services/scripts/translation_replace_text_from_url.js +4 -4
- package/services/scripts/translation_update.js +4 -4
- package/services/scripts/translations_list.js +5 -5
- package/services/utils/airbrake.cjs +2 -1
- package/services/utils/redisConnection.cjs +6 -5
- package/services/utils/translation_helpers.cjs +3 -2
- package/services/utils/updateAllLocalesFromEn.js +20 -19
- package/services/utils/updateLocaleFolders.js +7 -6
- package/services/workers/activity.cjs +1 -1
- package/services/workers/anonymizations.cjs +1 -1
- package/services/workers/bulk_status_update.cjs +2 -2
- package/services/workers/delayed_jobs.cjs +1 -1
- package/services/workers/deletions.cjs +1 -1
- package/services/workers/email.cjs +1 -1
- package/services/workers/fraud_management.cjs +3 -3
- package/services/workers/generativeAi.js +6 -5
- package/services/workers/main.cjs +1 -1
- package/services/workers/marketing.cjs +1 -1
- package/services/workers/moderation.cjs +1 -1
- package/services/workers/notification_delivery.cjs +1 -1
- package/services/workers/notification_news_feed.cjs +1 -1
- package/services/workers/queue.cjs +2 -2
- package/services/workers/recount.cjs +1 -1
- package/services/workers/reports.cjs +1 -1
- package/services/workers/similarities.cjs +4 -2
- package/services/workers/speech_to_text.cjs +1 -1
- package/utils/airbrake.cjs +1 -1
- package/utils/cjsCodeReview.js +7 -6
- package/utils/community_mapping_tools.cjs +2 -2
- package/utils/copy_utils.cjs +31 -31
- package/utils/export_utils.cjs +7 -7
- package/utils/generateDocumentation.js +10 -9
- package/utils/logger.cjs +2 -23
- package/utils/logger.d.cts +1 -1
- package/utils/loggerAirbrakeTransport.cjs +52 -0
- package/utils/loggerAirbrakeTransport.d.cts +15 -0
- package/utils/loggerAirbrakeTransportTs.d.ts +15 -0
- package/utils/loggerAirbrakeTransportTs.js +45 -0
- package/utils/loggerCore.cjs +29 -0
- package/utils/loggerCore.d.cts +2 -0
- package/utils/loggerCoreTs.d.ts +2 -0
- package/utils/loggerCoreTs.js +23 -0
- package/utils/loggerTs.d.ts +1 -2
- package/utils/loggerTs.js +2 -25
- package/utils/recount_utils.cjs +5 -5
- package/utils/seedModels.js +50 -49
- package/utils/sitemap_generator.cjs +4 -4
- package/utils/ypLanguages.js +2 -2
- package/webSockets.js +8 -7
- package/services/utils/logger.cjs +0 -25
- package/services/utils/logger.d.cts +0 -2
- package/src/agents/assistants/assistant.d.ts +0 -156
- package/src/controllers/audios.d.ts +0 -5
- package/src/controllers/categories.d.ts +0 -5
- package/src/controllers/communities.d.ts +0 -5
- package/src/controllers/domains.d.ts +0 -5
- package/src/controllers/groups.d.ts +0 -5
- package/src/controllers/images.d.ts +0 -5
- package/src/controllers/points.d.ts +0 -5
- package/src/controllers/posts.d.ts +0 -5
- package/src/controllers/ratings.d.ts +0 -5
- package/src/controllers/users.d.ts +0 -5
- package/src/controllers/videos.d.ts +0 -5
- package/src/models/index.d.ts +0 -84
- package/src/services/controllers/activities.d.ts +0 -5
- package/src/services/controllers/notifications.d.ts +0 -5
- package/src/utils/copy_utils.d.ts +0 -4
- package/src/utils/manifest_generator.d.ts +0 -18
|
@@ -11,6 +11,7 @@ import { PsAgentConnector } from "@policysynth/agents/dbModels/agentConnector.js
|
|
|
11
11
|
import { PsAgentConnectorClass } from "@policysynth/agents/dbModels/agentConnectorClass.js";
|
|
12
12
|
import { PsAgentRegistry } from "@policysynth/agents/dbModels/agentRegistry.js";
|
|
13
13
|
import { PsAiModelSize, PsAiModelType, } from "@policysynth/agents/aiModelTypes.js";
|
|
14
|
+
import log from "../../utils/loggerTs.js";
|
|
14
15
|
// List of models that need to be initialized/associated
|
|
15
16
|
const psModels = {
|
|
16
17
|
PsAgentClass,
|
|
@@ -33,16 +34,16 @@ export class NewAiModelSetup {
|
|
|
33
34
|
if (process.env.FORCE_DB_SYNC || process.env.NODE_ENV === "development") {
|
|
34
35
|
await psSequelize.sync();
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
+
log.info("All Models Loaded Init");
|
|
37
38
|
for (const modelName of Object.keys(psModels)) {
|
|
38
39
|
if (typeof psModels[modelName].associate === "function") {
|
|
39
40
|
await psModels[modelName].associate(psSequelize.models);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
+
log.info("All models initialized successfully.");
|
|
43
44
|
}
|
|
44
45
|
catch (error) {
|
|
45
|
-
|
|
46
|
+
log.error("Error initializing models:", error);
|
|
46
47
|
process.exit(1);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -76,10 +77,10 @@ export class NewAiModelSetup {
|
|
|
76
77
|
user_id: userId,
|
|
77
78
|
configuration: anthropicSonnetConfig,
|
|
78
79
|
});
|
|
79
|
-
|
|
80
|
+
log.info("Created Anthropic model:", createdModel);
|
|
80
81
|
}
|
|
81
82
|
else {
|
|
82
|
-
|
|
83
|
+
log.info("Anthropic model already exists: Anthropic Sonnet 3.5");
|
|
83
84
|
anthropicSonnet.set("configuration", anthropicSonnetConfig);
|
|
84
85
|
anthropicSonnet.changed("configuration", true);
|
|
85
86
|
await anthropicSonnet.save();
|
|
@@ -111,10 +112,10 @@ export class NewAiModelSetup {
|
|
|
111
112
|
user_id: userId,
|
|
112
113
|
configuration: anthropicSonnetConfig,
|
|
113
114
|
});
|
|
114
|
-
|
|
115
|
+
log.info("Created Anthropic model:", createdModel);
|
|
115
116
|
}
|
|
116
117
|
else {
|
|
117
|
-
|
|
118
|
+
log.info("Anthropic model already exists: Anthropic Sonnet 3.7");
|
|
118
119
|
anthropicSonnet.set("configuration", anthropicSonnetConfig);
|
|
119
120
|
anthropicSonnet.changed("configuration", true);
|
|
120
121
|
await anthropicSonnet.save();
|
|
@@ -152,10 +153,10 @@ export class NewAiModelSetup {
|
|
|
152
153
|
user_id: userId,
|
|
153
154
|
configuration: openAiGpt4oConfig,
|
|
154
155
|
});
|
|
155
|
-
|
|
156
|
+
log.info("Created OpenAI model: GPT-4o");
|
|
156
157
|
}
|
|
157
158
|
else {
|
|
158
|
-
|
|
159
|
+
log.info("OpenAI model already exists: GPT-4o updating");
|
|
159
160
|
openAiGpt4.set("configuration", openAiGpt4oConfig);
|
|
160
161
|
openAiGpt4.changed("configuration", true);
|
|
161
162
|
await openAiGpt4.save();
|
|
@@ -186,13 +187,13 @@ export class NewAiModelSetup {
|
|
|
186
187
|
user_id: userId,
|
|
187
188
|
configuration: openAiGpt4oMiniConfig,
|
|
188
189
|
});
|
|
189
|
-
|
|
190
|
+
log.info("Created OpenAI model: GPT-4o Mini");
|
|
190
191
|
}
|
|
191
192
|
else {
|
|
192
193
|
openAiGpt4Mini.set("configuration", openAiGpt4oMiniConfig);
|
|
193
194
|
openAiGpt4Mini.changed("configuration", true);
|
|
194
195
|
await openAiGpt4Mini.save();
|
|
195
|
-
|
|
196
|
+
log.info("OpenAI model already exists: GPT-4o Mini");
|
|
196
197
|
}
|
|
197
198
|
// o1 Mini
|
|
198
199
|
const openAio1Mini = await PsAiModel.findOne({
|
|
@@ -220,13 +221,13 @@ export class NewAiModelSetup {
|
|
|
220
221
|
user_id: userId,
|
|
221
222
|
configuration: openAio1MiniConfig,
|
|
222
223
|
});
|
|
223
|
-
|
|
224
|
+
log.info("Created OpenAI model: o1 Mini");
|
|
224
225
|
}
|
|
225
226
|
else {
|
|
226
227
|
openAio1Mini.set("configuration", openAio1MiniConfig);
|
|
227
228
|
openAio1Mini.changed("configuration", true);
|
|
228
229
|
await openAio1Mini.save();
|
|
229
|
-
|
|
230
|
+
log.info("OpenAI model already exists: o1 Mini");
|
|
230
231
|
}
|
|
231
232
|
// o1 Preview
|
|
232
233
|
const openAio1Preview = await PsAiModel.findOne({
|
|
@@ -254,13 +255,13 @@ export class NewAiModelSetup {
|
|
|
254
255
|
user_id: userId,
|
|
255
256
|
configuration: openAio1PreviewConfig,
|
|
256
257
|
});
|
|
257
|
-
|
|
258
|
+
log.info("Created OpenAI model: o1 Preview");
|
|
258
259
|
}
|
|
259
260
|
else {
|
|
260
261
|
openAio1Preview.set("configuration", openAio1PreviewConfig);
|
|
261
262
|
openAio1Preview.changed("configuration", true);
|
|
262
263
|
await openAio1Preview.save();
|
|
263
|
-
|
|
264
|
+
log.info("OpenAI model already exists: o1 Preview");
|
|
264
265
|
}
|
|
265
266
|
// o1 24
|
|
266
267
|
const openAio11712 = await PsAiModel.findOne({
|
|
@@ -288,10 +289,10 @@ export class NewAiModelSetup {
|
|
|
288
289
|
user_id: userId,
|
|
289
290
|
configuration: openAio11712Config,
|
|
290
291
|
});
|
|
291
|
-
|
|
292
|
+
log.info("Created OpenAI model: o1 24");
|
|
292
293
|
}
|
|
293
294
|
else {
|
|
294
|
-
|
|
295
|
+
log.info("OpenAI model already exists: o1 24 updating");
|
|
295
296
|
openAio11712.set("configuration", openAio11712Config);
|
|
296
297
|
openAio11712.changed("configuration", true);
|
|
297
298
|
await openAio11712.save();
|
|
@@ -322,13 +323,13 @@ export class NewAiModelSetup {
|
|
|
322
323
|
user_id: userId,
|
|
323
324
|
configuration: openAio3MiniConfig,
|
|
324
325
|
});
|
|
325
|
-
|
|
326
|
+
log.info("Created OpenAI model: o3 mini");
|
|
326
327
|
}
|
|
327
328
|
else {
|
|
328
329
|
openAio3Mini.set("configuration", openAio3MiniConfig);
|
|
329
330
|
openAio3Mini.changed("configuration", true);
|
|
330
331
|
await openAio3Mini.save();
|
|
331
|
-
|
|
332
|
+
log.info("OpenAI model already exists: o3 mini");
|
|
332
333
|
}
|
|
333
334
|
const openAiGpt45 = await PsAiModel.findOne({
|
|
334
335
|
where: { name: "GPT-4.5 Preview" },
|
|
@@ -355,13 +356,13 @@ export class NewAiModelSetup {
|
|
|
355
356
|
user_id: userId,
|
|
356
357
|
configuration: openAiGpt45Config,
|
|
357
358
|
});
|
|
358
|
-
|
|
359
|
+
log.info("Created OpenAI model: GPT-4.5 Preview");
|
|
359
360
|
}
|
|
360
361
|
else {
|
|
361
362
|
openAiGpt45.set("configuration", openAiGpt45Config);
|
|
362
363
|
openAiGpt45.changed("configuration", true);
|
|
363
364
|
await openAiGpt45.save();
|
|
364
|
-
|
|
365
|
+
log.info("OpenAI model already exists: GPT-4.5 Preview");
|
|
365
366
|
}
|
|
366
367
|
const openAio3 = await PsAiModel.findOne({
|
|
367
368
|
where: { name: "o3" },
|
|
@@ -388,10 +389,10 @@ export class NewAiModelSetup {
|
|
|
388
389
|
user_id: userId,
|
|
389
390
|
configuration: openAio3Config,
|
|
390
391
|
});
|
|
391
|
-
|
|
392
|
+
log.info("Created OpenAI model: o3");
|
|
392
393
|
}
|
|
393
394
|
else {
|
|
394
|
-
|
|
395
|
+
log.info("OpenAI model already exists: o3 updating");
|
|
395
396
|
openAio3.set("configuration", openAio3Config);
|
|
396
397
|
openAio3.changed("configuration", true);
|
|
397
398
|
await openAio3.save();
|
|
@@ -421,13 +422,13 @@ export class NewAiModelSetup {
|
|
|
421
422
|
user_id: userId,
|
|
422
423
|
configuration: openAio4miniConfig,
|
|
423
424
|
});
|
|
424
|
-
|
|
425
|
+
log.info("Created OpenAI model: o4 mini");
|
|
425
426
|
}
|
|
426
427
|
else {
|
|
427
428
|
openAio4mini.set("configuration", openAio4miniConfig);
|
|
428
429
|
openAio4mini.changed("configuration", true);
|
|
429
430
|
await openAio4mini.save();
|
|
430
|
-
|
|
431
|
+
log.info("OpenAI model already exists: o4 mini");
|
|
431
432
|
}
|
|
432
433
|
const openAiGpt41 = await PsAiModel.findOne({
|
|
433
434
|
where: { name: "GPT-4.1" },
|
|
@@ -454,13 +455,13 @@ export class NewAiModelSetup {
|
|
|
454
455
|
user_id: userId,
|
|
455
456
|
configuration: openAiGpt41Config,
|
|
456
457
|
});
|
|
457
|
-
|
|
458
|
+
log.info("Created OpenAI model: GPT-4.1");
|
|
458
459
|
}
|
|
459
460
|
else {
|
|
460
461
|
openAiGpt41.set("configuration", openAiGpt41Config);
|
|
461
462
|
openAiGpt41.changed("configuration", true);
|
|
462
463
|
await openAiGpt41.save();
|
|
463
|
-
|
|
464
|
+
log.info("OpenAI model already exists: GPT-4.1");
|
|
464
465
|
}
|
|
465
466
|
}
|
|
466
467
|
/**
|
|
@@ -494,13 +495,13 @@ export class NewAiModelSetup {
|
|
|
494
495
|
user_id: userId,
|
|
495
496
|
configuration: geminiProConfig,
|
|
496
497
|
});
|
|
497
|
-
|
|
498
|
+
log.info("Created Google model: Gemini 1.5 Pro 2");
|
|
498
499
|
}
|
|
499
500
|
else {
|
|
500
501
|
geminiPro.set("configuration", geminiProConfig);
|
|
501
502
|
geminiPro.changed("configuration", true);
|
|
502
503
|
await geminiPro.save();
|
|
503
|
-
|
|
504
|
+
log.info("Google model already exists: Gemini 1.5 Pro 2");
|
|
504
505
|
}
|
|
505
506
|
// Gemini 1.5 Flash 2
|
|
506
507
|
const geminiPro15Flash = await PsAiModel.findOne({
|
|
@@ -528,13 +529,13 @@ export class NewAiModelSetup {
|
|
|
528
529
|
user_id: userId,
|
|
529
530
|
configuration: geminiPro15FlashConfig,
|
|
530
531
|
});
|
|
531
|
-
|
|
532
|
+
log.info("Created Google model: Gemini 1.5 Flash 2");
|
|
532
533
|
}
|
|
533
534
|
else {
|
|
534
535
|
geminiPro15Flash.set("configuration", geminiPro15FlashConfig);
|
|
535
536
|
geminiPro15Flash.changed("configuration", true);
|
|
536
537
|
await geminiPro15Flash.save();
|
|
537
|
-
|
|
538
|
+
log.info("Google model already exists: Gemini 1.5 Flash 2");
|
|
538
539
|
}
|
|
539
540
|
// Gemini 2.0 Flash
|
|
540
541
|
const gemini20Flash = await PsAiModel.findOne({
|
|
@@ -562,13 +563,13 @@ export class NewAiModelSetup {
|
|
|
562
563
|
user_id: userId,
|
|
563
564
|
configuration: gemini20FlashConfig,
|
|
564
565
|
});
|
|
565
|
-
|
|
566
|
+
log.info("Created Google model: Gemini 2.0 Flash");
|
|
566
567
|
}
|
|
567
568
|
else {
|
|
568
569
|
gemini20Flash.set("configuration", gemini20FlashConfig);
|
|
569
570
|
gemini20Flash.changed("configuration", true);
|
|
570
571
|
await gemini20Flash.save();
|
|
571
|
-
|
|
572
|
+
log.info("Google model already exists: Gemini 2.0 Flash");
|
|
572
573
|
}
|
|
573
574
|
const gemini25Pro = await PsAiModel.findOne({
|
|
574
575
|
where: { name: "Gemini 2.5 Pro" },
|
|
@@ -599,13 +600,13 @@ export class NewAiModelSetup {
|
|
|
599
600
|
user_id: userId,
|
|
600
601
|
configuration: gemini25ProConfig,
|
|
601
602
|
});
|
|
602
|
-
|
|
603
|
+
log.info("Created Google model: Gemini 2.5 Pro");
|
|
603
604
|
}
|
|
604
605
|
else {
|
|
605
606
|
gemini25Pro.set("configuration", gemini25ProConfig);
|
|
606
607
|
gemini25Pro.changed("configuration", true);
|
|
607
608
|
await gemini25Pro.save();
|
|
608
|
-
|
|
609
|
+
log.info("Google model already exists: Gemini 2.5 Pro");
|
|
609
610
|
}
|
|
610
611
|
const gemini25FlashPreview1 = await PsAiModel.findOne({
|
|
611
612
|
where: { name: "Gemini 2.5 Flash Preview 1" },
|
|
@@ -636,13 +637,13 @@ export class NewAiModelSetup {
|
|
|
636
637
|
user_id: userId,
|
|
637
638
|
configuration: gemini25FlashPreview1Config,
|
|
638
639
|
});
|
|
639
|
-
|
|
640
|
+
log.info("Created Google model: Gemini 2.5 Flash Preview 1");
|
|
640
641
|
}
|
|
641
642
|
else {
|
|
642
643
|
gemini25FlashPreview1.set("configuration", gemini25FlashPreview1Config);
|
|
643
644
|
gemini25FlashPreview1.changed("configuration", true);
|
|
644
645
|
await gemini25FlashPreview1.save();
|
|
645
|
-
|
|
646
|
+
log.info("Google model already exists: Gemini 2.5 Pro");
|
|
646
647
|
}
|
|
647
648
|
const gemini25FlashPreview = await PsAiModel.findOne({
|
|
648
649
|
where: { name: "Gemini 2.5 Flash Preview" },
|
|
@@ -669,13 +670,13 @@ export class NewAiModelSetup {
|
|
|
669
670
|
user_id: userId,
|
|
670
671
|
configuration: gemini25FlashPreviewConfig,
|
|
671
672
|
});
|
|
672
|
-
|
|
673
|
+
log.info("Created Google model: Gemini 2.5 Flash Preview");
|
|
673
674
|
}
|
|
674
675
|
else {
|
|
675
676
|
gemini25FlashPreview.set("configuration", gemini25FlashPreviewConfig);
|
|
676
677
|
gemini25FlashPreview.changed("configuration", true);
|
|
677
678
|
await gemini25FlashPreview.save();
|
|
678
|
-
|
|
679
|
+
log.info("Google model already exists: Gemini 2.5 Flash Preview");
|
|
679
680
|
}
|
|
680
681
|
}
|
|
681
682
|
/**
|
|
@@ -722,14 +723,14 @@ export class NewAiModelSetup {
|
|
|
722
723
|
configuration: topLevelAgentClassConfig,
|
|
723
724
|
user_id: userId,
|
|
724
725
|
});
|
|
725
|
-
|
|
726
|
+
log.info("Created top-level agent class: Operations");
|
|
726
727
|
}
|
|
727
728
|
else {
|
|
728
|
-
|
|
729
|
+
log.info("Top-level agent class: Operations already exists");
|
|
729
730
|
}
|
|
730
731
|
}
|
|
731
732
|
catch (error) {
|
|
732
|
-
|
|
733
|
+
log.error("Error seeding AI models:", error);
|
|
733
734
|
process.exit(1);
|
|
734
735
|
}
|
|
735
736
|
}
|
|
@@ -738,13 +739,13 @@ export class NewAiModelSetup {
|
|
|
738
739
|
*/
|
|
739
740
|
static setupAiModels(userId) {
|
|
740
741
|
setTimeout(async () => {
|
|
741
|
-
|
|
742
|
+
log.info("Seeding AI models");
|
|
742
743
|
const user = await User.findOne({
|
|
743
744
|
attributes: ["id"],
|
|
744
745
|
where: { id: userId },
|
|
745
746
|
});
|
|
746
747
|
if (!user) {
|
|
747
|
-
|
|
748
|
+
log.error("User not found");
|
|
748
749
|
return;
|
|
749
750
|
}
|
|
750
751
|
await NewAiModelSetup.seedAiModels(user.id);
|