v2.1.0 Release
This version of the Pinecone .NET Client introduces the ClientOptions.IsTlsEnabled property which you are required to set to false if you want to test the Client against an HTTP endpoint.
Features
IsTlsEnabled
Parts of the Client dynamically retrieve API hostnames to interact with which default to using HTTPS. To have the Client default to using HTTP instead, you can set the ClientOptions.IsTlsEnabled to false.
Now you can use the Pinecone Client against a local HTTP URL:
using Pinecone;
var pinecone = new PineconeClient("PINECONE_API_KEY",
new ClientOptions
{
BaseUrl = "http://localhost:5080",
IsTlsEnabled = false
}
);
// Create serverless index
await pinecone.CreateIndexAsync(new CreateIndexRequest
{
Name = "serverless-index",
Dimension = 3,
Metric = CreateIndexRequestMetric.Cosine,
Spec = new ServerlessIndexSpec
{
Serverless = new ServerlessSpec
{
Cloud = ServerlessSpecCloud.Aws,
Region = "us-east-1",
}
},
DeletionProtection = DeletionProtection.Disabled
});
// Create pod index
await pinecone.CreateIndexAsync(new CreateIndexRequest
{
Name = "pod-index",
Dimension = 3,
Metric = CreateIndexRequestMetric.Cosine,
Spec = new PodIndexSpec
{
Pod = new PodSpec
{
Environment = "us-east-1-aws",
PodType = "p1.x1",
Pods = 1,
Replicas = 1,
Shards = 1,
}
},
DeletionProtection = DeletionProtection.Disabled
});
// Describe serverless index
await pinecone.DescribeIndexAsync("serverless-index");
// Describe pod index
await pinecone.DescribeIndexAsync("pod-index");
// Get index connection object for serverless-index
var serverlessIndexConnection = pinecone.Index("serverless-index");
// Get index connection object for pod-index
var podIndexConnection = pinecone.Index("pod-index");
// Upsert records into serverless index
await serverlessIndexConnection.UpsertAsync(new UpsertRequest()
{
Namespace = "v1",
Vectors = new List<Vector>
{
new Vector { Id = "1", Values = new ReadOnlyMemory<float>([1f, 2f, 3f]) }
}
});
// Upsert records into pod index
await podIndexConnection.UpsertAsync(new UpsertRequest()
{
Namespace = "v1",
Vectors = new List<Vector>
{
new Vector { Id = "1", Values = new ReadOnlyMemory<float>([1f, 2f, 3f]) }
}
});
// Query by vectorId from serverless index
await serverlessIndexConnection.QueryAsync(new QueryRequest
{
TopK = 10,
Id = "3",
Namespace = "v1",
});
// Query by vectorId from pod index
await podIndexConnection.QueryAsync(new QueryRequest
{
TopK = 10,
Id = "3",
Namespace = "v1",
});
// Delete serverless index
await pinecone.DeleteIndexAsync("serverless-index");
// Delete pod index
await pinecone.DeleteIndexAsync("pod-index");What's Changed
- feat: Add
IsTlsEnabledclient option by @fern-support in #35 - 🌿 Fern Regeneration -- December 4, 2024 by @fern-api in #36
Full Changelog: 2.0.0...2.1.0