Package com.axelor.ai.db
Class AiUsagePolicy
java.lang.Object
com.axelor.db.Model
com.axelor.auth.db.AuditableModel
com.axelor.ai.db.AiUsagePolicy
How much the users it applies to may ask in the chat panel: everyone when global, else the users
of the roles, groups and users it lists. Where several apply, the highest limit wins.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the givenGroupitem to thegroupscollection.voidAdd the givenRoleitem to therolescollection.voidAdd the givenUseritem to theuserscollection.voidClear thegroupscollection.voidClear therolescollection.voidClear theuserscollection.booleangetAttrs()Applies to every user.Applies to the users of these groups.getId()getName()Max AI chat requests per second for users in this scope.getRoles()Applies to the users with any of these roles, directly or through their group.Monthly token budget (inputTokens + outputTokens) for what users in this scope ask in the chat panel.getUsers()Applies to these users.inthashCode()voidremoveGroup(Group item) Remove the givenGroupitem from thegroupscollection.voidremoveRole(Role item) Remove the givenRoleitem from therolescollection.voidremoveUser(User item) Remove the givenUseritem from theuserscollection.voidvoidvoidsetDescription(String description) voidvoidvoidvoidvoidsetRateLimit(Integer rateLimit) voidvoidsetTokenQuotaMonthly(Integer tokenQuotaMonthly) voidtoString()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
-
AiUsagePolicy
public AiUsagePolicy() -
AiUsagePolicy
-
-
Method Details
-
getId
-
setId
-
getName
-
setName
-
getDescription
-
setDescription
-
getActive
-
setActive
-
getGlobal
Applies to every user.- Returns:
- the property value
-
setGlobal
-
getRoles
Applies to the users with any of these roles, directly or through their group.- Returns:
- the property value
-
setRoles
-
addRole
Add the givenRoleitem to therolescollection.- Parameters:
item- the item to add
-
removeRole
Remove the givenRoleitem from therolescollection.- Parameters:
item- the item to remove
-
clearRoles
public void clearRoles()Clear therolescollection. -
getGroups
Applies to the users of these groups.- Returns:
- the property value
-
setGroups
-
addGroup
Add the givenGroupitem to thegroupscollection.- Parameters:
item- the item to add
-
removeGroup
Remove the givenGroupitem from thegroupscollection.- Parameters:
item- the item to remove
-
clearGroups
public void clearGroups()Clear thegroupscollection. -
getUsers
Applies to these users.- Returns:
- the property value
-
setUsers
-
addUser
Add the givenUseritem to theuserscollection.- Parameters:
item- the item to add
-
removeUser
Remove the givenUseritem from theuserscollection.- Parameters:
item- the item to remove
-
clearUsers
public void clearUsers()Clear theuserscollection. -
getTokenQuotaMonthly
Monthly token budget (inputTokens + outputTokens) for what users in this scope ask in the chat panel. Background and programmatic calls do not count. Empty = unlimited.- Returns:
- the property value
-
setTokenQuotaMonthly
-
getRateLimit
Max AI chat requests per second for users in this scope. Empty = no limit.- Returns:
- the property value
-
setRateLimit
-
getAttrs
-
setAttrs
-
equals
-
hashCode
public int hashCode() -
toString
-