Skip to content

Commit

Permalink
Finish ListVectors
Browse files Browse the repository at this point in the history
  • Loading branch information
aulorbe committed Jun 26, 2024
1 parent 4f33fa3 commit 2919e02
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pinecone/index_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ type ListVectorsResponse struct {
// ListVectors lists vectors in a Pinecone index. You can filter vectors by prefix,
// limit the number of vectors returned, and paginate through results.
//
// Returns a pointer to a ListVectorsResponse object and an error if the request fails.
// Note: ListVectors is only available for Serverless indexes.
//
// Returns a pointer to a ListVectorsResponse object or an error if the request fails.
//
// Parameters:
// - ctx: A context.Context object controls the request's lifetime,
Expand Down Expand Up @@ -295,10 +297,14 @@ type ListVectorsResponse struct {
// })
//
// if err != nil {
// fmt.Println("Error:", err)
// fmt.Printf("Failed to list vectors in index: %s. Error: %s\n", idx.Name, err)
// }
//
// fmt.Println(res)
// if len(res.VectorIds) == 0 {
// fmt.Println("No vectors found")
// } else {
// fmt.Printf("Found %d vector(s)\n", len(res.VectorIds))
// }
func (idx *IndexConnection) ListVectors(ctx context.Context, in *ListVectorsRequest) (*ListVectorsResponse, error) {
req := &data.ListRequest{
Prefix: in.Prefix,
Expand Down Expand Up @@ -355,7 +361,7 @@ type QueryVectorsResponse struct {

// QueryByVectorValues queries a Pinecone index for vectors that are most similar to a provided query vector.
//
// Returns a pointer to a QueryVectorsResponse object and an error if the request fails.
// Returns a pointer to a QueryVectorsResponse object or an error if the request fails.
//
// Parameters:
// - ctx: A context.Context object controls the request's lifetime,
Expand Down Expand Up @@ -738,7 +744,7 @@ type DescribeIndexStatsResponse struct {

// DescribeIndexStats returns statistics about a Pinecone index.
//
// Returns a pointer to a DescribeIndexStatsResponse object and an error if the request fails.
// Returns a pointer to a DescribeIndexStatsResponse object or an error if the request fails.
//
// Parameters:
// - ctx: A context.Context object controls the request's lifetime,
Expand Down Expand Up @@ -778,7 +784,7 @@ func (idx *IndexConnection) DescribeIndexStats(ctx context.Context) (*DescribeIn

// DescribeIndexStatsFiltered returns statistics about a Pinecone index, filtered by a given filter.
//
// Returns a pointer to a DescribeIndexStatsResponse object and an error if the request fails.
// Returns a pointer to a DescribeIndexStatsResponse object or an error if the request fails.
//
// Note: DescribeIndexStatsFiltered is only available on pods-based indexes.
//
Expand Down

0 comments on commit 2919e02

Please sign in to comment.