Loading common_lib/lib/platform_config_manager.py +9 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ from django.conf import settings from common_lib.models import PlatformConfig from common_lib.schema.inputs import PlatformConfigInput from llm.llm_classes import LLM_CLIENT class PlatformConfigManager: Loading @@ -12,6 +13,7 @@ class PlatformConfigManager: config = PlatformConfigManager.get_config() max_teams = platform_config_input.max_teams update_interval = platform_config_input.update_interval llm_pre_load = platform_config_input.llm_pre_load if max_teams is not None: if max_teams < settings.MIN_MAX_TEAMS: Loading @@ -27,6 +29,13 @@ class PlatformConfigManager: ) config.update_interval = update_interval if llm_pre_load is not None: if llm_pre_load and LLM_CLIENT is None: raise ValueError( "'llm_pre_load' cannot be set to True when LLM client is not configured" ) config.llm_pre_load = llm_pre_load config.save() return config Loading common_lib/migrations/0003_platformconfig_llm_pre_load.py 0 → 100644 +18 −0 Original line number Diff line number Diff line # Generated by Django 3.2.25 on 2026-01-16 09:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('common_lib', '0002_seed_platform_config'), ] operations = [ migrations.AddField( model_name='platformconfig', name='llm_pre_load', field=models.BooleanField(default=False), ), ] common_lib/models.py +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ from django.db import models class PlatformConfig(models.Model): max_teams = models.IntegerField() update_interval = models.IntegerField() llm_pre_load = models.BooleanField(default=False) def __str__(self): return f"PlatformConfig(max_teams={self.max_teams}, update_interval={self.update_interval})" return f"PlatformConfig(max_teams={self.max_teams}, update_interval={self.update_interval}, llm_pre_load={self.llm_pre_load})" common_lib/schema/inputs.py +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ class TimeIntervalInput(TimeIntervalBase, graphene.InputObjectType): class PlatformConfigInputBase: max_teams = graphene.Int(required=False, default_value=None) update_interval = graphene.Int(required=False, default_value=None) llm_pre_load = graphene.Boolean(required=False, default_value=None) class PlatformConfigType(PlatformConfigInputBase, graphene.ObjectType): Loading common_lib/schema/types.py +2 −2 Original line number Diff line number Diff line Loading @@ -539,7 +539,7 @@ class FreeFormQuestionDetailsType(DjangoObjectType): def resolve_llm_assessment(self, info): user = user_from_context(info.context) if user.group == User.AuthGroup.TRAINEE: return LLMAssessment.objects.none() return None return self.llm_assessment Loading Loading @@ -1184,7 +1184,7 @@ class TEmailAddressType(DjangoObjectType): class Meta: model = EmailAddress interfaces = (EmailAddressInterface,) exclude = ["templates"] exclude = ["templates", "llm_assessment"] class IEmailAddressType(DjangoObjectType): Loading Loading
common_lib/lib/platform_config_manager.py +9 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ from django.conf import settings from common_lib.models import PlatformConfig from common_lib.schema.inputs import PlatformConfigInput from llm.llm_classes import LLM_CLIENT class PlatformConfigManager: Loading @@ -12,6 +13,7 @@ class PlatformConfigManager: config = PlatformConfigManager.get_config() max_teams = platform_config_input.max_teams update_interval = platform_config_input.update_interval llm_pre_load = platform_config_input.llm_pre_load if max_teams is not None: if max_teams < settings.MIN_MAX_TEAMS: Loading @@ -27,6 +29,13 @@ class PlatformConfigManager: ) config.update_interval = update_interval if llm_pre_load is not None: if llm_pre_load and LLM_CLIENT is None: raise ValueError( "'llm_pre_load' cannot be set to True when LLM client is not configured" ) config.llm_pre_load = llm_pre_load config.save() return config Loading
common_lib/migrations/0003_platformconfig_llm_pre_load.py 0 → 100644 +18 −0 Original line number Diff line number Diff line # Generated by Django 3.2.25 on 2026-01-16 09:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('common_lib', '0002_seed_platform_config'), ] operations = [ migrations.AddField( model_name='platformconfig', name='llm_pre_load', field=models.BooleanField(default=False), ), ]
common_lib/models.py +2 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ from django.db import models class PlatformConfig(models.Model): max_teams = models.IntegerField() update_interval = models.IntegerField() llm_pre_load = models.BooleanField(default=False) def __str__(self): return f"PlatformConfig(max_teams={self.max_teams}, update_interval={self.update_interval})" return f"PlatformConfig(max_teams={self.max_teams}, update_interval={self.update_interval}, llm_pre_load={self.llm_pre_load})"
common_lib/schema/inputs.py +1 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ class TimeIntervalInput(TimeIntervalBase, graphene.InputObjectType): class PlatformConfigInputBase: max_teams = graphene.Int(required=False, default_value=None) update_interval = graphene.Int(required=False, default_value=None) llm_pre_load = graphene.Boolean(required=False, default_value=None) class PlatformConfigType(PlatformConfigInputBase, graphene.ObjectType): Loading
common_lib/schema/types.py +2 −2 Original line number Diff line number Diff line Loading @@ -539,7 +539,7 @@ class FreeFormQuestionDetailsType(DjangoObjectType): def resolve_llm_assessment(self, info): user = user_from_context(info.context) if user.group == User.AuthGroup.TRAINEE: return LLMAssessment.objects.none() return None return self.llm_assessment Loading Loading @@ -1184,7 +1184,7 @@ class TEmailAddressType(DjangoObjectType): class Meta: model = EmailAddress interfaces = (EmailAddressInterface,) exclude = ["templates"] exclude = ["templates", "llm_assessment"] class IEmailAddressType(DjangoObjectType): Loading