Class AiPolicy


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

    • AiPolicy

      public AiPolicy()
    • AiPolicy

      public AiPolicy(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 AI call, those of no agent too: titles, summaries, embeddings.
      Returns:
      the property value
    • setGlobal

      public void setGlobal(Boolean global)
    • getAgents

      public Set<AiAgent> getAgents()
      Applies to what these agents read, and the agents they consult.
      Returns:
      the property value
    • setAgents

      public void setAgents(Set<AiAgent> agents)
    • addAgent

      public void addAgent(AiAgent item)
      Add the given AiAgent item to the agents collection.
      Parameters:
      item - the item to add
    • removeAgent

      public void removeAgent(AiAgent item)
      Remove the given AiAgent item from the agents collection.
      Parameters:
      item - the item to remove
    • clearAgents

      public void clearAgents()
      Clear the agents collection.
    • getModels

      public Set<AiModel> getModels()
      Applies to what is sent to these models.
      Returns:
      the property value
    • setModels

      public void setModels(Set<AiModel> models)
    • addModel

      public void addModel(AiModel item)
      Add the given AiModel item to the models collection.
      Parameters:
      item - the item to add
    • removeModel

      public void removeModel(AiModel item)
      Remove the given AiModel item from the models collection.
      Parameters:
      item - the item to remove
    • clearModels

      public void clearModels()
      Clear the models collection.
    • getProviders

      public Set<AiProvider> getProviders()
      Applies to what is sent to any model of these providers.
      Returns:
      the property value
    • setProviders

      public void setProviders(Set<AiProvider> providers)
    • addProvider

      public void addProvider(AiProvider item)
      Add the given AiProvider item to the providers collection.
      Parameters:
      item - the item to add
    • removeProvider

      public void removeProvider(AiProvider item)
      Remove the given AiProvider item from the providers collection.
      Parameters:
      item - the item to remove
    • clearProviders

      public void clearProviders()
      Clear the providers collection.
    • getRestrictions

      public List<AiRestriction> getRestrictions()
    • setRestrictions

      public void setRestrictions(List<AiRestriction> restrictions)
    • addRestriction

      public void addRestriction(AiRestriction item)
      Add the given AiRestriction item to the restrictions collection.

      It sets item.policy = this to ensure the proper relationship.

      Parameters:
      item - the item to add
    • removeRestriction

      public void removeRestriction(AiRestriction item)
      Remove the given AiRestriction item from the restrictions collection.
      Parameters:
      item - the item to remove
    • clearRestrictions

      public void clearRestrictions()
      Clear the restrictions collection.
    • 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