Skip to content

Commit

Permalink
feat(pinecone) specify api version that supports rerank task in base …
Browse files Browse the repository at this point in the history
…client

pinecone is redirecting towards oldest stable version that does not support rerank endpoint
also recommended by pinecone in their documentation to specify api version in headers
  • Loading branch information
MubeenKodvavi committed Oct 29, 2024
1 parent dd8c27f commit 979bc0b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/component/data/pinecone/v0/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func newBaseClient(setup *structpb.Struct, logger *zap.Logger) *httpclient.Clien

c.SetHeader("Api-Key", getAPIKey(setup))
c.SetHeader("User-Agent", "source_tag=instillai")

// Currently, by default Pinecone API redirects request to OLDEST stable version i.e. 2024-04 right now and does not support Rerank
// It is recommended by Pinecone to specify API version to use: https://docs.pinecone.io/reference/api/versioning#specify-an-api-version
c.SetHeader("X-Pinecone-API-Version", "2024-10")

return c
}

Expand Down

0 comments on commit 979bc0b

Please sign in to comment.