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.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#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, logger: nil) ⇒ 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, logger: nil) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/qdrant/client.rb', line 14 def initialize( url:, api_key: nil, adapter: Faraday.default_adapter, raise_error: false, logger: nil ) @url = url @api_key = api_key @adapter = adapter @raise_error = raise_error @logger = logger || Logger.new($stdout) 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 |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
10 11 12 |
# File 'lib/qdrant/client.rb', line 10 def logger @logger 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
41 42 43 |
# File 'lib/qdrant/client.rb', line 41 def aliases @aliases ||= Qdrant::Aliases.new(client: self).list end |
#clusters ⇒ Object
57 58 59 |
# File 'lib/qdrant/client.rb', line 57 def clusters @clusters ||= Qdrant::Clusters.new(client: self) end |
#collections ⇒ Object
45 46 47 |
# File 'lib/qdrant/client.rb', line 45 def collections @collections ||= Qdrant::Collections.new(client: self) end |
#connection ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/qdrant/client.rb', line 28 def connection @connection ||= Faraday.new(url: url) do |faraday| if api_key faraday.headers["api-key"] = api_key end faraday.request :json faraday.response :logger, @logger, {headers: true, bodies: true, errors: true} faraday.response :raise_error if raise_error faraday.response :json, content_type: /\bjson$/ faraday.adapter adapter end end |
#points ⇒ Object
61 62 63 |
# File 'lib/qdrant/client.rb', line 61 def points @points ||= Qdrant::Points.new(client: self) end |