Class AiUsagePolicy


@Entity public class AiUsagePolicy extends AuditableModel
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 Details

    • AiUsagePolicy

      public AiUsagePolicy()
    • AiUsagePolicy

      public AiUsagePolicy(String name)
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in class Model
    • setId

      public void setId(Long id)
      Specified by:
      setId in class Model
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getActive

      public Boolean getActive()
    • setActive

      public void setActive(Boolean active)
    • getGlobal

      public Boolean getGlobal()
      Applies to every user.
      Returns:
      the property value
    • setGlobal

      public void setGlobal(Boolean global)
    • getRoles

      public Set<Role> getRoles()
      Applies to the users with any of these roles, directly or through their group.
      Returns:
      the property value
    • setRoles

      public void setRoles(Set<Role> roles)
    • addRole

      public void addRole(Role item)
      Add the given Role item to the roles collection.
      Parameters:
      item - the item to add
    • removeRole

      public void removeRole(Role item)
      Remove the given Role item from the roles collection.
      Parameters:
      item - the item to remove
    • clearRoles

      public void clearRoles()
      Clear the roles collection.
    • getGroups

      public Set<Group> getGroups()
      Applies to the users of these groups.
      Returns:
      the property value
    • setGroups

      public void setGroups(Set<Group> groups)
    • addGroup

      public void addGroup(Group item)
      Add the given Group item to the groups collection.
      Parameters:
      item - the item to add
    • removeGroup

      public void removeGroup(Group item)
      Remove the given Group item from the groups collection.
      Parameters:
      item - the item to remove
    • clearGroups

      public void clearGroups()
      Clear the groups collection.
    • getUsers

      public Set<User> getUsers()
      Applies to these users.
      Returns:
      the property value
    • setUsers

      public void setUsers(Set<User> users)
    • addUser

      public void addUser(User item)
      Add the given User item to the users collection.
      Parameters:
      item - the item to add
    • removeUser

      public void removeUser(User item)
      Remove the given User item from the users collection.
      Parameters:
      item - the item to remove
    • clearUsers

      public void clearUsers()
      Clear the users collection.
    • getTokenQuotaMonthly

      public Integer 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

      public void setTokenQuotaMonthly(Integer tokenQuotaMonthly)
    • getRateLimit

      public Integer getRateLimit()
      Max AI chat requests per second for users in this scope. Empty = no limit.
      Returns:
      the property value
    • setRateLimit

      public void setRateLimit(Integer rateLimit)
    • getAttrs

      public String getAttrs()
    • setAttrs

      public void setAttrs(String attrs)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object