Skip to content

Abiji-2020/minds-go-sdk

Repository files navigation

GitHub Actions Workflow Status Go Report Card GitHub License

Minds Go SDK

The Minds Go SDK is a Software Development Kit for the Minds (Unofficial). Built with the REST API Endpoints given by the Minds. With the help of this the Go Developers can able to easily interact with the Minds. Currently the Minds SDK allows the developer to Create, Update, Add Datasource, Delete , List and Get the Minds, and Datasource. As of now it uses the Http package from the go to communicate with the Endpoints of Minds.

Features

  • Mind Management: Create, Update, Delete and Fetch details of Minds from MindsDB and also has the feature to add Datasource to the existing Mind.
  • Datasource Management: Create, Update, Delete and Fetch details of Datasources linked to MindsDB.
  • Chat Completeion: Integreate with chat applications API for natural language processing, it can support both single chat and streaming of chats.

Getting Started

Prerequisites

Before you can use the SDK, you'll need: - A valid Minds API key (can be accessed from [Minds](https://mdb.ai/login) - Go installed in your machine. - A project set up in Go or you can create a new one.

Installation

To install the SDK, run the following command in the terminal where your project is located.

go get github.com/Abiji-2020/minds-go-sdk

Then you can use the modules in the project.

Usage

Below is a simple example of how to use the Client package to interact with the Minds API. More Examples on each feature

package main

import (
	"fmt"

	"github.com/Abiji-2020/minds-go-sdk/client"
	"github.com/Abiji-2020/minds-go-sdk/datasource"
)

func main() {
	// To initialize the client, you need to provide your API key and the base URL
	Client := client.NewClient("YOUR API KEY", " BASE URL")

	//Declare a datasource
	ds1 := datasource.DatabaseConfig{
		Name:        "datasource1",
		Engine:      "mysql",
		Description: "This is a test datasource",
		ConnectionData: map[string]string{
			"user":     "root",
			"password": "password",
			"host":     "localhost",
			"port":     "3306",
			"database": "test",
		},
		Tables: []string{"table1", "table2"},
	}

	// Create a new mind
	datas := []datasource.DatabaseConfig{ds1}
	mindName := "Test Mind"
	createdMind, err := Client.Minds.Create(mindName, datas)
	if err != nil {
		fmt.Println("Error creating mind: ", err)
	} else {
		fmt.Println("Mind created: ", createdMind)
	}
}

Features

  1. Minds Management

    • Fetch all minds
    • Get a specific mind by name
    • Add datasource to mind
    • Create, Update and delete minds
  2. Datasource Management

    • List all datasources
    • Get a datasource by name
    • Create, update and delete a datasource from minds.
  3. Completions API

    • Use natural language processing with chat completions.

Additional Information

This SDK is currently under active development. Contributions are welcome.

Note

For the future of the SDK , I have planned to add templates as a package of giving out all the Datasource templates in the Minds.

  • If found any issues report them, or add them in Issues tab
  • For any inquiries and feature requests, feel free to open a discussion or contact us.

License

This package is Licenced under the MIT LICENSE, see the LICENSE file for more details.

About

Minds Go SDK (unofficial) Developed to fasten the working of the Minds using Go Lang

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages