From cce059cfd907050852e284e9138189356c481da3 Mon Sep 17 00:00:00 2001 From: Scott Carleton <313254+ScotterC@users.noreply.github.com> Date: Wed, 7 Aug 2024 14:39:02 -0400 Subject: [PATCH] Adding Listing all vectors functionality Cleaned up VCR cassettes --- Gemfile.lock | 1 + README.md | 7 + lib/pinecone/vector.rb | 13 +- lib/pinecone/vector/filter.rb | 2 +- lib/pinecone/vector/query.rb | 2 +- lib/pinecone/vector/sparse_vector.rb | 2 +- .../_index/allows_multiple_indices.yml | 28 +- .../returns_a_response.yml | 36 +- ...ponse_with_collection_creation_details.yml | 349 ++++++++++- .../returns_an_error_response.yml | 58 +- ...ponse_with_collection_deletion_details.yml | 257 +++++++- ...rns_a_response_with_collection_details.yml | 18 +- ...ns_a_response_with_list_of_collections.yml | 8 +- .../returns_a_200_that_it_s_been_updated.yml | 14 +- ...a_response_with_index_creation_details.yml | 18 +- .../returns_an_error_response.yml | 24 +- ...a_response_with_index_creation_details.yml | 31 +- .../returns_an_error_response.yml | 16 +- ...a_response_with_index_deletion_details.yml | 16 +- .../returns_a_response_with_index_details.yml | 16 +- ...eturns_a_response_with_list_of_indexes.yml | 12 +- .../returns_a_response.yml | 24 +- .../returns_a_response.yml | 24 +- .../returns_a_response.yml | 24 +- .../returns_a_successful_response.yml | 22 +- .../returns_a_succesful_response.yml | 24 +- .../returns_a_response.yml | 302 ++++++++- .../error_handling/handles_invalid_limit.yml | 530 ++++++++++++++++ .../handles_non-existent_namespace.yml | 399 ++++++++++++ .../handles_pagination.yml | 577 ++++++++++++++++++ .../respects_the_limit_parameter.yml | 487 +++++++++++++++ ...eturns_all_vector_IDs_in_the_namespace.yml | 443 ++++++++++++++ ...urns_vector_IDs_with_a_specific_prefix.yml | 399 ++++++++++++ .../missing_index/raises_an_exception.yml | 28 +- .../returns_a_response.yml | 498 ++++++++++++++- ...ns_a_response_when_queried_with_object.yml | 366 ++++++++++- .../with_filter/returns_a_response.yml | 117 ---- .../_query/with_filter/returns_a_response.yml | 447 ++++++++++++++ .../with_namespace/returns_a_response.yml | 100 +-- .../returns_a_response.yml | 64 +- .../returns_a_response.yml | 42 +- .../returns_a_response.yml | 40 +- spec/cassettes/clear_index.yml | 259 ++++++++ spec/cassettes/missing_index.yml | 8 +- ...{create_index.yml => use_server_index.yml} | 27 +- ...use_index.yml => use_serverless_index.yml} | 14 +- spec/pinecone/client_spec.rb | 24 +- spec/pinecone/collections_spec.rb | 26 +- spec/pinecone/index_spec.rb | 8 +- spec/pinecone/vector_spec.rb | 269 +++++--- spec/spec_helper.rb | 21 +- spec/support/setup.rb | 23 +- 52 files changed, 5977 insertions(+), 587 deletions(-) create mode 100644 spec/cassettes/Pinecone_Vector/_list/error_handling/handles_invalid_limit.yml create mode 100644 spec/cassettes/Pinecone_Vector/_list/error_handling/handles_non-existent_namespace.yml create mode 100644 spec/cassettes/Pinecone_Vector/_list/successful_response/handles_pagination.yml create mode 100644 spec/cassettes/Pinecone_Vector/_list/successful_response/respects_the_limit_parameter.yml create mode 100644 spec/cassettes/Pinecone_Vector/_list/successful_response/returns_all_vector_IDs_in_the_namespace.yml create mode 100644 spec/cassettes/Pinecone_Vector/_list/successful_response/returns_vector_IDs_with_a_specific_prefix.yml delete mode 100644 spec/cassettes/Pinecone_Vector/_query/successful_response/with_filter/returns_a_response.yml create mode 100644 spec/cassettes/Pinecone_Vector/_query/with_filter/returns_a_response.yml create mode 100644 spec/cassettes/clear_index.yml rename spec/cassettes/{create_index.yml => use_server_index.yml} (54%) rename spec/cassettes/{use_index.yml => use_serverless_index.yml} (64%) diff --git a/Gemfile.lock b/Gemfile.lock index bb9f4f7..173550a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -136,6 +136,7 @@ GEM PLATFORMS arm64-darwin-21 arm64-darwin-22 + arm64-darwin-23 x86_64-darwin-21 x86_64-linux diff --git a/README.md b/README.md index 2e9829f..3a4bb11 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,13 @@ index.describe_index_stats( ) ``` +List all vectors in an index. +```ruby +pinecone = Pinecone::Client.new +index = pinecone.index("example-index") +index.list(prefix: "document1#", namespace: "example-namespace") +``` + ### Filtering queries Add a `filter` option to apply filters to your query. You can use vector metadata to limit your search. See [metadata filtering](https://www.pinecone.io/docs/metadata-filtering/) in Pinecode documentation. diff --git a/lib/pinecone/vector.rb b/lib/pinecone/vector.rb index fc54d8c..6aae72a 100644 --- a/lib/pinecone/vector.rb +++ b/lib/pinecone/vector.rb @@ -26,7 +26,6 @@ def delete(namespace: "", ids: [], delete_all: false, filter: {}) deleteAll: delete_all, filter: filter } - inputs.delete(:filter) if delete_all || ids.any? payload = options.merge(body: inputs.to_json) self.class.post("#{@base_uri}/vectors/delete", payload) @@ -70,6 +69,18 @@ def describe_index_stats(filter: {}) self.class.post("#{@base_uri}/describe_index_stats", payload) end + def list(namespace: "", prefix: nil, limit: 100, pagination_token: nil) + query_params = { + namespace: namespace, + limit: limit + } + query_params[:prefix] = prefix if prefix + query_params[:paginationToken] = pagination_token if pagination_token + + query_string = URI.encode_www_form(query_params) + self.class.get("#{@base_uri}/vectors/list?#{query_string}", options) + end + def options { headers: @headers diff --git a/lib/pinecone/vector/filter.rb b/lib/pinecone/vector/filter.rb index ef738f5..5e48c90 100644 --- a/lib/pinecone/vector/filter.rb +++ b/lib/pinecone/vector/filter.rb @@ -57,7 +57,7 @@ def to_filter(input) def self.new(input) validation = FilterContract.new.call(input) if validation.success? - super(input) + super else raise ArgumentError.new(validation.errors.to_h.inspect) end diff --git a/lib/pinecone/vector/query.rb b/lib/pinecone/vector/query.rb index 104ba5b..d6cb21f 100644 --- a/lib/pinecone/vector/query.rb +++ b/lib/pinecone/vector/query.rb @@ -44,7 +44,7 @@ class QueryContract < Dry::Validation::Contract def self.new(input) validation = QueryContract.new.call(input) if validation.success? - super(input) + super else raise ArgumentError.new(validation.errors.to_h.inspect) end diff --git a/lib/pinecone/vector/sparse_vector.rb b/lib/pinecone/vector/sparse_vector.rb index 43ce89a..1e284cb 100644 --- a/lib/pinecone/vector/sparse_vector.rb +++ b/lib/pinecone/vector/sparse_vector.rb @@ -30,7 +30,7 @@ class SparseVectorContract < Dry::Validation::Contract def self.new(input) validation = SparseVectorContract.new.call(input) if validation.success? - super(input) + super else raise ArgumentError.new(validation.errors.to_h.inspect) end diff --git a/spec/cassettes/Pinecone_Client/_index/allows_multiple_indices.yml b/spec/cassettes/Pinecone_Client/_index/allows_multiple_indices.yml index 08aa786..539df1d 100644 --- a/spec/cassettes/Pinecone_Client/_index/allows_multiple_indices.yml +++ b/spec/cassettes/Pinecone_Client/_index/allows_multiple_indices.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.pinecone.io/indexes/example-index-1 + uri: https://api.pinecone.io/indexes/serverless-index body: encoding: US-ASCII string: '' @@ -30,25 +30,27 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - b99a9832922308350296cf16819e88ba + - 8e7e51464ed5d6233d89a2440b48c8d1 Date: - - Mon, 29 Jan 2024 16:11:03 GMT + - Wed, 07 Aug 2024 18:26:42 GMT Server: - Google Frontend Content-Length: - - '262' + - '227' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"name":"example-index-1","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"example-index-1-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:03 GMT + string: '{"name":"serverless-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io","spec":{"serverless":{"region":"us-east-1","cloud":"aws"}}}' + recorded_at: Wed, 07 Aug 2024 18:26:42 GMT - request: method: get - uri: https://api.pinecone.io/indexes/example-index-2 + uri: https://api.pinecone.io/indexes/server-index body: encoding: US-ASCII string: '' @@ -76,20 +78,22 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - abe3f59322f5acfb635964489d26fddc + - bc01cb6d4e09ba8d7a384e455fa703aa Date: - - Mon, 29 Jan 2024 16:11:03 GMT + - Wed, 07 Aug 2024 18:26:42 GMT Server: - Google Frontend Content-Length: - - '262' + - '256' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"name":"example-index-2","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"example-index-2-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:03 GMT + string: '{"name":"server-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"server-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":2,"shards":1,"pods":2,"pod_type":"p1.x1","environment":""}}}' + recorded_at: Wed, 07 Aug 2024 18:26:42 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Client/_upsert/successfull_response/returns_a_response.yml b/spec/cassettes/Pinecone_Client/_upsert/successfull_response/returns_a_response.yml index 51771be..1e08ca0 100644 --- a/spec/cassettes/Pinecone_Client/_upsert/successfull_response/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Client/_upsert/successfull_response/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.pinecone.io/indexes/example-index-1 + uri: https://api.pinecone.io/indexes/serverless-index body: encoding: US-ASCII string: '' @@ -30,25 +30,27 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - f1bbe80974c19f82d0647cfa1a8b96a0 + - a2439341d4c033d2a461525e710595e3 Date: - - Mon, 29 Jan 2024 16:11:03 GMT + - Wed, 07 Aug 2024 18:26:43 GMT Server: - Google Frontend Content-Length: - - '262' + - '227' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"name":"example-index-1","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"example-index-1-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:03 GMT + string: '{"name":"serverless-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io","spec":{"serverless":{"region":"us-east-1","cloud":"aws"}}}' + recorded_at: Wed, 07 Aug 2024 18:26:43 GMT - request: method: post - uri: https://example-index-1-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1"}]}' @@ -68,20 +70,28 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:26:43 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:04 GMT + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '34' + X-Pinecone-Request-Id: + - '2804607355677476942' X-Envoy-Upstream-Service-Time: - - '470' + - '34' Grpc-Status: - '0' - Content-Length: - - '19' Server: - envoy body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:04 GMT + recorded_at: Wed, 07 Aug 2024 18:26:43 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Collection/_create/successful_response/returns_a_response_with_collection_creation_details.yml b/spec/cassettes/Pinecone_Collection/_create/successful_response/returns_a_response_with_collection_creation_details.yml index 37a62b5..0d542a6 100644 --- a/spec/cassettes/Pinecone_Collection/_create/successful_response/returns_a_response_with_collection_creation_details.yml +++ b/spec/cassettes/Pinecone_Collection/_create/successful_response/returns_a_response_with_collection_creation_details.yml @@ -5,7 +5,7 @@ http_interactions: uri: https://api.pinecone.io/collections body: encoding: UTF-8 - string: '{"name":"test-collection","source":"example-index-2"}' + string: '{"name":"test-collection","source":"server-index"}' headers: Content-Type: - application/json @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 529e8f9f0b72d953582a453aac8c8773 + - 292117c650e1b742b560f117cfc74a66 Date: - - Mon, 29 Jan 2024 16:11:05 GMT + - Wed, 07 Aug 2024 18:33:53 GMT Server: - Google Frontend Content-Length: @@ -44,6 +46,343 @@ http_interactions: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"name":"test-collection","status":"Initializing","dimension":3,"environment":""}' - recorded_at: Mon, 29 Jan 2024 16:11:05 GMT + string: '{"name":"test-collection","status":"Initializing","environment":"","dimension":3}' + recorded_at: Wed, 07 Aug 2024 18:33:53 GMT +- request: + method: delete + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 202 + message: Accepted + headers: + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 2614dbe7b785e3ac39578205dbc58f69 + Date: + - Wed, 07 Aug 2024 18:33:53 GMT + Content-Type: + - text/html + Server: + - Google Frontend + Content-Length: + - '0' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '' + recorded_at: Wed, 07 Aug 2024 18:33:53 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 95ea6a09f07df8b453f56dee507cea0d + Date: + - Wed, 07 Aug 2024 18:33:53 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:33:53 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 4e6656aa42d6463649f1466afda021ac + Date: + - Wed, 07 Aug 2024 18:33:54 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:33:54 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 06c1fc50327451df70dbb3e80da047ae + Date: + - Wed, 07 Aug 2024 18:33:55 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:33:55 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 5eec12504d2022de011c5176240b69c7 + Date: + - Wed, 07 Aug 2024 18:33:55 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:33:55 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - dbf9cc0a8c9f6c71804c1fcb67ba7320 + Date: + - Wed, 07 Aug 2024 18:33:56 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:33:56 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Content-Type: + - text/plain; charset=utf-8 + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 5ab71e3f87b63787287dfb85f5f6ecb0 + Date: + - Wed, 07 Aug 2024 18:33:57 GMT + Server: + - Google Frontend + Content-Length: + - '90' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"error":{"code":"NOT_FOUND","message":"Resource test-collection not + found"},"status":404}' + recorded_at: Wed, 07 Aug 2024 18:33:57 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Collection/_create/unsuccessful_response/returns_an_error_response.yml b/spec/cassettes/Pinecone_Collection/_create/unsuccessful_response/returns_an_error_response.yml index d231981..69ab616 100644 --- a/spec/cassettes/Pinecone_Collection/_create/unsuccessful_response/returns_an_error_response.yml +++ b/spec/cassettes/Pinecone_Collection/_create/unsuccessful_response/returns_an_error_response.yml @@ -5,7 +5,55 @@ http_interactions: uri: https://api.pinecone.io/collections body: encoding: UTF-8 - string: '{"name":"test-collection","source":"example-index-2"}' + string: '{"name":"test-collection","source":"server-index"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 201 + message: Created + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 80f605e23b07249733096fcaf0bb86b6 + Date: + - Wed, 07 Aug 2024 18:33:57 GMT + Server: + - Google Frontend + Content-Length: + - '93' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Initializing","environment":"","dimension":3}' + recorded_at: Wed, 07 Aug 2024 18:33:57 GMT +- request: + method: post + uri: https://api.pinecone.io/collections + body: + encoding: UTF-8 + string: '{"name":"test-collection","source":"server-index"}' headers: Content-Type: - application/json @@ -30,10 +78,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - d0ebc71c20267f1e363997a57024d2b3 + - 8480f878bdf890046821aab6656c88f7 Date: - - Mon, 29 Jan 2024 16:11:05 GMT + - Wed, 07 Aug 2024 18:33:58 GMT Server: - Google Frontend Content-Length: @@ -45,5 +95,5 @@ http_interactions: body: encoding: UTF-8 string: '{"error":{"code":"ALREADY_EXISTS","message":"Resource already exists"},"status":409}' - recorded_at: Mon, 29 Jan 2024 16:11:05 GMT + recorded_at: Wed, 07 Aug 2024 18:33:58 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Collection/_delete/successful_response/returns_a_response_with_collection_deletion_details.yml b/spec/cassettes/Pinecone_Collection/_delete/successful_response/returns_a_response_with_collection_deletion_details.yml index 7218f29..4eb0029 100644 --- a/spec/cassettes/Pinecone_Collection/_delete/successful_response/returns_a_response_with_collection_deletion_details.yml +++ b/spec/cassettes/Pinecone_Collection/_delete/successful_response/returns_a_response_with_collection_deletion_details.yml @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 9c21a0ceff2e8bda6517e3a76f27937d + - 4c0923917adea60f099152b090484ff0 Date: - - Mon, 29 Jan 2024 16:11:06 GMT + - Wed, 07 Aug 2024 18:33:58 GMT Server: - Google Frontend Content-Length: @@ -46,7 +48,7 @@ http_interactions: encoding: UTF-8 string: 'Failed to deserialize the JSON body into the target type: missing field `source` at line 1 column 62' - recorded_at: Mon, 29 Jan 2024 16:11:06 GMT + recorded_at: Wed, 07 Aug 2024 18:33:58 GMT - request: method: delete uri: https://api.pinecone.io/collections/test-collection @@ -75,10 +77,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 6d8c2e03d323b393bef118a0cb202ac6 + - 871b1bb7f321ce0e3a31f93c5047a93d Date: - - Mon, 29 Jan 2024 16:11:06 GMT + - Wed, 07 Aug 2024 18:33:59 GMT Content-Type: - text/html Server: @@ -92,5 +96,246 @@ http_interactions: body: encoding: UTF-8 string: '' - recorded_at: Mon, 29 Jan 2024 16:11:06 GMT + recorded_at: Wed, 07 Aug 2024 18:33:59 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 3c676df24a1ce4c61afdc595f912d6dd + Date: + - Wed, 07 Aug 2024 18:33:59 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:33:59 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 2ef9086d6e3b45aad592d4d59d32e2a1 + Date: + - Wed, 07 Aug 2024 18:33:59 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:33:59 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 749ae6f4906dc0421dbd85fc856ddb51 + Date: + - Wed, 07 Aug 2024 18:34:00 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:34:00 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - fb86c39a4469d679bc698197da5e1f38 + Date: + - Wed, 07 Aug 2024 18:34:01 GMT + Server: + - Google Frontend + Content-Length: + - '78' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"test-collection","status":"Terminating","environment":""}' + recorded_at: Wed, 07 Aug 2024 18:34:01 GMT +- request: + method: get + uri: https://api.pinecone.io/collections/test-collection + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Content-Type: + - text/plain; charset=utf-8 + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 6b3300434bff21809e648fca4ae50a71 + Date: + - Wed, 07 Aug 2024 18:34:01 GMT + Server: + - Google Frontend + Content-Length: + - '90' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"error":{"code":"NOT_FOUND","message":"Resource test-collection not + found"},"status":404}' + recorded_at: Wed, 07 Aug 2024 18:34:01 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Collection/_describe/successful_response/returns_a_response_with_collection_details.yml b/spec/cassettes/Pinecone_Collection/_describe/successful_response/returns_a_response_with_collection_details.yml index 5da6490..1418ed0 100644 --- a/spec/cassettes/Pinecone_Collection/_describe/successful_response/returns_a_response_with_collection_details.yml +++ b/spec/cassettes/Pinecone_Collection/_describe/successful_response/returns_a_response_with_collection_details.yml @@ -5,7 +5,7 @@ http_interactions: uri: https://api.pinecone.io/collections body: encoding: UTF-8 - string: '{"name":"test-collection","source":"example-index-2"}' + string: '{"name":"test-collection","source":"server-index"}' headers: Content-Type: - application/json @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 4472ac2194f657615fa60a2626c3aeed + - 2757e8939f721ebff6ed1c5ccbf55a5b Date: - - Mon, 29 Jan 2024 16:11:05 GMT + - Wed, 07 Aug 2024 18:33:58 GMT Server: - Google Frontend Content-Length: @@ -45,7 +47,7 @@ http_interactions: body: encoding: UTF-8 string: '{"error":{"code":"ALREADY_EXISTS","message":"Resource already exists"},"status":409}' - recorded_at: Mon, 29 Jan 2024 16:11:05 GMT + recorded_at: Wed, 07 Aug 2024 18:33:58 GMT - request: method: get uri: https://api.pinecone.io/collections/test-collection @@ -76,10 +78,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 4aaf85c45f1931bf56c8f90db9498da2 + - c19830c2064b47114970fabc7f95c3b6 Date: - - Mon, 29 Jan 2024 16:11:05 GMT + - Wed, 07 Aug 2024 18:33:58 GMT Server: - Google Frontend Content-Length: @@ -91,5 +95,5 @@ http_interactions: body: encoding: UTF-8 string: '{"name":"test-collection","status":"Initializing","environment":""}' - recorded_at: Mon, 29 Jan 2024 16:11:05 GMT + recorded_at: Wed, 07 Aug 2024 18:33:58 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Collection/_list/returns_a_response_with_list_of_collections.yml b/spec/cassettes/Pinecone_Collection/_list/returns_a_response_with_list_of_collections.yml index fc34b71..1957208 100644 --- a/spec/cassettes/Pinecone_Collection/_list/returns_a_response_with_list_of_collections.yml +++ b/spec/cassettes/Pinecone_Collection/_list/returns_a_response_with_list_of_collections.yml @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 5f365bc4160b52f6be27ff61d3c42296 + - a1c44984288c7dc481e36f0c9cdd1f44 Date: - - Mon, 29 Jan 2024 16:11:05 GMT + - Wed, 07 Aug 2024 18:33:53 GMT Server: - Google Frontend Content-Length: @@ -45,5 +47,5 @@ http_interactions: body: encoding: UTF-8 string: '{"collections":[]}' - recorded_at: Mon, 29 Jan 2024 16:11:05 GMT + recorded_at: Wed, 07 Aug 2024 18:33:53 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_configure_index/successful_response/returns_a_200_that_it_s_been_updated.yml b/spec/cassettes/Pinecone_Index/_configure_index/successful_response/returns_a_200_that_it_s_been_updated.yml index 7c825eb..10a1c5f 100644 --- a/spec/cassettes/Pinecone_Index/_configure_index/successful_response/returns_a_200_that_it_s_been_updated.yml +++ b/spec/cassettes/Pinecone_Index/_configure_index/successful_response/returns_a_200_that_it_s_been_updated.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: patch - uri: https://api.pinecone.io/indexes/example-index-2 + uri: https://api.pinecone.io/indexes/server-index body: encoding: UTF-8 string: '{"spec":{"pod":{"replicas":2}}}' @@ -30,20 +30,22 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 837f40d8583fc1088f6d4254119bd238 + - a0f1996a4f25ab273d7a59a4cbf05be5 Date: - - Mon, 29 Jan 2024 16:11:10 GMT + - Wed, 07 Aug 2024 18:26:50 GMT Server: - Google Frontend Content-Length: - - '257' + - '251' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"name":"example-index-2","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"example-index-2-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":2,"shards":1,"pods":2,"pod_type":"","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:10 GMT + string: '{"name":"server-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"server-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":2,"shards":1,"pods":2,"pod_type":"","environment":""}}}' + recorded_at: Wed, 07 Aug 2024 18:26:50 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_create/pod_based/successful_response/returns_a_response_with_index_creation_details.yml b/spec/cassettes/Pinecone_Index/_create/pod_based/successful_response/returns_a_response_with_index_creation_details.yml index ce0c434..7b8a47a 100644 --- a/spec/cassettes/Pinecone_Index/_create/pod_based/successful_response/returns_a_response_with_index_creation_details.yml +++ b/spec/cassettes/Pinecone_Index/_create/pod_based/successful_response/returns_a_response_with_index_creation_details.yml @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - e365f4b418d3a76a6da7d0f6353d8ecf + - 69b78b09986f062bb234440a48497b6b Date: - - Mon, 29 Jan 2024 16:11:08 GMT + - Wed, 07 Aug 2024 18:26:47 GMT Server: - Google Frontend Content-Length: @@ -45,7 +47,7 @@ http_interactions: body: encoding: UTF-8 string: '{"error":{"code":"NOT_FOUND","message":"Resource test-index not found"},"status":404}' - recorded_at: Mon, 29 Jan 2024 16:11:08 GMT + recorded_at: Wed, 07 Aug 2024 18:26:47 GMT - request: method: post uri: https://api.pinecone.io/indexes @@ -70,16 +72,20 @@ http_interactions: headers: Content-Type: - application/json + X-Pinecone-Operation-Id: + - 075f5b9c-64f4-473e-a7e6-49d0b1355d71 Access-Control-Allow-Origin: - "*" Vary: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - b2331ad2c7cb2e981a4fa02f3f6a72e2 + - e3e30b65af5abec72c4677b388f55c9c Date: - - Mon, 29 Jan 2024 16:11:08 GMT + - Wed, 07 Aug 2024 18:26:48 GMT Server: - Google Frontend Content-Length: @@ -91,5 +97,5 @@ http_interactions: body: encoding: UTF-8 string: '{"name":"test-index","metric":"dotproduct","dimension":3,"status":{"ready":false,"state":"Initializing"},"host":"test-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:08 GMT + recorded_at: Wed, 07 Aug 2024 18:26:48 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_create/pod_based/unsuccessful_response/returns_an_error_response.yml b/spec/cassettes/Pinecone_Index/_create/pod_based/unsuccessful_response/returns_an_error_response.yml index ae1db39..53e934a 100644 --- a/spec/cassettes/Pinecone_Index/_create/pod_based/unsuccessful_response/returns_an_error_response.yml +++ b/spec/cassettes/Pinecone_Index/_create/pod_based/unsuccessful_response/returns_an_error_response.yml @@ -28,10 +28,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - ba53318f09574c92dc5614faf4235ea6 + - 800e5ad46655ccd62ec6d93bd297c4a5 Date: - - Mon, 29 Jan 2024 16:11:09 GMT + - Wed, 07 Aug 2024 18:26:48 GMT Content-Type: - text/html Server: @@ -45,7 +47,7 @@ http_interactions: body: encoding: UTF-8 string: '' - recorded_at: Mon, 29 Jan 2024 16:11:09 GMT + recorded_at: Wed, 07 Aug 2024 18:26:48 GMT - request: method: get uri: https://api.pinecone.io/indexes/test-index @@ -76,10 +78,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 3c95d77a6c8649db143ebb23a3bc1bd9 + - 28bf0a91e9f1b538c8939d0a724bd3de Date: - - Mon, 29 Jan 2024 16:11:09 GMT + - Wed, 07 Aug 2024 18:26:48 GMT Server: - Google Frontend Content-Length: @@ -91,7 +95,7 @@ http_interactions: body: encoding: UTF-8 string: '{"name":"test-index","metric":"dotproduct","dimension":3,"status":{"ready":false,"state":"Terminating"},"host":"test-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:09 GMT + recorded_at: Wed, 07 Aug 2024 18:26:48 GMT - request: method: post uri: https://api.pinecone.io/indexes @@ -122,10 +126,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - e5f57e6cdcd435d24a76df6e7b4a71c3 + - 26c5d4a116c520b50b13e88d410198a3 Date: - - Mon, 29 Jan 2024 16:11:09 GMT + - Wed, 07 Aug 2024 18:26:48 GMT Server: - Google Frontend Content-Length: @@ -137,5 +143,5 @@ http_interactions: body: encoding: UTF-8 string: '{"error":{"code":"ALREADY_EXISTS","message":"Resource already exists"},"status":409}' - recorded_at: Mon, 29 Jan 2024 16:11:09 GMT + recorded_at: Wed, 07 Aug 2024 18:26:48 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_create/serverless/successful_response/returns_a_response_with_index_creation_details.yml b/spec/cassettes/Pinecone_Index/_create/serverless/successful_response/returns_a_response_with_index_creation_details.yml index dcb0527..a8427ab 100644 --- a/spec/cassettes/Pinecone_Index/_create/serverless/successful_response/returns_a_response_with_index_creation_details.yml +++ b/spec/cassettes/Pinecone_Index/_create/serverless/successful_response/returns_a_response_with_index_creation_details.yml @@ -19,34 +19,35 @@ http_interactions: - Ruby response: status: - code: 404 - message: Not Found + code: 202 + message: Accepted headers: - Content-Type: - - text/plain; charset=utf-8 Access-Control-Allow-Origin: - "*" Vary: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 2de0b655129807b647c4004f7e09131d + - a1e7974c34caa3ebab79b53904eeec34 Date: - - Mon, 29 Jan 2024 16:11:06 GMT + - Wed, 07 Aug 2024 18:26:46 GMT + Content-Type: + - text/html Server: - Google Frontend Content-Length: - - '96' + - '0' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"error":{"code":"NOT_FOUND","message":"Resource test-index-serverless - not found"},"status":404}' - recorded_at: Mon, 29 Jan 2024 16:11:06 GMT + string: '' + recorded_at: Wed, 07 Aug 2024 18:26:46 GMT - request: method: post uri: https://api.pinecone.io/indexes @@ -71,16 +72,20 @@ http_interactions: headers: Content-Type: - application/json + X-Pinecone-Operation-Id: + - 51e13ea0-b499-4193-9481-319def93e5b6 Access-Control-Allow-Origin: - "*" Vary: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 03e1012638513548aa7255399b8cee5e + - 1c93dad4714ccae56ef5d2f1eb460bd5 Date: - - Mon, 29 Jan 2024 16:11:07 GMT + - Wed, 07 Aug 2024 18:26:47 GMT Server: - Google Frontend Content-Length: @@ -92,5 +97,5 @@ http_interactions: body: encoding: UTF-8 string: '{"name":"test-index-serverless","metric":"dotproduct","dimension":3,"status":{"ready":false,"state":"Initializing"},"host":"test-index-serverless-b2e8921.svc.apw5-4e34-81fa.pinecone.io","spec":{"serverless":{"region":"us-west-2","cloud":"aws"}}}' - recorded_at: Mon, 29 Jan 2024 16:11:07 GMT + recorded_at: Wed, 07 Aug 2024 18:26:47 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_create/serverless/unsuccessful_response/returns_an_error_response.yml b/spec/cassettes/Pinecone_Index/_create/serverless/unsuccessful_response/returns_an_error_response.yml index 3b39c55..5a1939b 100644 --- a/spec/cassettes/Pinecone_Index/_create/serverless/unsuccessful_response/returns_an_error_response.yml +++ b/spec/cassettes/Pinecone_Index/_create/serverless/unsuccessful_response/returns_an_error_response.yml @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 40df10dae753a0eb68a419e8a31f8e22 + - 8ba2972014a1799920ce12cb4764e459 Date: - - Mon, 29 Jan 2024 16:11:07 GMT + - Wed, 07 Aug 2024 18:26:47 GMT Server: - Google Frontend Content-Length: @@ -45,7 +47,7 @@ http_interactions: body: encoding: UTF-8 string: '{"name":"test-index-serverless","metric":"dotproduct","dimension":3,"status":{"ready":false,"state":"Initializing"},"host":"test-index-serverless-b2e8921.svc.apw5-4e34-81fa.pinecone.io","spec":{"serverless":{"region":"us-west-2","cloud":"aws"}}}' - recorded_at: Mon, 29 Jan 2024 16:11:07 GMT + recorded_at: Wed, 07 Aug 2024 18:26:47 GMT - request: method: post uri: https://api.pinecone.io/indexes @@ -76,10 +78,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - c3c170c2534f5acbe58cd31f1780297e + - af9285c1f47a3ae13b9760441c14766d Date: - - Mon, 29 Jan 2024 16:11:08 GMT + - Wed, 07 Aug 2024 18:26:47 GMT Server: - Google Frontend Content-Length: @@ -91,5 +95,5 @@ http_interactions: body: encoding: UTF-8 string: '{"error":{"code":"ALREADY_EXISTS","message":"Resource already exists"},"status":409}' - recorded_at: Mon, 29 Jan 2024 16:11:08 GMT + recorded_at: Wed, 07 Aug 2024 18:26:47 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_delete/successful_response/returns_a_response_with_index_deletion_details.yml b/spec/cassettes/Pinecone_Index/_delete/successful_response/returns_a_response_with_index_deletion_details.yml index 262b074..2da70ad 100644 --- a/spec/cassettes/Pinecone_Index/_delete/successful_response/returns_a_response_with_index_deletion_details.yml +++ b/spec/cassettes/Pinecone_Index/_delete/successful_response/returns_a_response_with_index_deletion_details.yml @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - b51d7cb981be3ea2998f58d39591799a + - d4eb5ef3c750ca15bc39c215500578fc Date: - - Mon, 29 Jan 2024 16:11:10 GMT + - Wed, 07 Aug 2024 18:26:49 GMT Server: - Google Frontend Content-Length: @@ -46,7 +48,7 @@ http_interactions: encoding: UTF-8 string: 'Failed to deserialize the JSON body into the target type: missing field `spec` at line 1 column 57' - recorded_at: Mon, 29 Jan 2024 16:11:10 GMT + recorded_at: Wed, 07 Aug 2024 18:26:49 GMT - request: method: delete uri: https://api.pinecone.io/indexes/test-index @@ -75,10 +77,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 8f76c29120bd0e7d29982bc1b8d43acb + - 97372ccc0e8510f480e08084a9aadd3c Date: - - Mon, 29 Jan 2024 16:11:10 GMT + - Wed, 07 Aug 2024 18:26:49 GMT Content-Type: - text/html Server: @@ -92,5 +96,5 @@ http_interactions: body: encoding: UTF-8 string: '' - recorded_at: Mon, 29 Jan 2024 16:11:10 GMT + recorded_at: Wed, 07 Aug 2024 18:26:49 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_describe/successful_response/returns_a_response_with_index_details.yml b/spec/cassettes/Pinecone_Index/_describe/successful_response/returns_a_response_with_index_details.yml index 6524321..97db8e4 100644 --- a/spec/cassettes/Pinecone_Index/_describe/successful_response/returns_a_response_with_index_details.yml +++ b/spec/cassettes/Pinecone_Index/_describe/successful_response/returns_a_response_with_index_details.yml @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - '08f00017bd89df0bbab60412e8c9cede' + - a8c4f12ef2078698221711bb6669c035 Date: - - Mon, 29 Jan 2024 16:11:09 GMT + - Wed, 07 Aug 2024 18:26:49 GMT Server: - Google Frontend Content-Length: @@ -45,7 +47,7 @@ http_interactions: body: encoding: UTF-8 string: '{"error":{"code":"ALREADY_EXISTS","message":"Resource already exists"},"status":409}' - recorded_at: Mon, 29 Jan 2024 16:11:09 GMT + recorded_at: Wed, 07 Aug 2024 18:26:49 GMT - request: method: get uri: https://api.pinecone.io/indexes/test-index @@ -76,10 +78,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 959c95dccda4f19ecb88f9519ee737be + - f6e68e9315aadbedb5e59ff3e0d7cf2e Date: - - Mon, 29 Jan 2024 16:11:09 GMT + - Wed, 07 Aug 2024 18:26:49 GMT Server: - Google Frontend Content-Length: @@ -91,5 +95,5 @@ http_interactions: body: encoding: UTF-8 string: '{"name":"test-index","metric":"dotproduct","dimension":3,"status":{"ready":false,"state":"Terminating"},"host":"test-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:09 GMT + recorded_at: Wed, 07 Aug 2024 18:26:49 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Index/_list/successful_response/returns_a_response_with_list_of_indexes.yml b/spec/cassettes/Pinecone_Index/_list/successful_response/returns_a_response_with_list_of_indexes.yml index f24c52d..8b6dd88 100644 --- a/spec/cassettes/Pinecone_Index/_list/successful_response/returns_a_response_with_list_of_indexes.yml +++ b/spec/cassettes/Pinecone_Index/_list/successful_response/returns_a_response_with_list_of_indexes.yml @@ -30,20 +30,22 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 877d0152bcd8c88a115e98db891bc334 + - 635b10ea83b6505a676d267480217a36 Date: - - Mon, 29 Jan 2024 16:11:06 GMT + - Wed, 07 Aug 2024 18:26:45 GMT Server: - Google Frontend Content-Length: - - '539' + - '736' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"indexes":[{"name":"example-index-1","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"example-index-1-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}},{"name":"example-index-2","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"example-index-2-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":1,"shards":1,"pods":1,"pod_type":"p1.x1","environment":""}}}]}' - recorded_at: Mon, 29 Jan 2024 16:11:06 GMT + string: '{"indexes":[{"name":"server-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"server-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":2,"shards":1,"pods":2,"pod_type":"p1.x1","environment":""}}},{"name":"test-index-serverless","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"test-index-serverless-b2e8921.svc.apw5-4e34-81fa.pinecone.io","spec":{"serverless":{"region":"us-west-2","cloud":"aws"}}},{"name":"serverless-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io","spec":{"serverless":{"region":"us-east-1","cloud":"aws"}}}]}' + recorded_at: Wed, 07 Aug 2024 18:26:45 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_delete/successful_response/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_delete/successful_response/returns_a_response.yml index 5f57b74..5c76b62 100644 --- a/spec/cassettes/Pinecone_Vector/_delete/successful_response/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_delete/successful_response/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"5"}]}' @@ -25,9 +25,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:11 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '17' + - '8' Grpc-Status: - '0' Content-Length: @@ -37,10 +37,10 @@ http_interactions: body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:12 GMT + recorded_at: Wed, 07 Aug 2024 17:49:10 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":["5"],"deleteAll":false}' @@ -63,9 +63,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:12 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '14' + - '8' Grpc-Status: - '0' Content-Length: @@ -75,10 +75,10 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:12 GMT + recorded_at: Wed, 07 Aug 2024 17:49:10 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -101,9 +101,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:12 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '11' + - '8' Grpc-Status: - '0' Content-Length: @@ -113,5 +113,5 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:12 GMT + recorded_at: Wed, 07 Aug 2024 17:49:10 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_delete/successful_response_with_filters/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_delete/successful_response_with_filters/returns_a_response.yml index 2f35abc..04c1fb8 100644 --- a/spec/cassettes/Pinecone_Vector/_delete/successful_response_with_filters/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_delete/successful_response_with_filters/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"5"}]}' @@ -25,9 +25,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:12 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '11' + - '8' Grpc-Status: - '0' Content-Length: @@ -37,10 +37,10 @@ http_interactions: body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:12 GMT + recorded_at: Wed, 07 Aug 2024 17:49:10 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":false,"filter":{"genre":"comedy"}}' @@ -63,9 +63,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:12 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '11' + - '8' Grpc-Status: - '0' Content-Length: @@ -75,10 +75,10 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:12 GMT + recorded_at: Wed, 07 Aug 2024 17:49:10 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -101,9 +101,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:12 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '10' + - '8' Grpc-Status: - '0' Content-Length: @@ -113,5 +113,5 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:12 GMT + recorded_at: Wed, 07 Aug 2024 17:49:11 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_delete/when_delete_all_is_true/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_delete/when_delete_all_is_true/returns_a_response.yml index b52611a..7be0e7a 100644 --- a/spec/cassettes/Pinecone_Vector/_delete/when_delete_all_is_true/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_delete/when_delete_all_is_true/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"5"}]}' @@ -25,9 +25,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:13 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '11' + - '8' Grpc-Status: - '0' Content-Length: @@ -37,10 +37,10 @@ http_interactions: body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:13 GMT + recorded_at: Wed, 07 Aug 2024 17:49:11 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -63,9 +63,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:13 GMT + - Wed, 07 Aug 2024 17:49:10 GMT X-Envoy-Upstream-Service-Time: - - '12' + - '8' Grpc-Status: - '0' Content-Length: @@ -75,10 +75,10 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:13 GMT + recorded_at: Wed, 07 Aug 2024 17:49:11 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -101,9 +101,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:13 GMT + - Wed, 07 Aug 2024 17:49:11 GMT X-Envoy-Upstream-Service-Time: - - '9' + - '8' Grpc-Status: - '0' Content-Length: @@ -113,5 +113,5 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:13 GMT + recorded_at: Wed, 07 Aug 2024 17:49:11 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_describe_index_stats/returns_a_successful_response.yml b/spec/cassettes/Pinecone_Vector/_describe_index_stats/returns_a_successful_response.yml index 680b5ae..eb545c2 100644 --- a/spec/cassettes/Pinecone_Vector/_describe_index_stats/returns_a_successful_response.yml +++ b/spec/cassettes/Pinecone_Vector/_describe_index_stats/returns_a_successful_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"2","metadata":{"genre":"comedy"}},{"values":[1,-1,0],"id":"3"}]}' @@ -25,7 +25,7 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:17 GMT + - Wed, 07 Aug 2024 17:53:20 GMT X-Envoy-Upstream-Service-Time: - '50' Grpc-Status: @@ -37,10 +37,10 @@ http_interactions: body: encoding: UTF-8 string: '{"upsertedCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:18 GMT + recorded_at: Wed, 07 Aug 2024 17:53:21 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/describe_index_stats + uri: https://server-index-b2e8921.svc..pinecone.io/describe_index_stats body: encoding: UTF-8 string: '' @@ -63,9 +63,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:17 GMT + - Wed, 07 Aug 2024 17:53:21 GMT X-Envoy-Upstream-Service-Time: - - '0' + - '1' Grpc-Status: - '0' Content-Length: @@ -75,10 +75,10 @@ http_interactions: body: encoding: UTF-8 string: '{"namespaces":{"":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:18 GMT + recorded_at: Wed, 07 Aug 2024 17:53:21 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -101,9 +101,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:17 GMT + - Wed, 07 Aug 2024 17:53:20 GMT X-Envoy-Upstream-Service-Time: - - '15' + - '8' Grpc-Status: - '0' Content-Length: @@ -113,5 +113,5 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:18 GMT + recorded_at: Wed, 07 Aug 2024 17:53:21 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_describe_index_stats/with_filter/returns_a_succesful_response.yml b/spec/cassettes/Pinecone_Vector/_describe_index_stats/with_filter/returns_a_succesful_response.yml index ece9737..c8ec095 100644 --- a/spec/cassettes/Pinecone_Vector/_describe_index_stats/with_filter/returns_a_succesful_response.yml +++ b/spec/cassettes/Pinecone_Vector/_describe_index_stats/with_filter/returns_a_succesful_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"2","metadata":{"genre":"comedy"}},{"values":[1,-1,0],"id":"3"}]}' @@ -25,9 +25,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:17 GMT + - Wed, 07 Aug 2024 17:53:27 GMT X-Envoy-Upstream-Service-Time: - - '56' + - '49' Grpc-Status: - '0' Content-Length: @@ -37,10 +37,10 @@ http_interactions: body: encoding: UTF-8 string: '{"upsertedCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:18 GMT + recorded_at: Wed, 07 Aug 2024 17:53:27 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/describe_index_stats + uri: https://server-index-b2e8921.svc..pinecone.io/describe_index_stats body: encoding: UTF-8 string: '{"filter":{"genre":{"$eq":"comedy"}}}' @@ -63,9 +63,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:18 GMT + - Wed, 07 Aug 2024 17:53:27 GMT X-Envoy-Upstream-Service-Time: - - '0' + - '1' Grpc-Status: - '0' Content-Length: @@ -75,10 +75,10 @@ http_interactions: body: encoding: UTF-8 string: '{"namespaces":{"":{"vectorCount":2}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:18 GMT + recorded_at: Wed, 07 Aug 2024 17:53:28 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -101,9 +101,9 @@ http_interactions: Content-Type: - application/json Date: - - Mon, 29 Jan 2024 16:11:18 GMT + - Wed, 07 Aug 2024 17:53:27 GMT X-Envoy-Upstream-Service-Time: - - '10' + - '9' Grpc-Status: - '0' Content-Length: @@ -113,5 +113,5 @@ http_interactions: body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:19 GMT + recorded_at: Wed, 07 Aug 2024 17:53:28 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_fetch/successful_response/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_fetch/successful_response/returns_a_response.yml index 6185f07..06a4dd3 100644 --- a/spec/cassettes/Pinecone_Vector/_fetch/successful_response/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_fetch/successful_response/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1"}]}' @@ -22,25 +22,33 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:26:02 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:13 GMT + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '73' + X-Pinecone-Request-Id: + - '3344366958066774886' X-Envoy-Upstream-Service-Time: - - '14' + - '73' Grpc-Status: - '0' - Content-Length: - - '19' Server: - envoy body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:13 GMT + recorded_at: Wed, 07 Aug 2024 18:26:02 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"2"}]}' @@ -60,27 +68,35 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:26:02 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:13 GMT + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '2' + X-Pinecone-Request-Latency-Ms: + - '67' + X-Pinecone-Request-Id: + - '1468718929957932812' X-Envoy-Upstream-Service-Time: - - '12' + - '67' Grpc-Status: - '0' - Content-Length: - - '19' Server: - envoy body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:14 GMT + recorded_at: Wed, 07 Aug 2024 18:26:02 GMT - request: - method: get - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/fetch?ids=2&namespace= + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats body: - encoding: US-ASCII + encoding: UTF-8 string: '' headers: Content-Type: @@ -98,28 +114,122 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:26:03 GMT Content-Type: - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '4588857072104542505' + X-Envoy-Upstream-Service-Time: + - '2' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:26:03 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:13 GMT + - Wed, 07 Aug 2024 18:26:03 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '5327415609559353946' X-Envoy-Upstream-Service-Time: - - '1' + - '4' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:26:03 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:26:04 GMT + Content-Type: + - application/json Content-Length: - - '92' + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '3549471535700528480' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 - string: '{"vectors":{"2":{"id":"2","values":[1,2,3]},"1":{"id":"1","values":[1,2,3]}},"namespace":""}' - recorded_at: Mon, 29 Jan 2024 16:11:14 GMT + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:26:04 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats body: encoding: UTF-8 - string: '{"namespace":"","ids":[],"deleteAll":true}' + string: '' headers: Content-Type: - application/json @@ -136,20 +246,158 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:26:04 GMT Content-Type: - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '5' + X-Pinecone-Request-Id: + - '4452741899790411166' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:26:04 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:26:05 GMT + Content-Type: + - application/json + Content-Length: + - '90' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '4828022571967896009' + X-Envoy-Upstream-Service-Time: + - '2' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"":{"vectorCount":2}},"dimension":3,"indexFullness":0,"totalVectorCount":2}' + recorded_at: Wed, 07 Aug 2024 18:26:05 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/fetch?ids=2&namespace= + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:14 GMT + - Wed, 07 Aug 2024 18:26:05 GMT + Content-Type: + - application/json + Content-Length: + - '116' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '1911630512582971679' X-Envoy-Upstream-Service-Time: - - '12' + - '4' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":{"1":{"id":"1","values":[1,2,3]},"2":{"id":"2","values":[1,2,3]}},"namespace":"","usage":{"readUnits":1}}' + recorded_at: Wed, 07 Aug 2024 18:26:05 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:26:05 GMT + Content-Type: + - application/json Content-Length: - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '42' + X-Pinecone-Request-Id: + - '6611357767121859396' + X-Envoy-Upstream-Service-Time: + - '42' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:14 GMT + recorded_at: Wed, 07 Aug 2024 18:26:05 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_list/error_handling/handles_invalid_limit.yml b/spec/cassettes/Pinecone_Vector/_list/error_handling/handles_invalid_limit.yml new file mode 100644 index 0000000..6ea98fb --- /dev/null +++ b/spec/cassettes/Pinecone_Vector/_list/error_handling/handles_invalid_limit.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"document1#1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"document1#2","metadata":{"genre":"drama"}},{"values":[1,-1,0],"id":"document2#1","metadata":{"genre":"action"}}],"namespace":"example-namespace"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:28 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '77' + X-Pinecone-Request-Id: + - '4340720610076021966' + X-Envoy-Upstream-Service-Time: + - '78' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:49:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:28 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '1873797299829288507' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:29 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '6262570016401231705' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:29 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:30 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '6892392684019858192' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:30 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:30 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '979971798402203512' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:30 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:31 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '6918688334718397215' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:31 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:32 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '625280866014820441' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:32 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:32 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '3417933596526981900' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:32 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:33 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '8841325363314362050' + X-Envoy-Upstream-Service-Time: + - '2' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"example-namespace":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:49:33 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=10001&namespace=example-namespace + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 400 + message: Bad Request + headers: + Date: + - Wed, 07 Aug 2024 17:49:33 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '2815131866501585184' + X-Envoy-Upstream-Service-Time: + - '3' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":3,"message":"Limit must be greater than 0 and less than 100. + Request limit was 10001","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:49:33 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"example-namespace","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:33 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '11' + X-Pinecone-Request-Id: + - '7993404647363946591' + X-Envoy-Upstream-Service-Time: + - '11' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 17:49:33 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 17:49:33 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '0' + X-Pinecone-Request-Id: + - '2361663784205513530' + X-Envoy-Upstream-Service-Time: + - '1' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:49:33 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_list/error_handling/handles_non-existent_namespace.yml b/spec/cassettes/Pinecone_Vector/_list/error_handling/handles_non-existent_namespace.yml new file mode 100644 index 0000000..a7a41f7 --- /dev/null +++ b/spec/cassettes/Pinecone_Vector/_list/error_handling/handles_non-existent_namespace.yml @@ -0,0 +1,399 @@ +--- +http_interactions: +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"document1#1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"document1#2","metadata":{"genre":"drama"}},{"values":[1,-1,0],"id":"document2#1","metadata":{"genre":"action"}}],"namespace":"example-namespace"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:25 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '37' + X-Pinecone-Request-Id: + - '16327757291631830' + X-Envoy-Upstream-Service-Time: + - '37' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:49:25 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:25 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '1141914840692728625' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:25 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:26 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '4571324133208335106' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:26 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:27 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '1612068457334017900' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:27 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:27 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '6245133908812275908' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:49:27 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:28 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '1786699534747265256' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"example-namespace":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:49:28 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=100&namespace=non-existent-namespace + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:28 GMT + Content-Type: + - application/json + Content-Length: + - '51' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '1' + X-Pinecone-Request-Id: + - '2961305546361460675' + X-Envoy-Upstream-Service-Time: + - '1' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":[],"namespace":"non-existent-namespace"}' + recorded_at: Wed, 07 Aug 2024 17:49:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"example-namespace","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:49:28 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '12' + X-Pinecone-Request-Id: + - '3043905910070648566' + X-Envoy-Upstream-Service-Time: + - '13' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 17:49:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 17:49:28 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '0' + X-Pinecone-Request-Id: + - '6715378077488091162' + X-Envoy-Upstream-Service-Time: + - '1' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:49:28 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_list/successful_response/handles_pagination.yml b/spec/cassettes/Pinecone_Vector/_list/successful_response/handles_pagination.yml new file mode 100644 index 0000000..628571a --- /dev/null +++ b/spec/cassettes/Pinecone_Vector/_list/successful_response/handles_pagination.yml @@ -0,0 +1,577 @@ +--- +http_interactions: +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"document1#1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"document1#2","metadata":{"genre":"drama"}},{"values":[1,-1,0],"id":"document2#1","metadata":{"genre":"action"}}],"namespace":"example-namespace"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:59 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '84' + X-Pinecone-Request-Id: + - '6443189066388342685' + X-Envoy-Upstream-Service-Time: + - '85' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:46:59 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:59 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '5457529041731114764' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:59 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:00 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '1816893321224866160' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:47:00 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:00 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '7' + X-Pinecone-Request-Id: + - '8206435168981585720' + X-Envoy-Upstream-Service-Time: + - '7' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:47:00 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:01 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '6174283522715595186' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:47:01 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:02 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '3301386417507197688' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:47:02 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:02 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '6564868494751370855' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:47:02 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:03 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '403408582047726759' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"example-namespace":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:47:03 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"document1#1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"document1#2","metadata":{"genre":"drama"}},{"values":[1,-1,0],"id":"document2#1","metadata":{"genre":"action"}}],"namespace":"example-namespace"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:03 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '2' + X-Pinecone-Request-Latency-Ms: + - '31' + X-Pinecone-Request-Id: + - '7974050455421510368' + X-Envoy-Upstream-Service-Time: + - '31' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:47:03 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=2&namespace=example-namespace + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:03 GMT + Content-Type: + - application/json + Content-Length: + - '192' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '1085571755254832128' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":[{"id":"document1#1"},{"id":"document1#2"}],"pagination":{"next":"eyJza2lwX3Bhc3QiOiJkb2N1bWVudDEjMiIsInByZWZpeCI6bnVsbH0="},"namespace":"example-namespace","usage":{"readUnits":1}}' + recorded_at: Wed, 07 Aug 2024 17:47:03 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=2&namespace=example-namespace&paginationToken=eyJza2lwX3Bhc3QiOiJkb2N1bWVudDEjMiIsInByZWZpeCI6bnVsbH0= + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:03 GMT + Content-Type: + - application/json + Content-Length: + - '90' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '7293495551106430780' + X-Envoy-Upstream-Service-Time: + - '2' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":[{"id":"document2#1"}],"namespace":"example-namespace","usage":{"readUnits":1}}' + recorded_at: Wed, 07 Aug 2024 17:47:03 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"example-namespace","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:47:03 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '12' + X-Pinecone-Request-Id: + - '7684375835886348730' + X-Envoy-Upstream-Service-Time: + - '13' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 17:47:03 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 17:47:03 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '5742323724428245149' + X-Envoy-Upstream-Service-Time: + - '1' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:47:03 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_list/successful_response/respects_the_limit_parameter.yml b/spec/cassettes/Pinecone_Vector/_list/successful_response/respects_the_limit_parameter.yml new file mode 100644 index 0000000..163aaeb --- /dev/null +++ b/spec/cassettes/Pinecone_Vector/_list/successful_response/respects_the_limit_parameter.yml @@ -0,0 +1,487 @@ +--- +http_interactions: +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"document1#1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"document1#2","metadata":{"genre":"drama"}},{"values":[1,-1,0],"id":"document2#1","metadata":{"genre":"action"}}],"namespace":"example-namespace"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:35 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '194' + X-Pinecone-Request-Id: + - '1336825887341793637' + X-Envoy-Upstream-Service-Time: + - '195' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:46:35 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:35 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '3227050529728650469' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:35 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:35 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '8551189691884148429' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:35 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:36 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '9141472531268004324' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:36 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:37 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '3185692981486233057' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:37 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:37 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '4659108751956288449' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:37 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:38 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '8246390012549987468' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"example-namespace":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:46:38 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=2&namespace=example-namespace + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:38 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '1' + X-Pinecone-Request-Id: + - '8329458114568848527' + X-Envoy-Upstream-Service-Time: + - '2' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":[],"namespace":"example-namespace","usage":{"readUnits":1}}' + recorded_at: Wed, 07 Aug 2024 17:46:38 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=2&namespace=example-namespace + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:38 GMT + Content-Type: + - application/json + Content-Length: + - '192' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '3044344536373756162' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":[{"id":"document1#1"},{"id":"document1#2"}],"pagination":{"next":"eyJza2lwX3Bhc3QiOiJkb2N1bWVudDEjMiIsInByZWZpeCI6bnVsbH0="},"namespace":"example-namespace","usage":{"readUnits":1}}' + recorded_at: Wed, 07 Aug 2024 17:46:38 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"example-namespace","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:38 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '14' + X-Pinecone-Request-Id: + - '7449778151251959024' + X-Envoy-Upstream-Service-Time: + - '14' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 17:46:38 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 17:46:38 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '1' + X-Pinecone-Request-Id: + - '6948835232926693199' + X-Envoy-Upstream-Service-Time: + - '2' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:46:38 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_list/successful_response/returns_all_vector_IDs_in_the_namespace.yml b/spec/cassettes/Pinecone_Vector/_list/successful_response/returns_all_vector_IDs_in_the_namespace.yml new file mode 100644 index 0000000..5601cda --- /dev/null +++ b/spec/cassettes/Pinecone_Vector/_list/successful_response/returns_all_vector_IDs_in_the_namespace.yml @@ -0,0 +1,443 @@ +--- +http_interactions: +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"document1#1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"document1#2","metadata":{"genre":"drama"}},{"values":[1,-1,0],"id":"document2#1","metadata":{"genre":"action"}}],"namespace":"example-namespace"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:50 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '71' + X-Pinecone-Request-Id: + - '8435231454858931784' + X-Envoy-Upstream-Service-Time: + - '72' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:45:50 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:50 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '7592882645948496059' + X-Envoy-Upstream-Service-Time: + - '8' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:45:50 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:50 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '5581748435157903745' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:45:50 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:51 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '6883673672209026960' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:45:51 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:52 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '5484000281130884210' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:45:51 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:52 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '6594056227492336248' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:45:52 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:53 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '5751192071927448814' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"example-namespace":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:45:53 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=100&namespace=example-namespace + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:53 GMT + Content-Type: + - application/json + Content-Length: + - '132' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '609792158899014927' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":[{"id":"document1#1"},{"id":"document1#2"},{"id":"document2#1"}],"namespace":"example-namespace","usage":{"readUnits":1}}' + recorded_at: Wed, 07 Aug 2024 17:45:53 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"example-namespace","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:45:53 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '10' + X-Pinecone-Request-Id: + - '6521605600236336576' + X-Envoy-Upstream-Service-Time: + - '11' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 17:45:53 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 17:45:53 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '32' + X-Pinecone-Request-Id: + - '7862544731813992695' + X-Envoy-Upstream-Service-Time: + - '33' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:45:53 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_list/successful_response/returns_vector_IDs_with_a_specific_prefix.yml b/spec/cassettes/Pinecone_Vector/_list/successful_response/returns_vector_IDs_with_a_specific_prefix.yml new file mode 100644 index 0000000..2ea483b --- /dev/null +++ b/spec/cassettes/Pinecone_Vector/_list/successful_response/returns_vector_IDs_with_a_specific_prefix.yml @@ -0,0 +1,399 @@ +--- +http_interactions: +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"document1#1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"document1#2","metadata":{"genre":"drama"}},{"values":[1,-1,0],"id":"document2#1","metadata":{"genre":"action"}}],"namespace":"example-namespace"}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:27 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '41' + X-Pinecone-Request-Id: + - '8799844784760176076' + X-Envoy-Upstream-Service-Time: + - '42' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:46:27 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:28 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '5536970717880503108' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:28 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '3439215211534131669' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:29 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '719035056688369109' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:29 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:29 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '685455473778865046' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:46:29 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:30 GMT + Content-Type: + - application/json + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '8274597268285861782' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"example-namespace":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:46:30 GMT +- request: + method: get + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/list?limit=100&namespace=example-namespace&prefix=document1%23 + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:30 GMT + Content-Type: + - application/json + Content-Length: + - '111' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '38' + X-Pinecone-Request-Id: + - '4715979647610709357' + X-Envoy-Upstream-Service-Time: + - '39' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"vectors":[{"id":"document1#1"},{"id":"document1#2"}],"namespace":"example-namespace","usage":{"readUnits":1}}' + recorded_at: Wed, 07 Aug 2024 17:46:30 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"example-namespace","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:46:30 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '15' + X-Pinecone-Request-Id: + - '1930201188256868169' + X-Envoy-Upstream-Service-Time: + - '16' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 17:46:30 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 17:46:30 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '1' + X-Pinecone-Request-Id: + - '5132383009014714800' + X-Envoy-Upstream-Service-Time: + - '1' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:46:30 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_query/missing_index/raises_an_exception.yml b/spec/cassettes/Pinecone_Vector/_query/missing_index/raises_an_exception.yml index 2199f6e..c9119bf 100644 --- a/spec/cassettes/Pinecone_Vector/_query/missing_index/raises_an_exception.yml +++ b/spec/cassettes/Pinecone_Vector/_query/missing_index/raises_an_exception.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -19,23 +19,27 @@ http_interactions: - Ruby response: status: - code: 200 - message: OK + code: 404 + message: Not Found headers: + Date: + - Wed, 07 Aug 2024 18:00:19 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:17 GMT - X-Envoy-Upstream-Service-Time: - - '9' - Grpc-Status: - - '0' Content-Length: - - '2' + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '40' + X-Pinecone-Request-Id: + - '5725234991588895942' + X-Envoy-Upstream-Service-Time: + - '41' Server: - envoy body: encoding: UTF-8 - string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:17 GMT + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 18:00:19 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response.yml index 93fda7f..7386216 100644 --- a/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"2","metadata":{"genre":"comedy"}},{"values":[1,-1,0],"id":"3"}]}' @@ -22,28 +22,124 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:56:42 GMT Content-Type: - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '104' + X-Pinecone-Request-Id: + - '125322317004719291' + X-Envoy-Upstream-Service-Time: + - '104' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:56:42 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:14 GMT + - Wed, 07 Aug 2024 17:56:43 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '7370125357713747338' X-Envoy-Upstream-Service-Time: - - '50' + - '3' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:43 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:43 GMT + Content-Type: + - application/json Content-Length: - - '19' + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '8504611066410154283' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 - string: '{"upsertedCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:15 GMT + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:43 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/query + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats body: encoding: UTF-8 - string: '{"namespace":"","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0]}' + string: '' headers: Content-Type: - application/json @@ -59,29 +155,299 @@ http_interactions: status: code: 200 message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:44 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '4405885020543299164' + X-Envoy-Upstream-Service-Time: + - '9' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:44 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' headers: Content-Type: - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:15 GMT + - Wed, 07 Aug 2024 17:56:44 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '1783725996979425033' X-Envoy-Upstream-Service-Time: - - '1' + - '3' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:44 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:45 GMT + Content-Type: + - application/json Content-Length: - - '206' + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '3007736617610453914' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 - string: '{"results":[],"matches":[{"id":"3","score":1,"values":[]},{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":""}' - recorded_at: Mon, 29 Jan 2024 16:11:15 GMT + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:45 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats body: encoding: UTF-8 - string: '{"namespace":"","ids":[],"deleteAll":true}' + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:46 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '46' + X-Pinecone-Request-Id: + - '3879337938986299122' + X-Envoy-Upstream-Service-Time: + - '56' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:46 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:46 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '4044440462158607631' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:46 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:47 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '8376780791454818210' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:47 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:48 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '6111509299501031345' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:56:48 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' headers: Content-Type: - application/json @@ -98,20 +464,116 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:56:48 GMT Content-Type: - application/json + Content-Length: + - '90' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '6832219752766173912' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:56:48 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/query + body: + encoding: UTF-8 + string: '{"namespace":"","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0]}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:15 GMT + - Wed, 07 Aug 2024 17:56:48 GMT + Content-Type: + - application/json + Content-Length: + - '230' + Connection: + - keep-alive + X-Pinecone-Max-Indexed-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '4498376391144305328' X-Envoy-Upstream-Service-Time: - - '10' + - '4' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"results":[],"matches":[{"id":"3","score":1,"values":[]},{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":"","usage":{"readUnits":6}}' + recorded_at: Wed, 07 Aug 2024 17:56:48 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:56:48 GMT + Content-Type: + - application/json Content-Length: - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '49' + X-Pinecone-Request-Id: + - '2136941053424590062' + X-Envoy-Upstream-Service-Time: + - '50' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:15 GMT + recorded_at: Wed, 07 Aug 2024 17:56:48 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response_when_queried_with_object.yml b/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response_when_queried_with_object.yml index 76aec55..23a1778 100644 --- a/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response_when_queried_with_object.yml +++ b/spec/cassettes/Pinecone_Vector/_query/successful_response/returns_a_response_when_queried_with_object.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"2","metadata":{"genre":"comedy"}},{"values":[1,-1,0],"id":"3"}]}' @@ -22,28 +22,124 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:59:56 GMT Content-Type: - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '76' + X-Pinecone-Request-Id: + - '7468794704781598986' + X-Envoy-Upstream-Service-Time: + - '77' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 17:59:56 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:15 GMT + - Wed, 07 Aug 2024 17:59:56 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '5' + X-Pinecone-Request-Id: + - '2457853441546318503' X-Envoy-Upstream-Service-Time: - - '49' + - '5' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:59:56 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:59:56 GMT + Content-Type: + - application/json Content-Length: - - '19' + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '8214439129212505913' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 - string: '{"upsertedCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:15 GMT + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:59:56 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/query + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats body: encoding: UTF-8 - string: '{"namespace":"","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0]}' + string: '' headers: Content-Type: - application/json @@ -60,28 +156,122 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:59:57 GMT Content-Type: - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '7634561309799565191' + X-Envoy-Upstream-Service-Time: + - '2' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:59:57 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:15 GMT + - Wed, 07 Aug 2024 17:59:58 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '5714991008376701766' X-Envoy-Upstream-Service-Time: - - '1' + - '5' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:59:58 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:59:58 GMT + Content-Type: + - application/json Content-Length: - - '206' + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '1381181513670476393' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 - string: '{"results":[],"matches":[{"id":"3","score":1,"values":[]},{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":""}' - recorded_at: Mon, 29 Jan 2024 16:11:16 GMT + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:59:58 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats body: encoding: UTF-8 - string: '{"namespace":"","ids":[],"deleteAll":true}' + string: '' headers: Content-Type: - application/json @@ -97,21 +287,161 @@ http_interactions: status: code: 200 message: OK + headers: + Date: + - Wed, 07 Aug 2024 17:59:59 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '6' + X-Pinecone-Request-Id: + - '7638616777035985601' + X-Envoy-Upstream-Service-Time: + - '6' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 17:59:59 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' headers: Content-Type: - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: Date: - - Mon, 29 Jan 2024 16:11:15 GMT + - Wed, 07 Aug 2024 17:59:59 GMT + Content-Type: + - application/json + Content-Length: + - '90' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '6654120662360569163' X-Envoy-Upstream-Service-Time: - - '16' + - '5' Grpc-Status: - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 17:59:59 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/query + body: + encoding: UTF-8 + string: '{"namespace":"","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0]}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:00:00 GMT + Content-Type: + - application/json + Content-Length: + - '230' + Connection: + - keep-alive + X-Pinecone-Max-Indexed-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '9' + X-Pinecone-Request-Id: + - '6593818848719367382' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"results":[],"matches":[{"id":"3","score":1,"values":[]},{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":"","usage":{"readUnits":6}}' + recorded_at: Wed, 07 Aug 2024 18:00:00 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:00:00 GMT + Content-Type: + - application/json Content-Length: - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '14' + X-Pinecone-Request-Id: + - '4067979147141060453' + X-Envoy-Upstream-Service-Time: + - '15' + Grpc-Status: + - '0' Server: - envoy body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:16 GMT + recorded_at: Wed, 07 Aug 2024 18:00:00 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_query/successful_response/with_filter/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_query/successful_response/with_filter/returns_a_response.yml deleted file mode 100644 index f0f7487..0000000 --- a/spec/cassettes/Pinecone_Vector/_query/successful_response/with_filter/returns_a_response.yml +++ /dev/null @@ -1,117 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert - body: - encoding: UTF-8 - string: '{"vectors":[{"values":[1,2,3],"id":"1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"2","metadata":{"genre":"comedy"}},{"values":[1,-1,0],"id":"3"}]}' - headers: - Content-Type: - - application/json - Accept: - - application/json - Api-Key: - - "" - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Content-Type: - - application/json - Date: - - Mon, 29 Jan 2024 16:11:16 GMT - X-Envoy-Upstream-Service-Time: - - '51' - Grpc-Status: - - '0' - Content-Length: - - '19' - Server: - - envoy - body: - encoding: UTF-8 - string: '{"upsertedCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:16 GMT -- request: - method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/query - body: - encoding: UTF-8 - string: '{"namespace":"","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0],"filter":{"genre":{"$eq":"comedy"}}}' - headers: - Content-Type: - - application/json - Accept: - - application/json - Api-Key: - - "" - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Content-Type: - - application/json - Date: - - Mon, 29 Jan 2024 16:11:16 GMT - X-Envoy-Upstream-Service-Time: - - '1' - Grpc-Status: - - '0' - Content-Length: - - '173' - Server: - - envoy - body: - encoding: UTF-8 - string: '{"results":[],"matches":[{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":""}' - recorded_at: Mon, 29 Jan 2024 16:11:16 GMT -- request: - method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete - body: - encoding: UTF-8 - string: '{"namespace":"","ids":[],"deleteAll":true}' - headers: - Content-Type: - - application/json - Accept: - - application/json - Api-Key: - - "" - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - User-Agent: - - Ruby - response: - status: - code: 200 - message: OK - headers: - Content-Type: - - application/json - Date: - - Mon, 29 Jan 2024 16:11:16 GMT - X-Envoy-Upstream-Service-Time: - - '23' - Grpc-Status: - - '0' - Content-Length: - - '2' - Server: - - envoy - body: - encoding: UTF-8 - string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:16 GMT -recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_query/with_filter/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_query/with_filter/returns_a_response.yml new file mode 100644 index 0000000..95ffc88 --- /dev/null +++ b/spec/cassettes/Pinecone_Vector/_query/with_filter/returns_a_response.yml @@ -0,0 +1,447 @@ +--- +http_interactions: +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert + body: + encoding: UTF-8 + string: '{"vectors":[{"values":[1,2,3],"id":"1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"2","metadata":{"genre":"comedy"}},{"values":[1,-1,0],"id":"3"}]}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:26 GMT + Content-Type: + - application/json + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '74' + X-Pinecone-Request-Id: + - '7786477416807474186' + X-Envoy-Upstream-Service-Time: + - '74' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"upsertedCount":3}' + recorded_at: Wed, 07 Aug 2024 18:24:26 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:26 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '4135263034948313518' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:24:26 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:26 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '2993521004952570692' + X-Envoy-Upstream-Service-Time: + - '4' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:24:26 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:27 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '8565495536053172917' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:24:27 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:28 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '2373283630653399649' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:24:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:28 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '3' + X-Pinecone-Request-Id: + - '5574025191456856299' + X-Envoy-Upstream-Service-Time: + - '3' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:24:28 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:29 GMT + Content-Type: + - application/json + Content-Length: + - '70' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '978321921397788053' + X-Envoy-Upstream-Service-Time: + - '2' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{},"dimension":3,"indexFullness":0,"totalVectorCount":0}' + recorded_at: Wed, 07 Aug 2024 18:24:29 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:30 GMT + Content-Type: + - application/json + Content-Length: + - '90' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '4' + X-Pinecone-Request-Id: + - '3562937997458903946' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"namespaces":{"":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 18:24:30 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/query + body: + encoding: UTF-8 + string: '{"namespace":"","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0],"filter":{"genre":{"$eq":"comedy"}}}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:30 GMT + Content-Type: + - application/json + Content-Length: + - '197' + Connection: + - keep-alive + X-Pinecone-Max-Indexed-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '5' + X-Pinecone-Request-Id: + - '9121788334226378061' + X-Envoy-Upstream-Service-Time: + - '5' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"results":[],"matches":[{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":"","usage":{"readUnits":6}}' + recorded_at: Wed, 07 Aug 2024 18:24:30 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Date: + - Wed, 07 Aug 2024 18:24:30 GMT + Content-Type: + - application/json + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '15' + X-Pinecone-Request-Id: + - '1313012410576886004' + X-Envoy-Upstream-Service-Time: + - '15' + Grpc-Status: + - '0' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 18:24:30 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_query/with_namespace/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_query/with_namespace/returns_a_response.yml index f2284ad..c7d4f0c 100644 --- a/spec/cassettes/Pinecone_Vector/_query/with_namespace/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_query/with_namespace/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1","metadata":{"genre":"comedy"}},{"values":[0,1,-1],"id":"2","metadata":{"genre":"comedy"}},{"values":[1,-1,0],"id":"3"}],"namespace":"example-namespace"}' @@ -22,28 +22,36 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:14:23 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:16 GMT + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '3' + X-Pinecone-Request-Latency-Ms: + - '33' + X-Pinecone-Request-Id: + - '7794580558019784831' X-Envoy-Upstream-Service-Time: - - '55' + - '34' Grpc-Status: - '0' - Content-Length: - - '19' Server: - envoy body: encoding: UTF-8 string: '{"upsertedCount":3}' - recorded_at: Mon, 29 Jan 2024 16:11:17 GMT + recorded_at: Wed, 07 Aug 2024 18:14:23 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/query + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/describe_index_stats body: encoding: UTF-8 - string: '{"namespace":"example-namespace","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0]}' + string: '' headers: Content-Type: - application/json @@ -60,28 +68,34 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:14:23 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:16 GMT + Content-Length: + - '107' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '2' + X-Pinecone-Request-Id: + - '7710281509844341554' X-Envoy-Upstream-Service-Time: - - '1' + - '3' Grpc-Status: - '0' - Content-Length: - - '223' Server: - envoy body: encoding: UTF-8 - string: '{"results":[],"matches":[{"id":"3","score":1,"values":[]},{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":"example-namespace"}' - recorded_at: Mon, 29 Jan 2024 16:11:17 GMT + string: '{"namespaces":{"example-namespace":{"vectorCount":3}},"dimension":3,"indexFullness":0,"totalVectorCount":3}' + recorded_at: Wed, 07 Aug 2024 18:14:23 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/query body: encoding: UTF-8 - string: '{"namespace":"example-namespace","ids":[],"deleteAll":true}' + string: '{"namespace":"example-namespace","includeValues":false,"includeMetadata":true,"topK":10,"vector":[0.5,-0.5,0]}' headers: Content-Type: - application/json @@ -98,25 +112,33 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 18:14:23 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:16 GMT + Content-Length: + - '247' + Connection: + - keep-alive + X-Pinecone-Max-Indexed-Lsn: + - '3' + X-Pinecone-Request-Latency-Ms: + - '1' + X-Pinecone-Request-Id: + - '7123218215899758485' X-Envoy-Upstream-Service-Time: - - '9' + - '2' Grpc-Status: - '0' - Content-Length: - - '2' Server: - envoy body: encoding: UTF-8 - string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:17 GMT + string: '{"results":[],"matches":[{"id":"3","score":1,"values":[]},{"id":"2","score":-0.5,"values":[],"metadata":{"genre":"comedy"}},{"id":"1","score":-0.5,"values":[],"metadata":{"genre":"comedy"}}],"namespace":"example-namespace","usage":{"readUnits":6}}' + recorded_at: Wed, 07 Aug 2024 18:14:23 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -133,23 +155,27 @@ http_interactions: - Ruby response: status: - code: 200 - message: OK + code: 404 + message: Not Found headers: + Date: + - Wed, 07 Aug 2024 18:14:23 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:16 GMT - X-Envoy-Upstream-Service-Time: - - '12' - Grpc-Status: - - '0' Content-Length: - - '2' + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '0' + X-Pinecone-Request-Id: + - '1271774673234802789' + X-Envoy-Upstream-Service-Time: + - '1' Server: - envoy body: encoding: UTF-8 - string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:17 GMT + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 18:14:23 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_update/successful_response/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_update/successful_response/returns_a_response.yml index 958c32a..8a98323 100644 --- a/spec/cassettes/Pinecone_Vector/_update/successful_response/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_update/successful_response/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1"}]}' @@ -22,25 +22,33 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:49:12 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:14 GMT + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '30' + X-Pinecone-Request-Id: + - '6359825000553275177' X-Envoy-Upstream-Service-Time: - - '10' + - '30' Grpc-Status: - '0' - Content-Length: - - '19' Server: - envoy body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:14 GMT + recorded_at: Wed, 07 Aug 2024 17:49:12 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/update + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/update body: encoding: UTF-8 string: '{"id":"1","values":[1,0,3],"setMetadata":{"genre":"drama"}}' @@ -60,25 +68,33 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:49:12 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:14 GMT + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '2' + X-Pinecone-Request-Latency-Ms: + - '44' + X-Pinecone-Request-Id: + - '5052110531158764551' X-Envoy-Upstream-Service-Time: - - '11' + - '44' Grpc-Status: - '0' - Content-Length: - - '2' Server: - envoy body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:14 GMT + recorded_at: Wed, 07 Aug 2024 17:49:12 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -98,20 +114,26 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:49:12 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:14 GMT + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '12' + X-Pinecone-Request-Id: + - '3243965821485611837' X-Envoy-Upstream-Service-Time: - - '10' + - '13' Grpc-Status: - '0' - Content-Length: - - '2' Server: - envoy body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:14 GMT + recorded_at: Wed, 07 Aug 2024 17:49:12 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_upsert/successful_response/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_upsert/successful_response/returns_a_response.yml index f2f105f..04e3582 100644 --- a/spec/cassettes/Pinecone_Vector/_upsert/successful_response/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_upsert/successful_response/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '{"vectors":[{"values":[1,2,3],"id":"1"}]}' @@ -22,25 +22,33 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:49:09 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:11 GMT + Content-Length: + - '19' + Connection: + - keep-alive + X-Pinecone-Request-Lsn: + - '1' + X-Pinecone-Request-Latency-Ms: + - '62' + X-Pinecone-Request-Id: + - '8373139083634977725' X-Envoy-Upstream-Service-Time: - - '157' + - '63' Grpc-Status: - '0' - Content-Length: - - '19' Server: - envoy body: encoding: UTF-8 string: '{"upsertedCount":1}' - recorded_at: Mon, 29 Jan 2024 16:11:11 GMT + recorded_at: Wed, 07 Aug 2024 17:49:09 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -60,20 +68,26 @@ http_interactions: code: 200 message: OK headers: + Date: + - Wed, 07 Aug 2024 17:49:09 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:11 GMT + Content-Length: + - '2' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '10' + X-Pinecone-Request-Id: + - '491744994311037654' X-Envoy-Upstream-Service-Time: - - '9' + - '11' Grpc-Status: - '0' - Content-Length: - - '2' Server: - envoy body: encoding: UTF-8 string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:11 GMT + recorded_at: Wed, 07 Aug 2024 17:49:09 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/Pinecone_Vector/_upsert/unsuccessful_response/returns_a_response.yml b/spec/cassettes/Pinecone_Vector/_upsert/unsuccessful_response/returns_a_response.yml index 2860a19..0baf687 100644 --- a/spec/cassettes/Pinecone_Vector/_upsert/unsuccessful_response/returns_a_response.yml +++ b/spec/cassettes/Pinecone_Vector/_upsert/unsuccessful_response/returns_a_response.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/upsert + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/upsert body: encoding: UTF-8 string: '"foo"' @@ -22,23 +22,23 @@ http_interactions: code: 400 message: Bad Request headers: + Date: + - Wed, 07 Aug 2024 17:49:09 GMT Content-Type: - text/plain Content-Length: - '33' - Date: - - Mon, 29 Jan 2024 16:11:11 GMT + Connection: + - keep-alive Server: - envoy - Connection: - - close body: encoding: UTF-8 string: ": Root element must be a message." - recorded_at: Mon, 29 Jan 2024 16:11:11 GMT + recorded_at: Wed, 07 Aug 2024 17:49:09 GMT - request: method: post - uri: https://example-index-2-b2e8921.svc..pinecone.io/vectors/delete + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete body: encoding: UTF-8 string: '{"namespace":"","ids":[],"deleteAll":true}' @@ -55,23 +55,27 @@ http_interactions: - Ruby response: status: - code: 200 - message: OK + code: 404 + message: Not Found headers: + Date: + - Wed, 07 Aug 2024 17:49:10 GMT Content-Type: - application/json - Date: - - Mon, 29 Jan 2024 16:11:11 GMT - X-Envoy-Upstream-Service-Time: - - '14' - Grpc-Status: - - '0' Content-Length: - - '2' + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '80' + X-Pinecone-Request-Id: + - '3075019710536462273' + X-Envoy-Upstream-Service-Time: + - '81' Server: - envoy body: encoding: UTF-8 - string: "{}" - recorded_at: Mon, 29 Jan 2024 16:11:11 GMT + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 17:49:10 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/clear_index.yml b/spec/cassettes/clear_index.yml new file mode 100644 index 0000000..a2f9db2 --- /dev/null +++ b/spec/cassettes/clear_index.yml @@ -0,0 +1,259 @@ +--- +http_interactions: +- request: + method: get + uri: https://api.pinecone.io/indexes/serverless-index + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 957bcac70feff96863ad334b55b67c4b + Date: + - Wed, 07 Aug 2024 18:19:15 GMT + Server: + - Google Frontend + Content-Length: + - '227' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"serverless-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io","spec":{"serverless":{"region":"us-east-1","cloud":"aws"}}}' + recorded_at: Wed, 07 Aug 2024 18:19:15 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 18:19:15 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '0' + X-Pinecone-Request-Id: + - '1282087444027551649' + X-Envoy-Upstream-Service-Time: + - '1' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 18:19:15 GMT +- request: + method: get + uri: https://api.pinecone.io/indexes/server-index + body: + encoding: US-ASCII + string: '' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Access-Control-Allow-Origin: + - "*" + Vary: + - origin,access-control-request-method,access-control-request-headers + Access-Control-Expose-Headers: + - "*" + X-Pinecone-Api-Version: + - 2024-04 + X-Cloud-Trace-Context: + - 3cb537e6664103172e5032a3e07d3785 + Date: + - Wed, 07 Aug 2024 18:19:15 GMT + Server: + - Google Frontend + Content-Length: + - '256' + Via: + - 1.1 google + Alt-Svc: + - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 + body: + encoding: UTF-8 + string: '{"name":"server-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"server-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":2,"shards":1,"pods":2,"pod_type":"p1.x1","environment":""}}}' + recorded_at: Wed, 07 Aug 2024 18:19:15 GMT +- request: + method: post + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Date: + - Wed, 07 Aug 2024 18:19:15 GMT + X-Envoy-Upstream-Service-Time: + - '8' + Grpc-Status: + - '0' + Content-Length: + - '2' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 18:19:15 GMT +- request: + method: post + uri: https://serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 404 + message: Not Found + headers: + Date: + - Wed, 07 Aug 2024 18:24:30 GMT + Content-Type: + - application/json + Content-Length: + - '55' + Connection: + - keep-alive + X-Pinecone-Request-Latency-Ms: + - '1' + X-Pinecone-Request-Id: + - '6749923433787253140' + X-Envoy-Upstream-Service-Time: + - '1' + Server: + - envoy + body: + encoding: UTF-8 + string: '{"code":5,"message":"Namespace not found","details":[]}' + recorded_at: Wed, 07 Aug 2024 18:24:30 GMT +- request: + method: post + uri: https://server-index-b2e8921.svc..pinecone.io/vectors/delete + body: + encoding: UTF-8 + string: '{"namespace":"","ids":[],"deleteAll":true}' + headers: + Content-Type: + - application/json + Accept: + - application/json + Api-Key: + - "" + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + User-Agent: + - Ruby + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/json + Date: + - Wed, 07 Aug 2024 18:24:30 GMT + X-Envoy-Upstream-Service-Time: + - '9' + Grpc-Status: + - '0' + Content-Length: + - '2' + Server: + - envoy + body: + encoding: UTF-8 + string: "{}" + recorded_at: Wed, 07 Aug 2024 18:24:30 GMT +recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/missing_index.yml b/spec/cassettes/missing_index.yml index dd62ee2..6322e80 100644 --- a/spec/cassettes/missing_index.yml +++ b/spec/cassettes/missing_index.yml @@ -30,10 +30,12 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - b4b4d3c232c5c250b9ba778e586334cf + - 9087d91ca921a056333331c9f00d2589 Date: - - Mon, 29 Jan 2024 16:11:17 GMT + - Wed, 07 Aug 2024 17:49:14 GMT Server: - Google Frontend Content-Length: @@ -46,5 +48,5 @@ http_interactions: encoding: UTF-8 string: '{"error":{"code":"NOT_FOUND","message":"Resource missing-index not found"},"status":404}' - recorded_at: Mon, 29 Jan 2024 16:11:17 GMT + recorded_at: Wed, 07 Aug 2024 17:49:14 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/create_index.yml b/spec/cassettes/use_server_index.yml similarity index 54% rename from spec/cassettes/create_index.yml rename to spec/cassettes/use_server_index.yml index a0d9c3d..23b5f04 100644 --- a/spec/cassettes/create_index.yml +++ b/spec/cassettes/use_server_index.yml @@ -1,11 +1,11 @@ --- http_interactions: - request: - method: post - uri: https://api.pinecone.io/indexes + method: get + uri: https://api.pinecone.io/indexes/server-index body: - encoding: UTF-8 - string: '{"metric":"dotproduct","name":"example-index","dimension":3}' + encoding: US-ASCII + string: '' headers: Content-Type: - application/json @@ -19,32 +19,33 @@ http_interactions: - Ruby response: status: - code: 422 - message: unknown + code: 200 + message: OK headers: Content-Type: - - text/plain; charset=utf-8 + - application/json Access-Control-Allow-Origin: - "*" Vary: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - 2b7107a0b3bd164ecaf09c3b89459498 + - f0a1f171e7465ab544a5699e508aa8ff Date: - - Mon, 29 Jan 2024 16:11:03 GMT + - Wed, 07 Aug 2024 17:49:10 GMT Server: - Google Frontend Content-Length: - - '98' + - '256' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: 'Failed to deserialize the JSON body into the target type: missing field - `spec` at line 1 column 60' - recorded_at: Mon, 29 Jan 2024 16:11:03 GMT + string: '{"name":"server-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"server-index-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":2,"shards":1,"pods":2,"pod_type":"p1.x1","environment":""}}}' + recorded_at: Wed, 07 Aug 2024 17:49:10 GMT recorded_with: VCR 6.1.0 diff --git a/spec/cassettes/use_index.yml b/spec/cassettes/use_serverless_index.yml similarity index 64% rename from spec/cassettes/use_index.yml rename to spec/cassettes/use_serverless_index.yml index 18e09ba..db5c3d6 100644 --- a/spec/cassettes/use_index.yml +++ b/spec/cassettes/use_serverless_index.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://api.pinecone.io/indexes/example-index-2 + uri: https://api.pinecone.io/indexes/serverless-index body: encoding: US-ASCII string: '' @@ -30,20 +30,22 @@ http_interactions: - origin,access-control-request-method,access-control-request-headers Access-Control-Expose-Headers: - "*" + X-Pinecone-Api-Version: + - 2024-04 X-Cloud-Trace-Context: - - b3087b0301d65d615f398653679af0fb + - 3b71f12f65a203419b0c796770d51dcc Date: - - Mon, 29 Jan 2024 16:11:18 GMT + - Wed, 07 Aug 2024 17:44:56 GMT Server: - Google Frontend Content-Length: - - '267' + - '227' Via: - 1.1 google Alt-Svc: - h3=":443"; ma=2592000,h3-29=":443"; ma=2592000 body: encoding: UTF-8 - string: '{"name":"example-index-2","metric":"dotproduct","dimension":3,"status":{"ready":false,"state":"Upgrading"},"host":"example-index-2-b2e8921.svc..pinecone.io","spec":{"pod":{"replicas":2,"shards":1,"pods":2,"pod_type":"p1.x1","environment":""}}}' - recorded_at: Mon, 29 Jan 2024 16:11:18 GMT + string: '{"name":"serverless-index","metric":"dotproduct","dimension":3,"status":{"ready":true,"state":"Ready"},"host":"serverless-index-b2e8921.svc.aped-4627-b74a.pinecone.io","spec":{"serverless":{"region":"us-east-1","cloud":"aws"}}}' + recorded_at: Wed, 07 Aug 2024 17:44:56 GMT recorded_with: VCR 6.1.0 diff --git a/spec/pinecone/client_spec.rb b/spec/pinecone/client_spec.rb index 603fe23..6a2722d 100644 --- a/spec/pinecone/client_spec.rb +++ b/spec/pinecone/client_spec.rb @@ -3,37 +3,25 @@ RSpec.describe Pinecone::Client do let(:client) { Pinecone::Client.new } - before :all do - VCR.use_cassette("create_index") do - Pinecone::Client.new.create_index( - { - metric: "dotproduct", - name: "example-index", - dimension: 3 - } - ) - end - end - describe "#index", :vcr do it "allows multiple indices" do - index_1 = client.index("example-index-1") - index_2 = client.index("example-index-2") - expect(index_1.base_uri).to match(/example-index-1/) - expect(index_2.base_uri).to match(/example-index-2/) + index_1 = client.index("serverless-index") + index_2 = client.index("server-index") + expect(index_1.base_uri).to match(/serverless-index/) + expect(index_2.base_uri).to match(/server-index/) end end describe "#upsert", :vcr do let(:data) { {vectors: [{values: [1, 2, 3], id: "1"}]} } let(:response) { - index = client.index("example-index-1") + index = client.index("serverless-index") index.upsert(data) } describe "successfull response" do let(:response) { - index = client.index("example-index-1") + index = client.index("serverless-index") index.upsert(data) } it "returns a response" do diff --git a/spec/pinecone/collections_spec.rb b/spec/pinecone/collections_spec.rb index bfc0340..3ab91ab 100644 --- a/spec/pinecone/collections_spec.rb +++ b/spec/pinecone/collections_spec.rb @@ -5,7 +5,7 @@ let(:valid_attributes) { { name: "test-collection", - source: "example-index-2" + source: "server-index" # Collections only work for server indexes } } @@ -30,6 +30,8 @@ it "returns a response with collection creation details" do expect(response).to be_a(HTTParty::Response) expect(response.code).to eq(201) + client.delete("test-collection") + wait_for_collection_deletion_completion("test-collection") end end @@ -38,6 +40,10 @@ client.create(valid_attributes) } + before do + client.create(valid_attributes) + end + it "returns an error response" do expect(response).to be_a(HTTParty::Response) expect(response.code).to eq(409) @@ -77,7 +83,9 @@ end let(:response) { - client.delete(collection_name) + response = client.delete(collection_name) + wait_for_collection_deletion_completion(collection_name) + response } describe "successful response" do @@ -88,4 +96,18 @@ end end end + + def wait_for_collection_deletion_completion(collection_name) + timeout = 20 + interval = 0.5 + Timeout.timeout(timeout) do + loop do + response = client.describe(collection_name) + break if response.code == 404 + sleep interval + end + end + rescue Timeout::Error + raise "Timed out waiting for upsert to complete" + end end diff --git a/spec/pinecone/index_spec.rb b/spec/pinecone/index_spec.rb index 1d56120..ed32219 100644 --- a/spec/pinecone/index_spec.rb +++ b/spec/pinecone/index_spec.rb @@ -40,7 +40,7 @@ expect(response).to be_a(HTTParty::Response) expect(response.code).to eq(200) expect(response.parsed_response).to be_a(Hash) - expect(response["indexes"].map { |h| h["name"] }).to include("example-index-2") + expect(response["indexes"].map { |h| h["name"] }).to include("server-index") end end end @@ -53,9 +53,9 @@ describe "successful response" do before do - response = client.delete(serverless_attributes[:name]) + resp = client.delete(serverless_attributes[:name]) sleep 1 - if response.ok? + if resp.ok? expect(client.describe(serverless_attributes[:name]).code).to eq(404) end end @@ -160,7 +160,7 @@ end describe "#configure_index", :vcr do - let(:index_name) { "example-index-2" } + let(:index_name) { "server-index" } let(:response) { client.configure(index_name, spec: {pod: {replicas: 2}}) diff --git a/spec/pinecone/vector_spec.rb b/spec/pinecone/vector_spec.rb index 54a1c7e..466a42a 100644 --- a/spec/pinecone/vector_spec.rb +++ b/spec/pinecone/vector_spec.rb @@ -2,8 +2,8 @@ RSpec.describe Pinecone::Vector do let(:index) { - VCR.use_cassette("use_index") do - Pinecone::Vector.new("example-index-2") + VCR.use_cassette("use_serverless_index") do + Pinecone::Vector.new("serverless-index") end } @@ -13,85 +13,90 @@ describe "#upsert", :vcr do let(:data) { {vectors: [{values: [1, 2, 3], id: "1"}]} } - let(:response) { - index.upsert(data) - } describe "successful response" do - let(:response) { + let(:upsert_response) { index.upsert(data) } + it "returns a response" do - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) - expect(response.parsed_response).to eq({"upsertedCount" => 1}) + expect(upsert_response).to be_a(HTTParty::Response) + expect(upsert_response.code).to eq(200) + expect(upsert_response.parsed_response).to eq({"upsertedCount" => 1}) end end describe "unsuccessful response" do - let(:response) { + let(:upsert_response) { index.upsert("foo") } + it "returns a response" do - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(400) - expect(response.parsed_response).to eq(": Root element must be a message.") + expect(upsert_response).to be_a(HTTParty::Response) + expect(upsert_response.code).to eq(400) + expect(upsert_response.parsed_response).to eq(": Root element must be a message.") end end end describe "#delete", :vcr do + let(:index) { + VCR.use_cassette("use_server_index") do + Pinecone::Vector.new("server-index") # delete by filter requires server index + end + } let(:data) { {vectors: [{values: [1, 2, 3], id: "5"}]} } describe "successful response" do - let(:response) { + let(:delete_response) { index.delete(ids: ["5"]) } it "returns a response" do index.upsert(data) - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) + expect(delete_response).to be_a(HTTParty::Response) + expect(delete_response.code).to eq(200) end end describe "successful response with filters" do - let(:response) { + let(:delete_response) { index.delete(filter: {genre: "comedy"}) } it "returns a response" do index.upsert(data) - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) + expect(delete_response).to be_a(HTTParty::Response) + expect(delete_response.code).to eq(200) end end context "when delete_all is true" do - let(:response) { + let(:delete_response) { index.delete(delete_all: true) } + it "returns a response" do index.upsert(data) - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) + expect(delete_response).to be_a(HTTParty::Response) + expect(delete_response.code).to eq(200) end end end describe "#fetch", :vcr do describe "successful response" do - let(:response) { + let(:fetch_response) { index.fetch(ids: ["1", "2"]) } it "returns a response" do index.upsert({vectors: [{values: [1, 2, 3], id: "1"}]}) index.upsert({vectors: [{values: [1, 2, 3], id: "2"}]}) - - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) - expect(response.parsed_response).to match( + wait_for_upsert_completion(expected_count: 2) + expect(fetch_response).to be_a(HTTParty::Response) + expect(fetch_response.code).to eq(200) + expect(fetch_response.parsed_response).to match( "namespace" => "", "vectors" => { "1" => { @@ -102,7 +107,8 @@ "id" => "2", "values" => [1, 2, 3] } - } + }, + "usage" => {"readUnits" => 1} ) end end @@ -110,16 +116,16 @@ describe "#update", :vcr do describe "successful response" do - let(:response) { + let(:update_response) { index.update(id: "1", values: [1, 0, 3], set_metadata: {genre: "drama"}) } it "returns a response" do index.upsert({vectors: [{values: [1, 2, 3], id: "1"}]}) - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) - expect(response.parsed_response).to eq({}) + expect(update_response).to be_a(HTTParty::Response) + expect(update_response.code).to eq(200) + expect(update_response.parsed_response).to eq({}) end end end @@ -139,9 +145,10 @@ describe "successful response" do before do index.upsert(data) + wait_for_upsert_completion(expected_count: 3) end - let(:response) { + let(:query_response) { index.query(vector: query_vector) } @@ -149,7 +156,7 @@ Pinecone::Vector::Query.new(vector: query_vector) } - let(:response_with_object) { + let(:query_response_with_object) { index.query(query_object) } @@ -175,70 +182,74 @@ "values" => [] } ], - "namespace" => "" + "namespace" => "", + "usage" => {"readUnits" => 6} } } it "returns a response" do - expect(response).to be_a(HTTParty::Response) - expect(response.parsed_response).to eq(valid_result) + expect(query_response).to be_a(HTTParty::Response) + expect(query_response.parsed_response).to eq(valid_result) end it "returns a response when queried with object" do - expect(response_with_object).to be_a(HTTParty::Response) - expect(response_with_object.parsed_response).to eq(valid_result) + expect(query_response_with_object).to be_a(HTTParty::Response) + expect(query_response_with_object.parsed_response).to eq(valid_result) end + end - describe "with filter" do - let(:valid_result) { - { - "results" => [], - "matches" => [ - { - "id" => "2", - "metadata" => {"genre" => "comedy"}, - "score" => -0.5, - "values" => [] - }, - { - "id" => "1", - "metadata" => {"genre" => "comedy"}, - "score" => -0.5, - "values" => [] - } - ], - "namespace" => "" - } - } + describe "with filter" do + before do + index.upsert(data) + wait_for_upsert_completion(expected_count: 3) + end - let(:filter) { {genre: {"$eq": "comedy"}} } - let(:response) { index.query(vector: query_vector, filter: filter) } + let(:valid_result) { + { + "results" => [], + "matches" => [ + { + "id" => "2", + "metadata" => {"genre" => "comedy"}, + "score" => -0.5, + "values" => [] + }, + { + "id" => "1", + "metadata" => {"genre" => "comedy"}, + "score" => -0.5, + "values" => [] + } + ], + "namespace" => "", + "usage" => {"readUnits" => 6} + } + } + let(:filter) { {genre: {"$eq": "comedy"}} } + let(:filter_response) { index.query(vector: query_vector, filter: filter) } - it "returns a response" do - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) - expect(response.parsed_response).to eq(valid_result) - end + it "returns a response" do + expect(filter_response).to be_a(HTTParty::Response) + expect(filter_response.code).to eq(200) + expect(filter_response.parsed_response).to eq(valid_result) end end describe "with namespace" do let(:namespace) { "example-namespace" } + before do index.upsert(data.merge(namespace: namespace)) + wait_for_upsert_completion(expected_count: 3) end - after :each do - index.delete(delete_all: true, namespace: namespace) - end - - let(:response) { + let(:query_response) { index.query(namespace: "example-namespace", vector: query_vector) } it "returns a response" do - expect(response).to be_a(HTTParty::Response) - expect(response.parsed_response).to eq({ + expect(query_response).to be_a(HTTParty::Response) + expect(query_response.parsed_response).to eq({ "results" => [], "matches" => [ { @@ -259,7 +270,8 @@ "values" => [] } ], - "namespace" => "example-namespace" + "namespace" => "example-namespace", + "usage" => {"readUnits" => 6} }) end end @@ -274,6 +286,13 @@ end describe "#describe_index_stats", :vcr do + let(:index) { + # Server required for metadata filtering + VCR.use_cassette("use_server_index") do + Pinecone::Vector.new("server-index") + end + } + let(:data) { { vectors: [ @@ -284,7 +303,7 @@ } } - let(:response) { + let(:describe_response) { index.describe_index_stats } @@ -293,9 +312,9 @@ end it "returns a successful response" do - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) - expect(response.parsed_response).to eq({ + expect(describe_response).to be_a(HTTParty::Response) + expect(describe_response.code).to eq(200) + expect(describe_response.parsed_response).to eq({ "namespaces" => {"" => {"vectorCount" => 3}}, "dimension" => 3, "indexFullness" => 0, @@ -305,13 +324,14 @@ describe "with filter" do let(:filter) { {genre: {"$eq": "comedy"}} } - let(:response) { + let(:describe_response) { index.describe_index_stats(filter: filter) } + it "returns a succesful response" do - expect(response).to be_a(HTTParty::Response) - expect(response.code).to eq(200) - expect(response.parsed_response).to eq({ + expect(describe_response).to be_a(HTTParty::Response) + expect(describe_response.code).to eq(200) + expect(describe_response.parsed_response).to eq({ "namespaces" => {"" => {"vectorCount" => 2}}, "dimension" => 3, "indexFullness" => 0, @@ -320,4 +340,87 @@ end end end + + describe "#list", :vcr, :focus do + let(:namespace) { "example-namespace" } + let(:data) { + { + vectors: [ + {values: [1, 2, 3], id: "document1#1", metadata: {genre: "comedy"}}, + {values: [0, 1, -1], id: "document1#2", metadata: {genre: "drama"}}, + {values: [1, -1, 0], id: "document2#1", metadata: {genre: "action"}} + ], + namespace: namespace + } + } + + before do + expect(index.upsert(data)["upsertedCount"]).to eq(3) + wait_for_upsert_completion(expected_count: 3) + end + + after :each do + index.delete(delete_all: true, namespace: namespace) + end + + describe "successful response" do + it "returns all vector IDs in the namespace" do + response = index.list(namespace: namespace) + expect(response).to be_a(HTTParty::Response) + expect(response.code).to eq(200) + expect(response.parsed_response["vectors"]).to eq([{"id" => "document1#1"}, {"id" => "document1#2"}, {"id" => "document2#1"}]) + end + + it "returns vector IDs with a specific prefix" do + response = index.list(namespace: namespace, prefix: "document1#") + expect(response).to be_a(HTTParty::Response) + expect(response.code).to eq(200) + expect(response.parsed_response["vectors"]).to eq([{"id" => "document1#1"}, {"id" => "document1#2"}]) + end + + it "respects the limit parameter" do + index.list(namespace: namespace, limit: 2) + response = index.list(namespace: namespace, limit: 2) + expect(response).to be_a(HTTParty::Response) + expect(response.code).to eq(200) + expect(response.parsed_response["vectors"].length).to eq(2) + end + + it "handles pagination" do + first_response = index.list(namespace: namespace, limit: 2) + expect(first_response.parsed_response["vectors"].length).to eq(2) + expect(first_response.parsed_response["pagination"]).to have_key("next") + + second_response = index.list(namespace: namespace, limit: 2, pagination_token: first_response.parsed_response["pagination"]["next"]) + expect(second_response.parsed_response["vectors"].length).to eq(1) + expect(second_response.parsed_response).not_to have_key("pagination") + + all_ids = (first_response.parsed_response["vectors"] + second_response.parsed_response["vectors"]) + expect(all_ids).to eq([{"id" => "document1#1"}, {"id" => "document1#2"}, {"id" => "document2#1"}]) + end + end + + describe "error handling" do + it "handles invalid limit" do + response = index.list(namespace: namespace, limit: 10001) # Assuming 10000 is max limit + expect(response).to be_a(HTTParty::Response) + expect(response.code).to eq(400) + end + end + end + + # Total Vector Count can take awhile + def wait_for_upsert_completion(expected_count:) + timeout = 20 + interval = 0.5 + Timeout.timeout(timeout) do + loop do + response = index.describe_index_stats + break if response.parsed_response["totalVectorCount"] == expected_count + sleep interval + end + end + rescue Timeout::Error + raise "Timed out waiting for upsert to complete" + end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2b3d300..c9ad784 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,7 +9,10 @@ c.hook_into :webmock c.cassette_library_dir = "spec/cassettes" c.configure_rspec_metadata! - c.default_cassette_options = {record: (ENV["NO_VCR"] == "true") ? :all : :new_episodes} + c.default_cassette_options = { + record: (ENV["NO_VCR"] == "true") ? :all : :new_episodes, + clean_outdated_http_interactions: true + } c.filter_sensitive_data("") { Pinecone.configuration.api_key } c.filter_sensitive_data("") { Pinecone.configuration.environment } end @@ -21,4 +24,20 @@ config.environment = ENV.fetch("PINECONE_ENVIRONMENT") end end + + c.after(:all) do + Pinecone.configure do |config| + config.api_key = ENV.fetch("PINECONE_API_KEY") + config.environment = ENV.fetch("PINECONE_ENVIRONMENT") + end + pinecone = Pinecone::Client.new + ["serverless-index", "server-index"].each do |index_name| + VCR.use_cassette("clear_index") do + index = pinecone.index(index_name) + ["example-namespace", ""].each do |namespace| + index.delete(delete_all: true, namespace: namespace) + end + end + end + end end diff --git a/spec/support/setup.rb b/spec/support/setup.rb index 613782c..652830d 100644 --- a/spec/support/setup.rb +++ b/spec/support/setup.rb @@ -17,10 +17,22 @@ end client = Pinecone::Index.new -indices = ["example-index-1", "example-index-2"] -valid_attributes = { +indices = ["serverless-index", "server-index"] +serverless_valid_attributes = { metric: "dotproduct", - name: "example-index-1", + name: "serverless-index", + dimension: 3, + spec: { + serverless: { + cloud: "aws", + region: "us-east-1" + } + } +} + +server_valid_attributes = { + metric: "dotproduct", + name: "server-index", dimension: 3, spec: { pod: { @@ -37,8 +49,9 @@ when "start" indices.each do |index_name| puts "Setting up #{index_name}" - valid_attributes[:name] = index_name - response = client.create(valid_attributes) + attributes = index_name.start_with?("serverless") ? serverless_valid_attributes : server_valid_attributes + attributes[:name] = index_name + response = client.create(attributes) puts response if response.code != 201 end when "stop"