Skip to content

Release v2.1.0

Compare
Choose a tag to compare
@austin-denoble austin-denoble released this 21 Dec 07:06
· 3 commits to main since this release

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

Full Changelog: v2.0.0...v2.1.0