Pinecone.NET icon indicating copy to clipboard operation
Pinecone.NET copied to clipboard

Serverless support

Open etynosa opened this issue 1 year ago • 3 comments

When attempting to retrieve the index using the GetIndex method by providing the indexName of a serverless index, an HttpRequestException is encountered. The exception message is as follows: System.Net.Http.HttpRequestException: 'Response status code does not indicate success: 404 (Not Found).'

Steps to Reproduce: Call the GetIndex method on a serverless index using the corresponding indexName. Observe the raised HttpRequestException with the mentioned status code (404).

etynosa avatar Jan 24 '24 15:01 etynosa

Right, I was expecting something like this happening sooner or later.

There seem to be other changes to the index management API ~~- will probably release a fix for this later today~~.

UPD: There are more API changes. Given serverless is a new feature, I'll need to see how to handle this as it seems there are now two API versions. Will get to this later when I have time.

neon-sunset avatar Jan 24 '24 15:01 neon-sunset

@neon-sunset Can you give us some info on how to build the project optimally? I can try pushing some draft version that you can improve later as some pre-release package.

AlexPlom avatar Jan 25 '24 15:01 AlexPlom

Hi @AlexPlom If you would like to contribute, a good place to start is to go through each request at https://docs.pinecone.io/reference (thankfully the API is still very simple) and see how it differs with the current model defined in this project. This is what I did for e.g. 1.4.0 release when noticing previous API changes. The caveat here is it seems Serverless API has more differences this time.

Unfortunately, it also appears that Pinecone have stopped serving OpenAPI spec file to their frontend which I'd probably use in this case given there are more changes this time, so the manual approach it is. Alternatively, you could look for the spec file in Pinecone's libraries but quick search did not turn up with anything useful. Because of these aspects and the fact that testing Serverless needs switching to paid plan if you already have pod-based index, I realized it will take more time than I'm willing to allocate to this project at this moment.

Overall, the reason this library exists in the first place is that manually writing it was a faster option to guarantee good and reliable client impl. that properly glues together REST control plane API and gRPC data one, and works well with C# - NSwag, Kiota and other client generators are terrible, produce AOT-incompatible code and pick bad containers for data where it matters.

To work with this project, you only need the latest .NET SDK and that's it. I'd be happy to review a PR and assist with getting it merged if you're interested.

Let me know if you have any questions.

neon-sunset avatar Jan 26 '24 00:01 neon-sunset

Serverless is now supported with the version 2.0: https://github.com/neon-sunset/Pinecone.NET/releases/tag/2.0.0

neon-sunset avatar May 18 '24 15:05 neon-sunset