Skip to content

Commit 6d18f59

Browse files
Merge branch 'master' into add-near_image-option
2 parents b03ea21 + 298459e commit 6d18f59

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
weaviate-ruby (0.7.1)
4+
weaviate-ruby (0.7.2)
55
faraday (~> 2.7)
66
graphlient (~> 0.7.0)
77

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Ruby wrapper for the Weaviate.io API
1010

11-
![Tests status](https://github.com/andreibondarev/weaviate-ruby/actions/workflows/ci.yml/badge.svg)
11+
![Tests status](https://github.com/andreibondarev/weaviate-ruby/actions/workflows/ci.yml/badge.svg) [![Gem Version](https://badge.fury.io/rb/weaviate-ruby.svg)](https://badge.fury.io/rb/weaviate-ruby)
1212

1313
## Installation
1414

@@ -172,6 +172,7 @@ client.objects.batch_delete(
172172
near_text = '{ concepts: ["biology"] }'
173173
sort_obj = '{ path: ["category"], order: desc }'
174174
where_obj = '{ path: ["id"], operator: Equal, valueString: "..." }'
175+
with_hybrid = '{ query: "Sweets", alpha: 0.5 }'
175176

176177
client.query.get(
177178
class_name: 'Question',
@@ -187,13 +188,13 @@ client.query.get(
187188
near_text: near_text,
188189

189190
# To use this parameter you must have created your schema by setting the `vectorizer:` property to 'multi2vec-clip' or 'img2vec-neural'
190-
# near_image: ...,
191+
near_image: near_image,
191192

192-
# hybrid: ...,
193+
with_hybrid: with_hybrid,
193194

194-
# bm25: ...,
195+
bm25: bm25,
195196

196-
# near_object: ...,
197+
near_object: near_object,
197198

198199
ask: '{ question: "your-question?" }'
199200
)

lib/weaviate/query.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def get(
1414
near_vector: nil,
1515
near_image: nil,
1616
near_object: nil,
17+
with_hybrid: nil,
18+
bm25: nil,
1719
ask: nil
1820
)
1921
response = client.graphql.execute(
@@ -26,6 +28,8 @@ def get(
2628
near_vector: near_vector,
2729
near_image: near_image,
2830
near_object: near_object,
31+
with_hybrid: with_hybrid,
32+
bm25: bm25,
2933
ask: ask
3034
),
3135
after: after,
@@ -133,6 +137,8 @@ def get_query(
133137
near_vector: nil,
134138
near_image: nil,
135139
near_object: nil,
140+
with_hybrid: nil,
141+
bm25: nil,
136142
ask: nil,
137143
sort: nil
138144
)
@@ -151,6 +157,8 @@ def get_query(
151157
#{near_vector.present? ? "nearVector: #{near_vector}" : ""},
152158
#{near_image.present? ? "nearImage: #{near_image}" : ""},
153159
#{near_object.present? ? "nearObject: #{near_object}" : ""},
160+
#{with_hybrid.present? ? "hybrid: #{with_hybrid}" : ""},
161+
#{bm25.present? ? "bm25: #{bm25}" : ""},
154162
#{ask.present? ? "ask: #{ask}" : ""},
155163
#{where.present? ? "where: #{where}" : ""},
156164
#{sort.present? ? "sort: #{sort}" : ""}

lib/weaviate/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Weaviate
4-
VERSION = "0.7.1"
4+
VERSION = "0.7.2"
55
end

0 commit comments

Comments
 (0)