Skip to content

Releases: pinecone-io/go-pinecone

Release v1.1.1

18 Sep 16:55
Compare
Choose a tag to compare

Fixes

Chores

  • [Docs] Return error for serverless index creation failure by @jseldess in #71
  • [Chore] Refactor sparse vector integration tests by @austin-denoble in #72

Full Changelog: v1.1.0...v1.1.1

Release v1.1.0

23 Aug 22:12
Compare
Choose a tag to compare

Features

Inference API

You can now try out Pinecone's Inference API, which is currently in public preview. See the README for more details.

ctx := context.Background()

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

embeddingModel := "multilingual-e5-large"
documents := []string{
   "Turkey is a classic meat to eat at American Thanksgiving."
   "Many people enjoy the beautiful mosques in Turkey."
}
docParameters := pinecone.EmbedParameters{
   InputType: "passage",
   Truncate: "END",
}

docEmbeddingsResponse, err := pc.Inference.Embed(ctx, &pinecone.EmbedRequest{
   Model: embeddingModel,
   TextInputs: documents,
   Parameters: docParameters,
})
if err != nil {
   log.Fatalf("Failed to embed documents: %v", err)
}
fmt.Printf("docs embedding response: %+v", docEmbeddingsResponse)

// << Upsert documents into Pinecone >>

Changes overview

New Contributors

Full Changelog: v1.0.0...v1.1.0

Release v1.0.0

06 Aug 15:57
1abbeab
Compare
Choose a tag to compare

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

v0.5.0

08 Jun 19:59
257e9f6
Compare
Choose a tag to compare

Features

  • Optional configuration values for applying custom headers or metadata for REST or gRPC operations by @austin-denoble in #18
  • Configure apiKey, additionalHeaders, and host through environment variables by @austin-denoble in #22
  • Add error handling to REST operations in Client, add new PineconeError struct by @austin-denoble in #23

Additional Client Configuration options

You can now pass your own http.Client directly through NewClientParams with RestClient, along with setting Headers, and Host values. You can also pass metadata to the underlying gRPC client when creating an IndexConnection by using IndexWithAdditionalMetadata().

import (
"context"

"github.com/pinecone-io/go-pinecone/pinecone"
)

apiKey := "your-api-key"
headers := map[string]string{"X-Your-Header": "header-value"}
client, err := NewClient(NewClientParams{ApiKey: apiKey, Headers: headers})
if err != nil {
  return nil, err
}

// perform client operations
index := client.DescribeIndex(context.Background(), "my-index")

// create an IndexConnection with metadata
metadata := map[string]string{"X-Your-Header": "header-value"}
indexConn := client.IndexWithAdditionalMetadata(index.Host, "my-namespace", metadata)

// perform index operations
indexStats := indexConn.DescribeIndexStats(context.Background())

You can also use environment variables to set ApiKey, Headers, and Host:

  • PINECONE_API_KEY
  • PINECONE_ADDITIONAL_HEADERS
  • PINECONE_CONTROLLER_HOST

Values provided through the environment will be overwritten if you also pass them in NewClientParams to NewClient.

Fixes

  • Receive and pass context.Context by value rather than as a pointer in IndexConnection methods by @austin-denoble in #20

Chores

  • Add json marshaling annotations to various structs by @austin-denoble in #21
  • Bump getPackageVersion() to v0.5.0, and allow : in source tag normalization by @austin-denoble in #24

New Contributors

Full Changelog: v0.4.1...v0.5.0

v0.5-alpha.0

09 Apr 19:18
22cce8b
Compare
Choose a tag to compare
v0.5-alpha.0 Pre-release
Pre-release

What's Changed

  • Management Plane Alpha: Project and API Key Management by @haruska in #15

Full Changelog: v0.4.1...v0.5-alpha.0

v0.4.1

27 Mar 19:06
017d0a4
Compare
Choose a tag to compare

What's Changed

Source tag

The SDK now optionally allows setting a source tag when constructing a Pinecone client. The source tag allows requests to be associated with the source tag provided.

import "github.com/pinecone-io/go-pinecone/pinecone"

client, err := pinecone.NewClient(pinecone.NewClientParams{
	ApiKey: "my-api-key",
	SourceTag: "foo",
})

// requests initiated from client connection are associated with source tag "foo"

New Contributors

Full Changelog: v0.4.0...v0.4.1

v0.4.0

15 Mar 14:40
Compare
Choose a tag to compare

This release is a re-write on the Pinecone GoSDK. The SDK now supports all current actions against the Pinecone APIs. See the README for details on installation and usage.

v0.3.0 Release

16 Dec 14:56
d3170b1
Compare
Choose a tag to compare

This switches the GRPC bindings to use the vector_service.proto API instead of the now-deprecated core.proto API.

v0.2.3 Release

13 Aug 18:12
Compare
Choose a tag to compare
add storage protos

v0.2.2 Release

13 Aug 16:06
Compare
Choose a tag to compare