langchainrb_rails 0.1.7 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1d6c529266751fa4ea1c1012d4880d7351825b3d63bab077011d61e0d98364e
4
- data.tar.gz: 6a8f9d5c2a960b8da82a323930355e7e690d0906d9800c73b514428a6f988ab4
3
+ metadata.gz: dd852fd63863fc606ef15050595f869d0c5d51a59af35378a7ef12e74f630c43
4
+ data.tar.gz: a7c97f6ca363c8a601b912b228aab5c3f7c8e729501c05ebbb36edfa4814891e
5
5
  SHA512:
6
- metadata.gz: 065072fe2494a55c0c770f3362932c2e87bccd76cc1dd057a27b3e128ec2f7e62d0bc4430a36ce233f02c817aaa96c3ca583056c50b95c56be99f2c89407d1b9
7
- data.tar.gz: 714f28fbd371169f221ddd86d87b18b18a89e45806feb58943a888c50063d5cce2b8b55be0d689ba60de48d85e15bc934a25f0ff9f1b3c205dbb5879a8d82dc5
6
+ metadata.gz: 7f7936870a0db496121851ee4a40aea28f25c4ab9e9d909cd3e5d70bd0fe74a06c1539afe56ab7a3848bf31e6f42c62906f3e2157bc96898ffe08e36cc1ecb48
7
+ data.tar.gz: f5a6e6934991b462bf5034b10b17ce79713d573d6c6d65ed08ff1b26b359151892647293b3e96649baec08e034d0298367c52e65438f15b2e2dbc2665ef5f98e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.9] - 2024-04-19
4
+ - Bump langchainrb gem to include v0.11.x
5
+ - Remove pg_vector Overriding Operator Constants
6
+
7
+ ## [0.1.8] - 2024-03-16
8
+ - Bump langchainrb gem
9
+
3
10
  ## [0.1.7] - 2024-01-29
4
11
  - Fix Pgvector#ask method
5
12
 
data/Gemfile CHANGED
@@ -5,9 +5,9 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in langchainrb_rails.gemspec
6
6
  gemspec
7
7
 
8
- gem "rake", "~> 13.1"
8
+ gem "rake", "~> 13.2"
9
9
 
10
- gem "rspec", "~> 3.0"
10
+ gem "rspec", "~> 3.13"
11
11
 
12
12
  gem "bundler-audit", require: false
13
13
  gem "brakeman", require: false
data/Gemfile.lock CHANGED
@@ -1,41 +1,41 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- langchainrb_rails (0.1.7)
5
- langchainrb (>= 0.7, < 0.10)
4
+ langchainrb_rails (0.1.9)
5
+ langchainrb (>= 0.7, < 0.12)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actioncable (7.1.3)
11
- actionpack (= 7.1.3)
12
- activesupport (= 7.1.3)
10
+ actioncable (7.1.3.2)
11
+ actionpack (= 7.1.3.2)
12
+ activesupport (= 7.1.3.2)
13
13
  nio4r (~> 2.0)
14
14
  websocket-driver (>= 0.6.1)
15
15
  zeitwerk (~> 2.6)
16
- actionmailbox (7.1.3)
17
- actionpack (= 7.1.3)
18
- activejob (= 7.1.3)
19
- activerecord (= 7.1.3)
20
- activestorage (= 7.1.3)
21
- activesupport (= 7.1.3)
16
+ actionmailbox (7.1.3.2)
17
+ actionpack (= 7.1.3.2)
18
+ activejob (= 7.1.3.2)
19
+ activerecord (= 7.1.3.2)
20
+ activestorage (= 7.1.3.2)
21
+ activesupport (= 7.1.3.2)
22
22
  mail (>= 2.7.1)
23
23
  net-imap
24
24
  net-pop
25
25
  net-smtp
26
- actionmailer (7.1.3)
27
- actionpack (= 7.1.3)
28
- actionview (= 7.1.3)
29
- activejob (= 7.1.3)
30
- activesupport (= 7.1.3)
26
+ actionmailer (7.1.3.2)
27
+ actionpack (= 7.1.3.2)
28
+ actionview (= 7.1.3.2)
29
+ activejob (= 7.1.3.2)
30
+ activesupport (= 7.1.3.2)
31
31
  mail (~> 2.5, >= 2.5.4)
32
32
  net-imap
33
33
  net-pop
34
34
  net-smtp
35
35
  rails-dom-testing (~> 2.2)
36
- actionpack (7.1.3)
37
- actionview (= 7.1.3)
38
- activesupport (= 7.1.3)
36
+ actionpack (7.1.3.2)
37
+ actionview (= 7.1.3.2)
38
+ activesupport (= 7.1.3.2)
39
39
  nokogiri (>= 1.8.5)
40
40
  racc
41
41
  rack (>= 2.2.4)
@@ -43,35 +43,35 @@ GEM
43
43
  rack-test (>= 0.6.3)
44
44
  rails-dom-testing (~> 2.2)
45
45
  rails-html-sanitizer (~> 1.6)
46
- actiontext (7.1.3)
47
- actionpack (= 7.1.3)
48
- activerecord (= 7.1.3)
49
- activestorage (= 7.1.3)
50
- activesupport (= 7.1.3)
46
+ actiontext (7.1.3.2)
47
+ actionpack (= 7.1.3.2)
48
+ activerecord (= 7.1.3.2)
49
+ activestorage (= 7.1.3.2)
50
+ activesupport (= 7.1.3.2)
51
51
  globalid (>= 0.6.0)
52
52
  nokogiri (>= 1.8.5)
53
- actionview (7.1.3)
54
- activesupport (= 7.1.3)
53
+ actionview (7.1.3.2)
54
+ activesupport (= 7.1.3.2)
55
55
  builder (~> 3.1)
56
56
  erubi (~> 1.11)
57
57
  rails-dom-testing (~> 2.2)
58
58
  rails-html-sanitizer (~> 1.6)
59
- activejob (7.1.3)
60
- activesupport (= 7.1.3)
59
+ activejob (7.1.3.2)
60
+ activesupport (= 7.1.3.2)
61
61
  globalid (>= 0.3.6)
62
- activemodel (7.1.3)
63
- activesupport (= 7.1.3)
64
- activerecord (7.1.3)
65
- activemodel (= 7.1.3)
66
- activesupport (= 7.1.3)
62
+ activemodel (7.1.3.2)
63
+ activesupport (= 7.1.3.2)
64
+ activerecord (7.1.3.2)
65
+ activemodel (= 7.1.3.2)
66
+ activesupport (= 7.1.3.2)
67
67
  timeout (>= 0.4.0)
68
- activestorage (7.1.3)
69
- actionpack (= 7.1.3)
70
- activejob (= 7.1.3)
71
- activerecord (= 7.1.3)
72
- activesupport (= 7.1.3)
68
+ activestorage (7.1.3.2)
69
+ actionpack (= 7.1.3.2)
70
+ activejob (= 7.1.3.2)
71
+ activerecord (= 7.1.3.2)
72
+ activesupport (= 7.1.3.2)
73
73
  marcel (~> 1.0)
74
- activesupport (7.1.3)
74
+ activesupport (7.1.3.2)
75
75
  base64
76
76
  bigdecimal
77
77
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -84,10 +84,10 @@ GEM
84
84
  addressable (2.8.6)
85
85
  public_suffix (>= 2.0.2, < 6.0)
86
86
  ast (2.4.2)
87
- baran (0.1.10)
87
+ baran (0.1.11)
88
88
  base64 (0.2.0)
89
- bigdecimal (3.1.6)
90
- brakeman (6.1.1)
89
+ bigdecimal (3.1.7)
90
+ brakeman (6.1.2)
91
91
  racc
92
92
  builder (3.2.4)
93
93
  bundler-audit (0.9.1)
@@ -95,33 +95,33 @@ GEM
95
95
  thor (~> 1.0)
96
96
  byebug (11.1.3)
97
97
  coderay (1.1.3)
98
- colorize (0.8.1)
98
+ colorize (1.1.0)
99
99
  concurrent-ruby (1.2.3)
100
100
  connection_pool (2.4.1)
101
101
  crass (1.0.6)
102
102
  date (3.3.4)
103
- diff-lcs (1.5.0)
104
- drb (2.2.0)
105
- ruby2_keywords
103
+ diff-lcs (1.5.1)
104
+ drb (2.2.1)
106
105
  erubi (1.12.0)
107
106
  globalid (1.2.1)
108
107
  activesupport (>= 6.1)
109
- i18n (1.14.1)
108
+ i18n (1.14.4)
110
109
  concurrent-ruby (~> 1.0)
111
110
  io-console (0.7.2)
112
- irb (1.11.1)
111
+ irb (1.11.2)
113
112
  rdoc
114
113
  reline (>= 0.4.2)
115
- json (2.7.1)
116
- json-schema (4.0.0)
114
+ json (2.7.2)
115
+ json-schema (4.3.0)
117
116
  addressable (>= 2.8)
118
- langchainrb (0.9.0)
117
+ langchainrb (0.11.4)
118
+ activesupport (>= 7.0.8)
119
119
  baran (~> 0.1.9)
120
- colorize (~> 0.8.1)
121
- json-schema (~> 4.0.0)
120
+ colorize (~> 1.1.0)
121
+ json-schema (~> 4)
122
122
  matrix
123
123
  pragmatic_segmenter (~> 0.3.0)
124
- tiktoken_ruby (~> 0.0.5)
124
+ tiktoken_ruby (~> 0.0.8)
125
125
  to_bool (~> 2.0.0)
126
126
  zeitwerk (~> 2.5)
127
127
  language_server-protocol (3.17.0.3)
@@ -139,9 +139,9 @@ GEM
139
139
  method_source (1.0.0)
140
140
  mini_mime (1.1.5)
141
141
  mini_portile2 (2.8.5)
142
- minitest (5.21.2)
142
+ minitest (5.22.3)
143
143
  mutex_m (0.2.0)
144
- net-imap (0.4.9.1)
144
+ net-imap (0.4.10)
145
145
  date
146
146
  net-protocol
147
147
  net-pop (0.1.2)
@@ -151,15 +151,15 @@ GEM
151
151
  net-smtp (0.4.0.1)
152
152
  net-protocol
153
153
  nio4r (2.7.0)
154
- nokogiri (1.16.0)
154
+ nokogiri (1.16.2)
155
155
  mini_portile2 (~> 2.8.2)
156
156
  racc (~> 1.4)
157
- nokogiri (1.16.0-x86_64-darwin)
157
+ nokogiri (1.16.2-x86_64-darwin)
158
158
  racc (~> 1.4)
159
- nokogiri (1.16.0-x86_64-linux)
159
+ nokogiri (1.16.2-x86_64-linux)
160
160
  racc (~> 1.4)
161
161
  parallel (1.24.0)
162
- parser (3.2.2.4)
162
+ parser (3.3.0.5)
163
163
  ast (~> 2.4.1)
164
164
  racc
165
165
  pragmatic_segmenter (0.3.23)
@@ -172,9 +172,9 @@ GEM
172
172
  pry (>= 0.13, < 0.15)
173
173
  psych (5.1.2)
174
174
  stringio
175
- public_suffix (5.0.4)
175
+ public_suffix (5.0.5)
176
176
  racc (1.7.3)
177
- rack (3.0.8)
177
+ rack (3.0.9.1)
178
178
  rack-session (2.0.0)
179
179
  rack (>= 3.0.0)
180
180
  rack-test (2.1.0)
@@ -182,20 +182,20 @@ GEM
182
182
  rackup (2.1.0)
183
183
  rack (>= 3)
184
184
  webrick (~> 1.8)
185
- rails (7.1.3)
186
- actioncable (= 7.1.3)
187
- actionmailbox (= 7.1.3)
188
- actionmailer (= 7.1.3)
189
- actionpack (= 7.1.3)
190
- actiontext (= 7.1.3)
191
- actionview (= 7.1.3)
192
- activejob (= 7.1.3)
193
- activemodel (= 7.1.3)
194
- activerecord (= 7.1.3)
195
- activestorage (= 7.1.3)
196
- activesupport (= 7.1.3)
185
+ rails (7.1.3.2)
186
+ actioncable (= 7.1.3.2)
187
+ actionmailbox (= 7.1.3.2)
188
+ actionmailer (= 7.1.3.2)
189
+ actionpack (= 7.1.3.2)
190
+ actiontext (= 7.1.3.2)
191
+ actionview (= 7.1.3.2)
192
+ activejob (= 7.1.3.2)
193
+ activemodel (= 7.1.3.2)
194
+ activerecord (= 7.1.3.2)
195
+ activestorage (= 7.1.3.2)
196
+ activesupport (= 7.1.3.2)
197
197
  bundler (>= 1.15.0)
198
- railties (= 7.1.3)
198
+ railties (= 7.1.3.2)
199
199
  rails-dom-testing (2.2.0)
200
200
  activesupport (>= 5.0.0)
201
201
  minitest
@@ -203,58 +203,57 @@ GEM
203
203
  rails-html-sanitizer (1.6.0)
204
204
  loofah (~> 2.21)
205
205
  nokogiri (~> 1.14)
206
- railties (7.1.3)
207
- actionpack (= 7.1.3)
208
- activesupport (= 7.1.3)
206
+ railties (7.1.3.2)
207
+ actionpack (= 7.1.3.2)
208
+ activesupport (= 7.1.3.2)
209
209
  irb
210
210
  rackup (>= 1.0.0)
211
211
  rake (>= 12.2)
212
212
  thor (~> 1.0, >= 1.2.2)
213
213
  zeitwerk (~> 2.6)
214
214
  rainbow (3.1.1)
215
- rake (13.1.0)
216
- rb_sys (0.9.87)
217
- rdoc (6.6.2)
215
+ rake (13.2.1)
216
+ rb_sys (0.9.96)
217
+ rdoc (6.6.3.1)
218
218
  psych (>= 4.0.0)
219
- regexp_parser (2.8.3)
220
- reline (0.4.2)
219
+ regexp_parser (2.9.0)
220
+ reline (0.4.3)
221
221
  io-console (~> 0.5)
222
222
  rexml (3.2.6)
223
- rspec (3.12.0)
224
- rspec-core (~> 3.12.0)
225
- rspec-expectations (~> 3.12.0)
226
- rspec-mocks (~> 3.12.0)
227
- rspec-core (3.12.2)
228
- rspec-support (~> 3.12.0)
229
- rspec-expectations (3.12.3)
223
+ rspec (3.13.0)
224
+ rspec-core (~> 3.13.0)
225
+ rspec-expectations (~> 3.13.0)
226
+ rspec-mocks (~> 3.13.0)
227
+ rspec-core (3.13.0)
228
+ rspec-support (~> 3.13.0)
229
+ rspec-expectations (3.13.0)
230
230
  diff-lcs (>= 1.2.0, < 2.0)
231
- rspec-support (~> 3.12.0)
232
- rspec-mocks (3.12.6)
231
+ rspec-support (~> 3.13.0)
232
+ rspec-mocks (3.13.0)
233
233
  diff-lcs (>= 1.2.0, < 2.0)
234
- rspec-support (~> 3.12.0)
235
- rspec-support (3.12.1)
236
- rubocop (1.59.0)
234
+ rspec-support (~> 3.13.0)
235
+ rspec-support (3.13.0)
236
+ rubocop (1.63.1)
237
237
  json (~> 2.3)
238
238
  language_server-protocol (>= 3.17.0)
239
239
  parallel (~> 1.10)
240
- parser (>= 3.2.2.4)
240
+ parser (>= 3.3.0.2)
241
241
  rainbow (>= 2.2.2, < 4.0)
242
242
  regexp_parser (>= 1.8, < 3.0)
243
243
  rexml (>= 3.2.5, < 4.0)
244
- rubocop-ast (>= 1.30.0, < 2.0)
244
+ rubocop-ast (>= 1.31.1, < 2.0)
245
245
  ruby-progressbar (~> 1.7)
246
246
  unicode-display_width (>= 2.4.0, < 3.0)
247
- rubocop-ast (1.30.0)
248
- parser (>= 3.2.1.0)
247
+ rubocop-ast (1.31.2)
248
+ parser (>= 3.3.0.4)
249
249
  rubocop-performance (1.20.1)
250
250
  rubocop (>= 1.48.1, < 2.0)
251
251
  rubocop-ast (>= 1.30.0, < 2.0)
252
252
  ruby-progressbar (1.13.0)
253
- ruby2_keywords (0.0.5)
254
- standard (1.33.0)
253
+ standard (1.34.0)
255
254
  language_server-protocol (~> 3.17.0.2)
256
255
  lint_roller (~> 1.0)
257
- rubocop (~> 1.59.0)
256
+ rubocop (~> 1.60)
258
257
  standard-custom (~> 1.0.0)
259
258
  standard-performance (~> 1.3)
260
259
  standard-custom (1.0.2)
@@ -267,10 +266,10 @@ GEM
267
266
  standard
268
267
  stringio (3.1.0)
269
268
  thor (1.3.0)
270
- tiktoken_ruby (0.0.6)
271
- rb_sys (~> 0.9.68)
272
- tiktoken_ruby (0.0.6-x86_64-darwin)
273
- tiktoken_ruby (0.0.6-x86_64-linux)
269
+ tiktoken_ruby (0.0.8)
270
+ rb_sys (>= 0.9.86)
271
+ tiktoken_ruby (0.0.8-x86_64-darwin)
272
+ tiktoken_ruby (0.0.8-x86_64-linux)
274
273
  timeout (0.4.1)
275
274
  to_bool (2.0.0)
276
275
  tzinfo (2.0.6)
@@ -281,8 +280,8 @@ GEM
281
280
  websocket-driver (0.7.6)
282
281
  websocket-extensions (>= 0.1.0)
283
282
  websocket-extensions (0.1.5)
284
- yard (0.9.34)
285
- zeitwerk (2.6.12)
283
+ yard (0.9.36)
284
+ zeitwerk (2.6.13)
286
285
 
287
286
  PLATFORMS
288
287
  ruby
@@ -297,8 +296,8 @@ DEPENDENCIES
297
296
  langchainrb_rails!
298
297
  pry-byebug (~> 3.10.0)
299
298
  rails (> 6.0.0)
300
- rake (~> 13.1)
301
- rspec (~> 3.0)
299
+ rake (~> 13.2)
300
+ rspec (~> 3.13)
302
301
  rubocop
303
302
  standardrb
304
303
  yard (~> 0.9.34)
@@ -15,14 +15,6 @@ module Langchain::Vectorsearch
15
15
  # pgvector = Langchain::Vectorsearch::Pgvector.new(llm:)
16
16
  #
17
17
 
18
- # The operators supported by the PostgreSQL vector search adapter
19
- OPERATORS = [
20
- "cosine",
21
- "euclidean",
22
- "inner_product"
23
- ]
24
- DEFAULT_OPERATOR = "cosine"
25
-
26
18
  attr_reader :operator, :llm
27
19
  attr_accessor :model
28
20
 
@@ -36,7 +28,7 @@ module Langchain::Vectorsearch
36
28
  # These happen in the template files.
37
29
  # depends_on "neighbor"
38
30
 
39
- @operator = DEFAULT_OPERATOR
31
+ @operator = OPERATORS[DEFAULT_OPERATOR]
40
32
 
41
33
  super(llm: llm)
42
34
  end
@@ -112,13 +112,15 @@ module LangchainrbRails
112
112
  # @param k [Integer] The number of results to have in context
113
113
  # @yield [String] Stream responses back one String at a time
114
114
  # @return [String] The answer to the question
115
+ # standard:disable Style/ArgumentsForwarding
115
116
  def ask(question, k: 4, &block)
116
117
  class_variable_get(:@@provider).ask(
117
118
  question: question,
118
119
  k: k,
119
120
  &block
120
- ).completion
121
+ ).chat_completion
121
122
  end
123
+ # standard:enable Style/ArgumentsForwarding
122
124
  end
123
125
  end
124
126
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LangchainrbRails
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: langchainrb_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Bondarev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-29 00:00:00.000000000 Z
11
+ date: 2024-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: langchainrb
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.10'
22
+ version: '0.12'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.10'
32
+ version: '0.12'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: pry-byebug
35
35
  requirement: !ruby/object:Gem::Requirement