Package mindsdb.services
Class KnowledgeBases
java.lang.Object
mindsdb.services.KnowledgeBases
Service class for managing knowledge bases in a MindsDB project.
-
Constructor Summary
ConstructorDescriptionKnowledgeBases
(Project project, RestAPI api) Constructs a new KnowledgeBases instance with the provided project and API. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(String name, Model model, MDBTable storage, List<String> metadataColumns, List<String> contentColumns, String idColumn, Map<String, Object> params) Create a new knowledge base.void
Drop a knowledge base by name.Get a knowledge base by name.list()
List all knowledge bases in the project.
-
Constructor Details
-
KnowledgeBases
Constructs a new KnowledgeBases instance with the provided project and API.- Parameters:
project
- The project associated with the knowledge bases.api
- The API instance used to interact with the backend.
-
-
Method Details
-
list
List all knowledge bases in the project.- Returns:
- List of knowledge bases.
-
get
Get a knowledge base by name.- Parameters:
name
- The name of the knowledge base.- Returns:
- The knowledge base with the specified name.
- Throws:
IllegalArgumentException
- if the knowledge base does not exist.
-
create
public KnowledgeBase create(String name, Model model, MDBTable storage, List<String> metadataColumns, List<String> contentColumns, String idColumn, Map<String, Object> params) Create a new knowledge base.- Parameters:
name
- The name of the knowledge base.model
- The model to use for the knowledge base.storage
- The storage to use for the knowledge base.metadataColumns
- The metadata columns for the knowledge base.contentColumns
- The content columns for the knowledge base.idColumn
- The ID column for the knowledge base.params
- Additional parameters for the knowledge base.- Returns:
- The created knowledge base.
-
drop
Drop a knowledge base by name.- Parameters:
name
- The name of the knowledge base to drop.
-