Class MindsService

java.lang.Object
com.mindsdb.services.MindsService

public class MindsService extends Object
Service class for managing Minds. Provides methods to create, retrieve, list, and delete Mind objects using a REST client.
  • Constructor Details

    • MindsService

      public MindsService(RestClient restClient)
  • Method Details

    • create

      public Mind create(String name) throws Exception
      Creates a new Mind with the specified name.
      Parameters:
      name - the name of the Mind to be created
      Returns:
      the created Mind object
      Throws:
      Exception - if an error occurs during the creation process
    • create

      public Mind create(String name, List<String> datasources) throws Exception
      Creates a new Mind with the specified name and associated data sources.
      Parameters:
      name - the name of the Mind to be created
      datasources - a list of data sources to associate with the Mind
      Returns:
      the created Mind object
      Throws:
      Exception - if an error occurs during the creation process
    • create

      public Mind create(String name, List<String> datasources, String modelName, com.google.gson.JsonObject parameters, String provider, String promptTemplate) throws Exception
      Creates a new Mind with the specified parameters.
      Parameters:
      name - the name of the Mind to be created
      datasources - a list of data sources to associate with the Mind
      modelName - the name of the model to be used
      parameters - JSON object containing additional parameters for the Mind
      provider - the provider to be used
      promptTemplate - the template for the prompt
      Returns:
      the created Mind object
      Throws:
      Exception - if an error occurs during the creation process
    • list

      public Optional<List<Mind>> list() throws Exception
      Retrieves a list of all Minds.
      Returns:
      an Optional containing a list of Mind objects, or an empty Optional if no Minds are found
      Throws:
      Exception - if an error occurs during the retrieval process
    • get

      public Optional<Mind> get(String mindName) throws Exception
      Retrieves a specific Mind by name.
      Parameters:
      mindName - the name of the Mind to retrieve
      Returns:
      an Optional containing the Mind object, or an empty Optional if not found
      Throws:
      Exception - if an error occurs during the retrieval process
    • drop

      public void drop(String mindName) throws Exception
      Deletes a specific Mind by name.
      Parameters:
      mindName - the name of the Mind to delete
      Throws:
      Exception - if an error occurs during the deletion process