Class PostgresSkillRepository.Builder

java.lang.Object
io.agentscope.core.skill.repository.postgresql.PostgresSkillRepository.Builder
Enclosing class:
PostgresSkillRepository

public static class PostgresSkillRepository.Builder extends Object
Builder for creating PostgresSkillRepository instances with custom configuration.

This builder provides a fluent API for configuring all aspects of the repository, including schema name, table names, and behavior options.

  • Method Details

    • schemaName

      public PostgresSkillRepository.Builder schemaName(String schemaName)
      Set the schema name for storing skills.
      Parameters:
      schemaName - the schema name (default: "agentscope")
      Returns:
      this builder for method chaining
    • skillsTableName

      public PostgresSkillRepository.Builder skillsTableName(String skillsTableName)
      Set the skills table name.
      Parameters:
      skillsTableName - the skills table name (default: "agentscope_skills")
      Returns:
      this builder for method chaining
    • resourcesTableName

      public PostgresSkillRepository.Builder resourcesTableName(String resourcesTableName)
      Set the resources table name.
      Parameters:
      resourcesTableName - the resources table name (default: "agentscope_skill_resources")
      Returns:
      this builder for method chaining
    • createIfNotExist

      public PostgresSkillRepository.Builder createIfNotExist(boolean createIfNotExist)
      Set whether to create schema and tables if they don't exist.
      Parameters:
      createIfNotExist - true to auto-create, false to require existing (default: true)
      Returns:
      this builder for method chaining
    • writeable

      public PostgresSkillRepository.Builder writeable(boolean writeable)
      Set whether the repository supports write operations.
      Parameters:
      writeable - true to enable write operations, false for read-only (default: true)
      Returns:
      this builder for method chaining
    • build

      public PostgresSkillRepository build()
      Build the PostgresSkillRepository instance.
      Returns:
      a new PostgresSkillRepository instance
      Throws:
      IllegalArgumentException - if identifiers are invalid
      IllegalStateException - if createIfNotExist is false and schema/tables do not exist