Skip to content

Release v1.0.0

Compare
Choose a tag to compare
@austin-denoble austin-denoble released this 06 Aug 15:57
· 31 commits to main since this release
1abbeab

Features

API Versioning

This first major release of the Pinecone Go SDK depends on API version 2024-07. This v1 SDK release line will continue to receive fixes as long as the 2024-07 API version is in support. Learn more about Pinecone API versioning here.

Configure Index

You can now configure an index using client.ConfigureIndex with the pinecone.ConfigureIndexParams struct. This can be used to adjust the Replicas or PodType of a pods-based index, or enabling or disabling deletion protection for all index types.

package main

import (
	"context"
	"github.com/pinecone-io/go-pinecone/pinecone"
	"log"
	"os"
)

func main() {
    ctx := context.Background()

    clientParams := pinecone.NewClientParams{
        ApiKey: os.Getenv("PINECONE_API_KEY"),
    }

    pc, err := pinecone.NewClient(clientParams)
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    } 

    // To scale the size of your pods-based index from "x2" to "x4":
    _, err := pc.ConfigureIndex(ctx, "my-pod-index", pinecone.ConfigureIndexParams{PodType: "p1.x4"})
    if err != nil {
	log.Fatalf("Failed to configure index: %v\n", err)
    }

    // To scale the number of replicas to 4:
    _, err := pc.ConfigureIndex(ctx, "my-pod-index", pinecone.ConfigureIndexParams{Replicas: 4})
    if err != nil {
	log.Fatalf("Failed to configure index: %v\n", err)
    }

Deletion Protection

Use deletion protection to prevent your most important indexes from accidentally being deleted. This feature is available for both serverless and pod indexes.

package main

import (
	"context"
	"github.com/pinecone-io/go-pinecone/pinecone"
	"log"
	"os"
)

func main() {
    ctx := context.Background()

    clientParams := pinecone.NewClientParams{
        ApiKey: os.Getenv("PINECONE_API_KEY"),
    }

    pc, err := pinecone.NewClient(clientParams)
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    }

    // create a new index with deletion protection enabled
    idx, err := pc.CreateServerlessIndex(ctx, &pinecone.CreateServerlessIndexRequest{
        Name:      "my-protected-index",
        Dimension: 3,
        Metric:    pinecone.Cosine,
        Cloud:     pinecone.Aws,
        Region:    "us-east-1",
        DeletionProtection: "enabled",
    })
    if err != nil {
        log.Fatalf("Failed to create index: %v\n", err)
    }

    // To enable deletion protection for an existing index
    _, err := pc.ConfigureIndex(ctx, "my-index", pinecone.ConfigureIndexParams{DeletionProtection: "enabled"})
    if err != nil {
        log.Fatalf("Failed to configure index: %v\n", err)
    }
}

For users of the unstable pre-v1.0.0 SDK: see the README for details on which operations and types have changed. At a high level:

  • pinecone.NewClient accepts additional configuration options through pinecone.NewClientParams.
  • Creating an IndexConnection when working with the data plane has been simplified to a single client.Index method which takes in a pinecone.NewIndexConnParams struct to configure the connection.
  • When working with an IndexConnection, types such as FetchVectorsResponse and QueryVectorsResponse will now contain the Namespace of the source index.

Changes Overview

New Contributors

Full Changelog: v0.5.0...v1.0.0