Release v2.1.0
Features
Index Tags
You can now assign index tags when creating or configuring indexes. Tags are key-value pairs that you can use to categorize and identify the index.
package main
import (
"context"
"fmt"
"log"
"github.com/pinecone-io/go-pinecone/pinecone"
)
func main() {
ctx := context.Background()
pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "YOUR_API_KEY",
})
if err != nil {
log.Fatalf("Failed to create Client: %v", err)
}
// Create an index with Tags
idx, err := pc.CreateServerlessIndex(ctx, &pinecone.CreateServerlessIndexRequest{
Name: "my-tagged-index",
Dimension: 3,
Metric: pinecone.Cosine,
Cloud: pinecone.Aws,
Region: "us-east-1",
Tags: &pinecone.IndexTags{ "environment": "development" },
})
if err != nil {
log.Fatalf("Failed to create index: %v", err)
}
// Update an index's Tags with ConfigureIndex
idx, err = pc.ConfigureIndex(context.Background(),
ts.idxName,
pinecone.ConfigureIndexParams{Tags: IndexTags{"environment": "production"}})
if err != nil {
log.Fatalf("Failed to configure index: %v", err)
}
}
What's Changed
- Implement
IndexTags
by @austin-denoble in #88 - Update
ConfigureIndex
to merge new and previousIndexTags
, updateREADME
examples by @austin-denoble in #89
Full Changelog: v2.0.0...v2.1.0