Class: Pinecone::Client
- Inherits:
-
Object
- Object
- Pinecone::Client
- Defined in:
- lib/pinecone/client.rb
Class Method Summary collapse
- .delete(path:, prefix: '') ⇒ Object
-
.get(path:, prefix: '') ⇒ Object
# HTTP Helpers.
- .json_patch(path:, prefix: '', parameters:) ⇒ Object
- .json_post(path:, prefix: '', parameters:) ⇒ Object
- .multipart_post(path:, prefix: '', parameters: nil) ⇒ Object
- .project_name ⇒ Object
Instance Method Summary collapse
-
#indexes ⇒ Object
# Vectors API.
-
#initialize(api_key: nil, environment: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key: nil, environment: nil) ⇒ Client
Returns a new instance of Client.
3 4 5 6 |
# File 'lib/pinecone/client.rb', line 3 def initialize(api_key: nil, environment: nil) Pinecone.configuration.api_key = api_key if api_key Pinecone.configuration.environment = environment if environment end |
Class Method Details
.delete(path:, prefix: '') ⇒ Object
47 48 49 50 51 52 |
# File 'lib/pinecone/client.rb', line 47 def self.delete(path:, prefix: '') HTTParty.delete( uri(path: path, prefix: prefix), headers: headers ) end |
.get(path:, prefix: '') ⇒ Object
# HTTP Helpers
16 17 18 19 20 21 |
# File 'lib/pinecone/client.rb', line 16 def self.get(path:, prefix: '') HTTParty.get( uri(path: path, prefix: prefix), headers: headers ) end |
.json_patch(path:, prefix: '', parameters:) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/pinecone/client.rb', line 31 def self.json_patch(path:, prefix: '', parameters:) HTTParty.patch( uri(path: path, prefix: prefix), headers: headers, body: parameters&.to_json ) end |
.json_post(path:, prefix: '', parameters:) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/pinecone/client.rb', line 23 def self.json_post(path:, prefix: '', parameters:) HTTParty.post( uri(path: path, prefix: prefix), headers: headers, body: parameters&.to_json ) end |
.multipart_post(path:, prefix: '', parameters: nil) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/pinecone/client.rb', line 39 def self.multipart_post(path:, prefix: '', parameters: nil) HTTParty.post( uri(path: path, prefix: prefix), headers: headers.merge({ "Content-Type" => "multipart/form-data" }), body: parameters ) end |