Class Minds
The Minds class provides methods to manage and interact with MindsDB's mind entities. It allows users to list, create, retrieve, and delete minds and check or create datasources.
public class Minds
- Inheritance
-
Minds
- Inherited Members
Constructors
Minds(Client)
Initializes a new instance of the Minds class with the provided client.
public Minds(Client client)
Parameters
client
ClientThe client instance used to make API requests.
Methods
CheckDatasource(object)
Verifies and retrieves the name of a datasource.
public string CheckDatasource(object ds)
Parameters
ds
objectThe datasource object, which can be a Datasource, a DatabaseConfig, or a string.
Returns
- string
The name of the datasource as a string.
Exceptions
- ArgumentException
Thrown if the datasource type is unknown.
Create(string, string, string, string, List<string>, Dictionary<string, object>, bool)
Creates a new mind with the given configuration options. Optionally, it can replace an existing mind with the same name.
public Task<Mind> Create(string name, string modelName = null, string provider = null, string promptTemplate = null, List<string> datasources = null, Dictionary<string, object> parameters = null, bool replace = false)
Parameters
name
stringThe name of the mind to create.
modelName
stringThe name of the model to associate with the mind (optional).
provider
stringThe provider for the model (optional).
promptTemplate
stringA prompt template for the mind (optional).
datasources
List<string>A list of datasources associated with the mind (optional).
parameters
Dictionary<string, object>A dictionary of parameters to configure the mind (optional).
replace
boolIf set to true, will replace an existing mind with the same name (optional).
Returns
Exceptions
- ObjectNotFoundException
Thrown if the mind to replace doesn't exist.
Drop(string)
Deletes a mind by name from the project.
public Task Drop(string name)
Parameters
name
stringThe name of the mind to delete.
Returns
Get(string)
Retrieves a specific mind by name.
public Task<Mind> Get(string name)
Parameters
name
stringThe name of the mind to retrieve.
Returns
List()
Retrieves a list of all minds in the current project.
public Task<List<Mind>> List()