Class MysqlSkillRepository.Builder
java.lang.Object
io.agentscope.core.skill.repository.mysql.MysqlSkillRepository.Builder
- Enclosing class:
- MysqlSkillRepository
Builder for creating MysqlSkillRepository instances with custom configuration.
This builder provides a fluent API for configuring all aspects of the repository, including database name, table names, and behavior options.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the MysqlSkillRepository instance.createIfNotExist(boolean createIfNotExist) Set whether to create database and tables if they don't exist.databaseName(String databaseName) Set the database name for storing skills.resourcesTableName(String resourcesTableName) Set the resources table name.skillsTableName(String skillsTableName) Set the skills table name.writeable(boolean writeable) Set whether the repository supports write operations.
-
Method Details
-
databaseName
Set the database name for storing skills.- Parameters:
databaseName- the database name (default: "agentscope")- Returns:
- this builder for method chaining
-
skillsTableName
Set the skills table name.- Parameters:
skillsTableName- the skills table name (default: "agentscope_skills")- Returns:
- this builder for method chaining
-
resourcesTableName
Set the resources table name.- Parameters:
resourcesTableName- the resources table name (default: "agentscope_skill_resources")- Returns:
- this builder for method chaining
-
createIfNotExist
Set whether to create database 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
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
Build the MysqlSkillRepository instance.- Returns:
- a new MysqlSkillRepository instance
- Throws:
IllegalArgumentException- if identifiers are invalidIllegalStateException- if createIfNotExist is false and database/tables do not exist
-