Package com.axelor.ai.db
Class AiPolicy
java.lang.Object
com.axelor.db.Model
com.axelor.auth.db.AuditableModel
com.axelor.ai.db.AiPolicy
What the AI may not read, and where: every AI call when global, else the calls of the agents it
lists and the calls sent to the models and providers it lists — any one of them.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the givenAiAgentitem to theagentscollection.voidAdd the givenAiModelitem to themodelscollection.voidaddProvider(AiProvider item) Add the givenAiProvideritem to theproviderscollection.voidaddRestriction(AiRestriction item) Add the givenAiRestrictionitem to therestrictionscollection.voidClear theagentscollection.voidClear themodelscollection.voidClear theproviderscollection.voidClear therestrictionscollection.booleanApplies to what these agents read, and the agents they consult.getAttrs()Applies to every AI call, those of no agent too: titles, summaries, embeddings.getId()Applies to what is sent to these models.getName()Applies to what is sent to any model of these providers.inthashCode()voidremoveAgent(AiAgent item) Remove the givenAiAgentitem from theagentscollection.voidremoveModel(AiModel item) Remove the givenAiModelitem from themodelscollection.voidremoveProvider(AiProvider item) Remove the givenAiProvideritem from theproviderscollection.voidRemove the givenAiRestrictionitem from therestrictionscollection.voidvoidvoidvoidsetDescription(String description) voidvoidvoidvoidvoidsetProviders(Set<AiProvider> providers) voidsetRestrictions(List<AiRestriction> restrictions) toString()Methods inherited from class com.axelor.auth.db.AuditableModel
getCreatedBy, getCreatedOn, getUpdatedBy, getUpdatedOnMethods inherited from class com.axelor.db.Model
getArchived, getCid, getImportId, getVersion, isSelected, setArchived, setCid, setImportId, setSelected, setVersion
-
Constructor Details
-
AiPolicy
public AiPolicy() -
AiPolicy
-
-
Method Details
-
getId
-
setId
-
getName
-
setName
-
getDescription
-
setDescription
-
getActive
-
setActive
-
getGlobal
Applies to every AI call, those of no agent too: titles, summaries, embeddings.- Returns:
- the property value
-
setGlobal
-
getAgents
Applies to what these agents read, and the agents they consult.- Returns:
- the property value
-
setAgents
-
addAgent
Add the givenAiAgentitem to theagentscollection.- Parameters:
item- the item to add
-
removeAgent
Remove the givenAiAgentitem from theagentscollection.- Parameters:
item- the item to remove
-
clearAgents
public void clearAgents()Clear theagentscollection. -
getModels
Applies to what is sent to these models.- Returns:
- the property value
-
setModels
-
addModel
Add the givenAiModelitem to themodelscollection.- Parameters:
item- the item to add
-
removeModel
Remove the givenAiModelitem from themodelscollection.- Parameters:
item- the item to remove
-
clearModels
public void clearModels()Clear themodelscollection. -
getProviders
Applies to what is sent to any model of these providers.- Returns:
- the property value
-
setProviders
-
addProvider
Add the givenAiProvideritem to theproviderscollection.- Parameters:
item- the item to add
-
removeProvider
Remove the givenAiProvideritem from theproviderscollection.- Parameters:
item- the item to remove
-
clearProviders
public void clearProviders()Clear theproviderscollection. -
getRestrictions
-
setRestrictions
-
addRestriction
Add the givenAiRestrictionitem to therestrictionscollection.It sets
item.policy = thisto ensure the proper relationship.- Parameters:
item- the item to add
-
removeRestriction
Remove the givenAiRestrictionitem from therestrictionscollection.- Parameters:
item- the item to remove
-
clearRestrictions
public void clearRestrictions()Clear therestrictionscollection. -
getAttrs
-
setAttrs
-
equals
-
hashCode
public int hashCode() -
toString
-