Class AiModelRepository

All Implemented Interfaces:
Repository<AiModel>

public class AiModelRepository extends AbstractAiModelRepository
  • Constructor Details

    • AiModelRepository

      public AiModelRepository()
  • Method Details

    • save

      public AiModel save(AiModel entity)
      Keeps at most one default per model type, unsetting whichever model held it before.

      The default is looked up with fetchOne() and no provider filter (see ChatModelFactory), so a second one makes the lookup ambiguous rather than merely untidy — which is why this is enforced on the way in rather than left to the form.

      Types are independent: a chat default and an embedding default are separate lookups.

      Specified by:
      save in interface Repository<AiModel>
      Overrides:
      save in class JpaRepository<AiModel>
      Parameters:
      entity - the entity object to save
      Returns:
      an instance of the entity with saved state
    • remove

      public void remove(AiModel model)
      Takes the model off the policies that list it first.
      Specified by:
      remove in interface Repository<AiModel>
      Overrides:
      remove in class JpaRepository<AiModel>
      Parameters:
      model - the entity object