langchainrb_rails 0.1.6 → 0.1.8

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: 262c77cc37284572d2ae586351fa8a0de84ab842df2b6145263bb36387107ef6
4
- data.tar.gz: 663f5528780513d3480696f93505146be9d3735e35f5e4da55c33d552d375687
3
+ metadata.gz: 259297f9c3c4d0d7239eed475a6fdc46a313fe7528d55a3c315c1648e39ef8a5
4
+ data.tar.gz: b52f3e2646a2fcb74d8e9c40a9048118c67a41e029b912f32ce8598fa44bcaca
5
5
  SHA512:
6
- metadata.gz: cf3ccaedef7d42260d76d5c923300f466195d981285617f811d0888273134db9d8e23ce3cbb2e994f6f0c3352e7364da9a2256fa9004bd5a06b01c14e79a4ece
7
- data.tar.gz: 47cbfcfc417a4fca10742a6484d9f379f3003c1f97ca6720e3d04937dc7cd3a32332682c160c0f6c727a5ade5e843a685d58c50faa237d812eeee3ad90b99f03
6
+ metadata.gz: b901d34fc8ef4bbf50f2b12d68a39cea02f0df4a7ed18b3477c4ff3862271cbb563e698bcfb98d4673eab61d3be8e6c28119ebd31de4a3f2903cf4ebd7ecc759
7
+ data.tar.gz: 36fe0f8d537a83925a5f248ed5d3e98846bbadccc870b1d254e08e67d9f3520e209ed7dec040eeb932e8a89d092b1f8e11aba1e1b12f3046350909899b86b35d
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.6] - 2023-01-25
3
+ ## [0.1.8] - 2024-03-16
4
+ - Bump langchainrb gem
5
+
6
+ ## [0.1.7] - 2024-01-29
7
+ - Fix Pgvector#ask method
8
+
9
+ ## [0.1.6] - 2024-01-25
4
10
  - Fix bug when multiple ActiveRecord models use vectorsearch
5
11
  - Bump langchainrb version
6
12
  - Avoid extra query when Pgvector is used
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gemspec
7
7
 
8
8
  gem "rake", "~> 13.1"
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.6)
4
+ langchainrb_rails (0.1.8)
5
5
  langchainrb (>= 0.7, < 0.10)
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)
@@ -87,7 +87,7 @@ GEM
87
87
  baran (0.1.10)
88
88
  base64 (0.2.0)
89
89
  bigdecimal (3.1.6)
90
- brakeman (6.1.1)
90
+ brakeman (6.1.2)
91
91
  racc
92
92
  builder (3.2.4)
93
93
  bundler-audit (0.9.1)
@@ -95,12 +95,12 @@ 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)
103
+ diff-lcs (1.5.1)
104
104
  drb (2.2.0)
105
105
  ruby2_keywords
106
106
  erubi (1.12.0)
@@ -109,19 +109,20 @@ GEM
109
109
  i18n (1.14.1)
110
110
  concurrent-ruby (~> 1.0)
111
111
  io-console (0.7.2)
112
- irb (1.11.1)
112
+ irb (1.11.2)
113
113
  rdoc
114
114
  reline (>= 0.4.2)
115
115
  json (2.7.1)
116
- json-schema (4.0.0)
116
+ json-schema (4.1.1)
117
117
  addressable (>= 2.8)
118
- langchainrb (0.9.0)
118
+ langchainrb (0.9.4)
119
+ activesupport (>= 7.0.8)
119
120
  baran (~> 0.1.9)
120
- colorize (~> 0.8.1)
121
- json-schema (~> 4.0.0)
121
+ colorize (~> 1.1.0)
122
+ json-schema (~> 4)
122
123
  matrix
123
124
  pragmatic_segmenter (~> 0.3.0)
124
- tiktoken_ruby (~> 0.0.5)
125
+ tiktoken_ruby (~> 0.0.7)
125
126
  to_bool (~> 2.0.0)
126
127
  zeitwerk (~> 2.5)
127
128
  language_server-protocol (3.17.0.3)
@@ -139,9 +140,9 @@ GEM
139
140
  method_source (1.0.0)
140
141
  mini_mime (1.1.5)
141
142
  mini_portile2 (2.8.5)
142
- minitest (5.21.2)
143
+ minitest (5.22.2)
143
144
  mutex_m (0.2.0)
144
- net-imap (0.4.9.1)
145
+ net-imap (0.4.10)
145
146
  date
146
147
  net-protocol
147
148
  net-pop (0.1.2)
@@ -151,15 +152,15 @@ GEM
151
152
  net-smtp (0.4.0.1)
152
153
  net-protocol
153
154
  nio4r (2.7.0)
154
- nokogiri (1.16.0)
155
+ nokogiri (1.16.2)
155
156
  mini_portile2 (~> 2.8.2)
156
157
  racc (~> 1.4)
157
- nokogiri (1.16.0-x86_64-darwin)
158
+ nokogiri (1.16.2-x86_64-darwin)
158
159
  racc (~> 1.4)
159
- nokogiri (1.16.0-x86_64-linux)
160
+ nokogiri (1.16.2-x86_64-linux)
160
161
  racc (~> 1.4)
161
162
  parallel (1.24.0)
162
- parser (3.2.2.4)
163
+ parser (3.3.0.5)
163
164
  ast (~> 2.4.1)
164
165
  racc
165
166
  pragmatic_segmenter (0.3.23)
@@ -174,7 +175,7 @@ GEM
174
175
  stringio
175
176
  public_suffix (5.0.4)
176
177
  racc (1.7.3)
177
- rack (3.0.8)
178
+ rack (3.0.9.1)
178
179
  rack-session (2.0.0)
179
180
  rack (>= 3.0.0)
180
181
  rack-test (2.1.0)
@@ -182,20 +183,20 @@ GEM
182
183
  rackup (2.1.0)
183
184
  rack (>= 3)
184
185
  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)
186
+ rails (7.1.3.2)
187
+ actioncable (= 7.1.3.2)
188
+ actionmailbox (= 7.1.3.2)
189
+ actionmailer (= 7.1.3.2)
190
+ actionpack (= 7.1.3.2)
191
+ actiontext (= 7.1.3.2)
192
+ actionview (= 7.1.3.2)
193
+ activejob (= 7.1.3.2)
194
+ activemodel (= 7.1.3.2)
195
+ activerecord (= 7.1.3.2)
196
+ activestorage (= 7.1.3.2)
197
+ activesupport (= 7.1.3.2)
197
198
  bundler (>= 1.15.0)
198
- railties (= 7.1.3)
199
+ railties (= 7.1.3.2)
199
200
  rails-dom-testing (2.2.0)
200
201
  activesupport (>= 5.0.0)
201
202
  minitest
@@ -203,9 +204,9 @@ GEM
203
204
  rails-html-sanitizer (1.6.0)
204
205
  loofah (~> 2.21)
205
206
  nokogiri (~> 1.14)
206
- railties (7.1.3)
207
- actionpack (= 7.1.3)
208
- activesupport (= 7.1.3)
207
+ railties (7.1.3.2)
208
+ actionpack (= 7.1.3.2)
209
+ activesupport (= 7.1.3.2)
209
210
  irb
210
211
  rackup (>= 1.0.0)
211
212
  rake (>= 12.2)
@@ -213,48 +214,48 @@ GEM
213
214
  zeitwerk (~> 2.6)
214
215
  rainbow (3.1.1)
215
216
  rake (13.1.0)
216
- rb_sys (0.9.87)
217
+ rb_sys (0.9.90)
217
218
  rdoc (6.6.2)
218
219
  psych (>= 4.0.0)
219
- regexp_parser (2.8.3)
220
- reline (0.4.2)
220
+ regexp_parser (2.9.0)
221
+ reline (0.4.3)
221
222
  io-console (~> 0.5)
222
223
  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)
224
+ rspec (3.13.0)
225
+ rspec-core (~> 3.13.0)
226
+ rspec-expectations (~> 3.13.0)
227
+ rspec-mocks (~> 3.13.0)
228
+ rspec-core (3.13.0)
229
+ rspec-support (~> 3.13.0)
230
+ rspec-expectations (3.13.0)
230
231
  diff-lcs (>= 1.2.0, < 2.0)
231
- rspec-support (~> 3.12.0)
232
- rspec-mocks (3.12.6)
232
+ rspec-support (~> 3.13.0)
233
+ rspec-mocks (3.13.0)
233
234
  diff-lcs (>= 1.2.0, < 2.0)
234
- rspec-support (~> 3.12.0)
235
- rspec-support (3.12.1)
236
- rubocop (1.59.0)
235
+ rspec-support (~> 3.13.0)
236
+ rspec-support (3.13.0)
237
+ rubocop (1.62.0)
237
238
  json (~> 2.3)
238
239
  language_server-protocol (>= 3.17.0)
239
240
  parallel (~> 1.10)
240
- parser (>= 3.2.2.4)
241
+ parser (>= 3.3.0.2)
241
242
  rainbow (>= 2.2.2, < 4.0)
242
243
  regexp_parser (>= 1.8, < 3.0)
243
244
  rexml (>= 3.2.5, < 4.0)
244
- rubocop-ast (>= 1.30.0, < 2.0)
245
+ rubocop-ast (>= 1.31.1, < 2.0)
245
246
  ruby-progressbar (~> 1.7)
246
247
  unicode-display_width (>= 2.4.0, < 3.0)
247
- rubocop-ast (1.30.0)
248
- parser (>= 3.2.1.0)
248
+ rubocop-ast (1.31.2)
249
+ parser (>= 3.3.0.4)
249
250
  rubocop-performance (1.20.1)
250
251
  rubocop (>= 1.48.1, < 2.0)
251
252
  rubocop-ast (>= 1.30.0, < 2.0)
252
253
  ruby-progressbar (1.13.0)
253
254
  ruby2_keywords (0.0.5)
254
- standard (1.33.0)
255
+ standard (1.34.0)
255
256
  language_server-protocol (~> 3.17.0.2)
256
257
  lint_roller (~> 1.0)
257
- rubocop (~> 1.59.0)
258
+ rubocop (~> 1.60)
258
259
  standard-custom (~> 1.0.0)
259
260
  standard-performance (~> 1.3)
260
261
  standard-custom (1.0.2)
@@ -267,10 +268,10 @@ GEM
267
268
  standard
268
269
  stringio (3.1.0)
269
270
  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)
271
+ tiktoken_ruby (0.0.7)
272
+ rb_sys (>= 0.9.86)
273
+ tiktoken_ruby (0.0.7-x86_64-darwin)
274
+ tiktoken_ruby (0.0.7-x86_64-linux)
274
275
  timeout (0.4.1)
275
276
  to_bool (2.0.0)
276
277
  tzinfo (2.0.6)
@@ -281,8 +282,8 @@ GEM
281
282
  websocket-driver (0.7.6)
282
283
  websocket-extensions (>= 0.1.0)
283
284
  websocket-extensions (0.1.5)
284
- yard (0.9.34)
285
- zeitwerk (2.6.12)
285
+ yard (0.9.36)
286
+ zeitwerk (2.6.13)
286
287
 
287
288
  PLATFORMS
288
289
  ruby
@@ -298,7 +299,7 @@ DEPENDENCIES
298
299
  pry-byebug (~> 3.10.0)
299
300
  rails (> 6.0.0)
300
301
  rake (~> 13.1)
301
- rspec (~> 3.0)
302
+ rspec (~> 3.13)
302
303
  rubocop
303
304
  standardrb
304
305
  yard (~> 0.9.34)
@@ -117,7 +117,8 @@ module Langchain::Vectorsearch
117
117
 
118
118
  prompt = generate_rag_prompt(question: question, context: context)
119
119
 
120
- llm.chat(prompt: prompt, &block)
120
+ messages = [{role: "user", content: prompt}]
121
+ llm.chat(messages: messages, &block)
121
122
  end
122
123
  end
123
124
  end
@@ -117,7 +117,7 @@ module LangchainrbRails
117
117
  question: question,
118
118
  k: k,
119
119
  &block
120
- ).completion
120
+ ).chat_completion
121
121
  end
122
122
  end
123
123
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LangchainrbRails
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.8"
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.6
4
+ version: 0.1.8
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-25 00:00:00.000000000 Z
11
+ date: 2024-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: langchainrb