qdrant-ruby 0.9.8 → 0.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c009d0edf98ba90d6d37eeae04d16ae3900f6c66ac25a231b5d4dd2b0ecb7a0d
4
- data.tar.gz: f44fb8454d573445758885eeb2d4141c5f2877ac0b89df368e2a75104b511eaa
3
+ metadata.gz: fb6e4fdc4875c35aa2a6e4a921fae8fd79c7407ec4d20395382829e843e33827
4
+ data.tar.gz: eb54d1c1e4cafb05a792c990325a633cb42dcaae8231c3f2246af285578a6b77
5
5
  SHA512:
6
- metadata.gz: d2752bb4b95bba1eed39e37a1393feb4f2fb8ca97bbf2bd1fcf1e09b53dad77fc519fb3a46c1616fd318a06a8cf6a6c965de5c0a2c49eb2a16efde0a90bf9769
7
- data.tar.gz: e710fd046dffa50fe269d82c320334196c26098d5d9c629559c3ff247d9bddeddefc0654476f1307fa2f03023840aecfac64b9be5397366c31c20fc42f559d8e
6
+ metadata.gz: 7db835fa9f01ba9c1ada4732c0a21b531ded39088edc5f523fa12226275f595ec434d7be1f83040c1f7534002f8fdded17b9b26cf1b1beb3c87ea03e5476085c
7
+ data.tar.gz: 06017bfade0b83bde059a15012c53cb943a56b61bce6be10d906f449e599b0e8275b5ba492502a4846ed75bdbbbc7bbbe09595cc27325cee8eddafda53ba6386
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.9.9] - 2024-04-11
4
+ - Allow sparse_vectors to be passed to collections.create
5
+ - Support query endpoint
6
+
3
7
  ## [0.9.8] - 2024-10-01
4
8
  - Qdrant::Client constructor accepts customer logger: to be passed in
5
9
 
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in qdrant.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.0"
8
+ gem "rake", "~> 13.2"
9
9
 
10
- gem "rspec", "~> 3.0"
11
- gem "standard", "~> 1.25.0"
10
+ gem "rspec", "~> 3.13"
11
+ gem "standard", "~> 1.28.5"
data/Gemfile.lock CHANGED
@@ -1,74 +1,88 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qdrant-ruby (0.9.8)
4
+ qdrant-ruby (0.9.9)
5
5
  faraday (>= 2.0.1, < 3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
+ base64 (0.2.0)
11
12
  byebug (11.1.3)
12
13
  coderay (1.1.3)
13
- diff-lcs (1.5.0)
14
- faraday (2.7.10)
14
+ diff-lcs (1.5.1)
15
+ faraday (2.8.1)
16
+ base64
15
17
  faraday-net_http (>= 2.0, < 3.1)
16
18
  ruby2_keywords (>= 0.0.4)
17
19
  faraday-net_http (3.0.2)
18
- json (2.6.3)
20
+ json (2.7.4)
19
21
  language_server-protocol (3.17.0.3)
22
+ lint_roller (1.1.0)
20
23
  method_source (1.0.0)
21
- parallel (1.22.1)
22
- parser (3.2.1.1)
24
+ parallel (1.24.0)
25
+ parser (3.3.5.0)
23
26
  ast (~> 2.4.1)
27
+ racc
24
28
  pry (0.14.2)
25
29
  coderay (~> 1.1)
26
30
  method_source (~> 1.0)
27
31
  pry-byebug (3.10.1)
28
32
  byebug (~> 11.0)
29
33
  pry (>= 0.13, < 0.15)
34
+ racc (1.8.1)
30
35
  rainbow (3.1.1)
31
- rake (13.0.6)
32
- regexp_parser (2.7.0)
33
- rexml (3.2.5)
34
- rspec (3.11.0)
35
- rspec-core (~> 3.11.0)
36
- rspec-expectations (~> 3.11.0)
37
- rspec-mocks (~> 3.11.0)
38
- rspec-core (3.11.0)
39
- rspec-support (~> 3.11.0)
40
- rspec-expectations (3.11.0)
36
+ rake (13.2.1)
37
+ regexp_parser (2.9.2)
38
+ rexml (3.3.9)
39
+ rspec (3.13.0)
40
+ rspec-core (~> 3.13.0)
41
+ rspec-expectations (~> 3.13.0)
42
+ rspec-mocks (~> 3.13.0)
43
+ rspec-core (3.13.2)
44
+ rspec-support (~> 3.13.0)
45
+ rspec-expectations (3.13.3)
41
46
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.11.0)
43
- rspec-mocks (3.11.1)
47
+ rspec-support (~> 3.13.0)
48
+ rspec-mocks (3.13.2)
44
49
  diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.11.0)
46
- rspec-support (3.11.0)
47
- rubocop (1.48.1)
50
+ rspec-support (~> 3.13.0)
51
+ rspec-support (3.13.1)
52
+ rubocop (1.50.2)
48
53
  json (~> 2.3)
49
54
  parallel (~> 1.10)
50
55
  parser (>= 3.2.0.0)
51
56
  rainbow (>= 2.2.2, < 4.0)
52
57
  regexp_parser (>= 1.8, < 3.0)
53
58
  rexml (>= 3.2.5, < 4.0)
54
- rubocop-ast (>= 1.26.0, < 2.0)
59
+ rubocop-ast (>= 1.28.0, < 2.0)
55
60
  ruby-progressbar (~> 1.7)
56
61
  unicode-display_width (>= 2.4.0, < 3.0)
57
- rubocop-ast (1.28.0)
62
+ rubocop-ast (1.30.0)
58
63
  parser (>= 3.2.1.0)
59
64
  rubocop-performance (1.16.0)
60
65
  rubocop (>= 1.7.0, < 2.0)
61
66
  rubocop-ast (>= 0.4.0)
62
67
  ruby-progressbar (1.13.0)
63
68
  ruby2_keywords (0.0.5)
64
- standard (1.25.3)
69
+ standard (1.28.5)
65
70
  language_server-protocol (~> 3.17.0.2)
66
- rubocop (~> 1.48.1)
71
+ lint_roller (~> 1.0)
72
+ rubocop (~> 1.50.2)
73
+ standard-custom (~> 1.0.0)
74
+ standard-performance (~> 1.0.1)
75
+ standard-custom (1.0.2)
76
+ lint_roller (~> 1.0)
77
+ rubocop (~> 1.50)
78
+ standard-performance (1.0.1)
79
+ lint_roller (~> 1.0)
67
80
  rubocop-performance (~> 1.16.0)
68
- unicode-display_width (2.4.2)
81
+ unicode-display_width (2.6.0)
69
82
 
70
83
  PLATFORMS
71
84
  arm64-darwin-23
85
+ arm64-darwin-24
72
86
  x86_64-darwin-19
73
87
  x86_64-darwin-21
74
88
  x86_64-linux
@@ -76,9 +90,9 @@ PLATFORMS
76
90
  DEPENDENCIES
77
91
  pry-byebug (~> 3.9)
78
92
  qdrant-ruby!
79
- rake (~> 13.0)
80
- rspec (~> 3.0)
81
- standard (~> 1.25.0)
93
+ rake (~> 13.2)
94
+ rspec (~> 3.13)
95
+ standard (~> 1.28.5)
82
96
 
83
97
  BUNDLED WITH
84
98
  2.4.0
@@ -20,6 +20,7 @@ module Qdrant
20
20
  def create(
21
21
  collection_name:,
22
22
  vectors:,
23
+ sparse_vectors: nil,
23
24
  shard_number: nil,
24
25
  replication_factor: nil,
25
26
  write_consistency_factor: nil,
@@ -33,6 +34,7 @@ module Qdrant
33
34
  response = client.connection.put("#{PATH}/#{collection_name}") do |req|
34
35
  req.body = {}
35
36
  req.body["vectors"] = vectors
37
+ req.body["sparse_vectors"] = sparse_vectors unless sparse_vectors.nil?
36
38
  req.body["shard_number"] = shard_number unless shard_number.nil?
37
39
  req.body["replication_factor"] = replication_factor unless replication_factor.nil?
38
40
  req.body["write_consistency_factor"] = write_consistency_factor unless write_consistency_factor.nil?
data/lib/qdrant/points.rb CHANGED
@@ -294,6 +294,45 @@ module Qdrant
294
294
  response.body
295
295
  end
296
296
 
297
+ # Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries.
298
+ def query(
299
+ collection_name:,
300
+ consistency: nil,
301
+ timeout: nil,
302
+ shard_key: nil,
303
+ prefetch: nil,
304
+ query: nil,
305
+ using: nil,
306
+ filter: nil,
307
+ params: nil,
308
+ score_threshold: nil,
309
+ limit: nil,
310
+ offset: nil,
311
+ with_vector: nil,
312
+ with_payload: nil,
313
+ lookup_from: nil
314
+ )
315
+ response = client.connection.post("collections/#{collection_name}/#{PATH}/query") do |req|
316
+ req.params["consistency"] = consistency unless consistency.nil?
317
+ req.params["timeout"] = timeout unless timeout.nil?
318
+
319
+ req.body = {}
320
+ req.body["shard_key"] = shard_key unless shard_key.nil?
321
+ req.body["prefetch"] = prefetch unless prefetch.nil?
322
+ req.body["query"] = query unless query.nil?
323
+ req.body["using"] = using unless using.nil?
324
+ req.body["filter"] = filter unless filter.nil?
325
+ req.body["params"] = params unless params.nil?
326
+ req.body["score_threshold"] = score_threshold unless score_threshold.nil?
327
+ req.body["limit"] = limit unless limit.nil?
328
+ req.body["offset"] = offset unless offset.nil?
329
+ req.body["with_vector"] = with_vector unless with_vector.nil?
330
+ req.body["with_payload"] = with_payload unless with_payload.nil?
331
+ req.body["lookup_from"] = lookup_from unless lookup_from.nil?
332
+ end
333
+ response.body
334
+ end
335
+
297
336
  # Count points which matches given filtering condition
298
337
  def count(
299
338
  collection_name:,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Qdrant
4
- VERSION = "0.9.8"
4
+ VERSION = "0.9.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qdrant-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Bondarev
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
10
+ date: 2025-04-11 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -79,7 +78,6 @@ metadata:
79
78
  homepage_uri: https://github.com/andreibondarev/qdrant-ruby
80
79
  source_code_uri: https://github.com/andreibondarev/qdrant-ruby
81
80
  changelog_uri: https://github.com/andreibondarev/qdrant-ruby/CHANGELOG.md
82
- post_install_message:
83
81
  rdoc_options: []
84
82
  require_paths:
85
83
  - lib
@@ -94,8 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
92
  - !ruby/object:Gem::Version
95
93
  version: '0'
96
94
  requirements: []
97
- rubygems_version: 3.5.11
98
- signing_key:
95
+ rubygems_version: 3.6.2
99
96
  specification_version: 4
100
97
  summary: Ruby wrapper for the Qdrant vector search database API
101
98
  test_files: []