- Go 1.17 or higher
- Use
go get
to install the latest version of the TencentCloud VectorDB Go SDK and dependencies:
go get -u github.com/tencent/vectordatabase-sdk-go/tcvectordb
- Create New VectorDB Client To Start:
import "github.com/tencent/vectordatabase-sdk-go/tcvectordb"
cli, err := tcvectordb.NewRpcClient("vdb http url or ip and post", "root", "key get from web console", &tcvectordb.ClientOption{
ReadConsistency: tcvectordb.EventualConsistency,
MaxIdldConnPerHost: 10,
IdleConnTimeout: time.Second * 10,
})
if err != nil {
// handle err
}
defer cli.Close()
db, err := cli.CreateDatabase(context.Background(), "DATABASE NAME")
See example about how to use this package to communicate with TencentCloud VectorDB