Release v1.0.0
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 throughpinecone.NewClientParams
.- Creating an
IndexConnection
when working with the data plane has been simplified to a singleclient.Index
method which takes in apinecone.NewIndexConnParams
struct to configure the connection. - When working with an
IndexConnection
, types such asFetchVectorsResponse
andQueryVectorsResponse
will now contain theNamespace
of the source index.
Changes Overview
- update Go documentation link by @junefish in #29
- Update codegen dependencies to fixed versions by @aulorbe in #32
- Add docstrings for index_connection.go by @aulorbe in #31
- Add docstrings for client.go by @aulorbe in #27
- Allow configuration of
gRPC.ClientConn
throughgrpc.DialOption
, refactorClient.Index()
, bumpgrpc
dep to 1.64.0 by @austin-denoble in #35 - Add ConfigureIndex method by @aulorbe in #34
- Add docstrings to models.go by @aulorbe in #37
- Rename Filter to MetadataFilter for clarity by @aulorbe in #39
- Add Reference documentation status badge by @rockwotj in #40
- Add unit tests for index_connection.go by @aulorbe in #38
- Add unit tests for client.go by @aulorbe in #36
- Add
codegen/build-clients.sh
script, updatecodegen/apis
submodule by @austin-denoble in #49 - Centralize Go test suite by @aulorbe in #48
- Implement support for
DeletionProtection
by @austin-denoble in #50 - Add
Namespace
to List, Query, and Fetch vector responses by @austin-denoble in #52 - Update README by @aulorbe in #51
- Update issue templates by @anawishnoff in #54
- Block blank issues without templates by @anawishnoff in #53
- Add error handling for missing required fields in passed structs by @aulorbe in #55
- Add
Host
normalization when buildingIndexConnection
by @austin-denoble in #56 - Auto-adding needs-triage label to all new issues by @anawishnoff in #57
New Contributors
- @junefish made their first contribution in #29
- @aulorbe made their first contribution in #32
- @rockwotj made their first contribution in #40
- @anawishnoff made their first contribution in #54
Full Changelog: v0.5.0...v1.0.0