Package com.axelor.ai.db.repo
Class AiModelRepository
java.lang.Object
com.axelor.db.JpaRepository<AiModel>
com.axelor.ai.db.repo.AbstractAiModelRepository
com.axelor.ai.db.repo.AiModelRepository
- All Implemented Interfaces:
Repository<AiModel>
-
Field Summary
Fields inherited from class com.axelor.db.JpaRepository
modelClass -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.axelor.ai.db.repo.AbstractAiModelRepository
findByCode, findByNameMethods inherited from class com.axelor.db.JpaRepository
all, all, copy, create, fields, find, findById, findByIds, flush, getReferenceById, isPermitted, isPermitted, merge, of, persist, populate, refresh, validate
-
Constructor Details
-
AiModelRepository
public AiModelRepository()
-
-
Method Details
-
save
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 (seeChatModelFactory), 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:
savein interfaceRepository<AiModel>- Overrides:
savein classJpaRepository<AiModel>- Parameters:
entity- the entity object to save- Returns:
- an instance of the entity with saved state
-
remove
Takes the model off the policies that list it first.- Specified by:
removein interfaceRepository<AiModel>- Overrides:
removein classJpaRepository<AiModel>- Parameters:
model- the entity object
-