pinecone-io / go-pinecone

Pinecone.io Golang Client
Apache License 2.0
49 stars 9 forks source link

Reranker API implemention #73

Closed Stosan closed 1 month ago

Stosan commented 2 months ago

The docs has the rerank module but this is not available on the library

Describe the approach you took. Link to any relevant bugs, issues, docs, or other resources.

This PR inplements the rerank API into the pinecone library

austin-denoble commented 2 months ago

Hi @Stosan, thanks very much for opening this PR to support the Rerank API in the Go SDK. I have some feedback that would be helpful for getting this code ready to merge into the library.

All of the code in the codebase under /internal/gen/* is generated from OpenAPI and proto specification files. You can see at the top of the Go files the tag about not editing: https://github.com/pinecone-io/go-pinecone/blob/64f1d686e9c7748d227d1ea4e2980eaba7d7130c/internal/gen/control/control_plane.oas.go#L1

In order to properly support Rerank in the Go SDK, we need to regenerate the code under /internal/gen/ to align with upcoming API changes. I've done that here: https://github.com/pinecone-io/go-pinecone/pull/76. Would you be able to rebase and refactor the changes in this PR on top of the release-candidate/2024-10 branch? This branch should include all of the necessary changes to the generated code under /internal/gen/.

The generated types, functions, and methods should be exposed in the inference package under /internal/gen/inference/inference_2024-10.oas.go: https://github.com/pinecone-io/go-pinecone/blob/release-candidate/2024-10/internal/gen/inference/inference_2024-10.oas.go

For the code you've added in this PR the changes in client.go and client_test.go look great, really appreciate the attention to detail around doc comments and testing coverage. If you're able to rebase your changes onto the upcoming release-candidate/2024-10 branch that would be very appreciated. Please let me know if you have any questions, and thanks!

Stosan commented 1 month ago

All Austin, Will do this weekend.