ScotterC/pinecone

MIssing GET /vectors/list endpoint

xzdshr opened this issue · 3 comments

Are you planning/already working on a missing list endpoint? https://docs.pinecone.io/guides/data/list-record-ids
Or do you need a hand with this?

Monkey patch example for reference:

# /config/initializers/pinecone.rb

#
# Monkey patch to add not implemented #list method to vectors (Pinecone::Vector)
# https://docs.pinecone.io/reference/api/data-plane/list
#
module Pinecone
  module ListEndpoint
    def list(prefix: '', limit: nil, pagination_token: nil, namespace: '')
      query_string = URI.encode_www_form({ prefix:, limit:, paginationToken: pagination_token, namespace: } )
      self.class.get("#{@base_uri}/vectors/list?#{query_string}", options)
    end
  end
end

Pinecone::Vector.prepend Pinecone::ListEndpoint

@xzdshr Thanks for the heads up. For a long while this endpoint wasn't available so it escaped my notice. It looks like it only works for serverless indexes.

Would you like to take a crack at the PR?

@ScotterC Sure, why not