Releases: pinecone-io/go-pinecone
v0.5.0
Features
- Optional configuration values for applying custom headers or metadata for REST or gRPC operations by @austin-denoble in #18
- Configure
apiKey
,additionalHeaders
, andhost
through environment variables by @austin-denoble in #22 - Add error handling to REST operations in
Client
, add newPineconeError
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 inIndexConnection
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
- @austin-denoble made their first contribution in #20
Full Changelog: v0.4.1...v0.5.0
v0.5-alpha.0
What's Changed
Full Changelog: v0.4.1...v0.5-alpha.0
v0.4.1
What's Changed
- Adds optional source_tag to User-Agent by @ssmith-pc in #16
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
- @ssmith-pc made their first contribution in #16
Full Changelog: v0.4.0...v0.4.1
v0.4.0
v0.3.0 Release
This switches the GRPC bindings to use the vector_service.proto API instead of the now-deprecated core.proto API.
v0.2.3 Release
add storage protos
v0.2.2 Release
update
v0.2.1 Release
update core proto
v0.2.0
This release adds support for multi-namespace queries.
v0.1.5
remove extraneous print