Class: Qdrant::Client
- Inherits:
-
Object
- Object
- Qdrant::Client
- Extended by:
- Forwardable
- Defined in:
- lib/qdrant/client.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#raise_error ⇒ Object
readonly
Returns the value of attribute raise_error.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #aliases ⇒ Object
- #clusters ⇒ Object
- #collections ⇒ Object
- #connection ⇒ Object
-
#initialize(url:, api_key: nil, adapter: Faraday.default_adapter, raise_error: false) ⇒ Client
constructor
A new instance of Client.
- #points ⇒ Object
- #service ⇒ Object
- #snapshots ⇒ Object
Constructor Details
#initialize(url:, api_key: nil, adapter: Faraday.default_adapter, raise_error: false) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/qdrant/client.rb', line 14 def initialize( url:, api_key: nil, adapter: Faraday.default_adapter, raise_error: false ) @url = url @api_key = api_key @adapter = adapter @raise_error = raise_error end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
10 11 12 |
# File 'lib/qdrant/client.rb', line 10 def adapter @adapter end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/qdrant/client.rb', line 10 def api_key @api_key end |
#raise_error ⇒ Object (readonly)
Returns the value of attribute raise_error.
10 11 12 |
# File 'lib/qdrant/client.rb', line 10 def raise_error @raise_error end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/qdrant/client.rb', line 10 def url @url end |
Instance Method Details
#aliases ⇒ Object
38 39 40 |
# File 'lib/qdrant/client.rb', line 38 def aliases @aliases ||= Qdrant::Aliases.new(client: self).list end |
#clusters ⇒ Object
54 55 56 |
# File 'lib/qdrant/client.rb', line 54 def clusters @clusters ||= Qdrant::Clusters.new(client: self) end |
#collections ⇒ Object
42 43 44 |
# File 'lib/qdrant/client.rb', line 42 def collections @collections ||= Qdrant::Collections.new(client: self) end |
#connection ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/qdrant/client.rb', line 26 def connection @connection ||= Faraday.new(url: url) do |faraday| if api_key faraday.headers["api-key"] = api_key end faraday.request :json faraday.response :raise_error if raise_error faraday.response :json, content_type: /\bjson$/ faraday.adapter adapter end end |
#points ⇒ Object
58 59 60 |
# File 'lib/qdrant/client.rb', line 58 def points @points ||= Qdrant::Points.new(client: self) end |