langchainrb_rails 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +20 -22
- data/lib/langchainrb_overrides/vectorsearch/pgvector.rb +1 -9
- data/lib/langchainrb_rails/active_record/hooks.rb +2 -0
- data/lib/langchainrb_rails/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd852fd63863fc606ef15050595f869d0c5d51a59af35378a7ef12e74f630c43
|
4
|
+
data.tar.gz: a7c97f6ca363c8a601b912b228aab5c3f7c8e729501c05ebbb36edfa4814891e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f7936870a0db496121851ee4a40aea28f25c4ab9e9d909cd3e5d70bd0fe74a06c1539afe56ab7a3848bf31e6f42c62906f3e2157bc96898ffe08e36cc1ecb48
|
7
|
+
data.tar.gz: f5a6e6934991b462bf5034b10b17ce79713d573d6c6d65ed08ff1b26b359151892647293b3e96649baec08e034d0298367c52e65438f15b2e2dbc2665ef5f98e
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
langchainrb_rails (0.1.
|
5
|
-
langchainrb (>= 0.7, < 0.
|
4
|
+
langchainrb_rails (0.1.9)
|
5
|
+
langchainrb (>= 0.7, < 0.12)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -84,9 +84,9 @@ 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.
|
87
|
+
baran (0.1.11)
|
88
88
|
base64 (0.2.0)
|
89
|
-
bigdecimal (3.1.
|
89
|
+
bigdecimal (3.1.7)
|
90
90
|
brakeman (6.1.2)
|
91
91
|
racc
|
92
92
|
builder (3.2.4)
|
@@ -101,28 +101,27 @@ GEM
|
|
101
101
|
crass (1.0.6)
|
102
102
|
date (3.3.4)
|
103
103
|
diff-lcs (1.5.1)
|
104
|
-
drb (2.2.
|
105
|
-
ruby2_keywords
|
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.
|
108
|
+
i18n (1.14.4)
|
110
109
|
concurrent-ruby (~> 1.0)
|
111
110
|
io-console (0.7.2)
|
112
111
|
irb (1.11.2)
|
113
112
|
rdoc
|
114
113
|
reline (>= 0.4.2)
|
115
|
-
json (2.7.
|
116
|
-
json-schema (4.
|
114
|
+
json (2.7.2)
|
115
|
+
json-schema (4.3.0)
|
117
116
|
addressable (>= 2.8)
|
118
|
-
langchainrb (0.
|
117
|
+
langchainrb (0.11.4)
|
119
118
|
activesupport (>= 7.0.8)
|
120
119
|
baran (~> 0.1.9)
|
121
120
|
colorize (~> 1.1.0)
|
122
121
|
json-schema (~> 4)
|
123
122
|
matrix
|
124
123
|
pragmatic_segmenter (~> 0.3.0)
|
125
|
-
tiktoken_ruby (~> 0.0.
|
124
|
+
tiktoken_ruby (~> 0.0.8)
|
126
125
|
to_bool (~> 2.0.0)
|
127
126
|
zeitwerk (~> 2.5)
|
128
127
|
language_server-protocol (3.17.0.3)
|
@@ -140,7 +139,7 @@ GEM
|
|
140
139
|
method_source (1.0.0)
|
141
140
|
mini_mime (1.1.5)
|
142
141
|
mini_portile2 (2.8.5)
|
143
|
-
minitest (5.22.
|
142
|
+
minitest (5.22.3)
|
144
143
|
mutex_m (0.2.0)
|
145
144
|
net-imap (0.4.10)
|
146
145
|
date
|
@@ -173,7 +172,7 @@ GEM
|
|
173
172
|
pry (>= 0.13, < 0.15)
|
174
173
|
psych (5.1.2)
|
175
174
|
stringio
|
176
|
-
public_suffix (5.0.
|
175
|
+
public_suffix (5.0.5)
|
177
176
|
racc (1.7.3)
|
178
177
|
rack (3.0.9.1)
|
179
178
|
rack-session (2.0.0)
|
@@ -213,9 +212,9 @@ GEM
|
|
213
212
|
thor (~> 1.0, >= 1.2.2)
|
214
213
|
zeitwerk (~> 2.6)
|
215
214
|
rainbow (3.1.1)
|
216
|
-
rake (13.1
|
217
|
-
rb_sys (0.9.
|
218
|
-
rdoc (6.6.
|
215
|
+
rake (13.2.1)
|
216
|
+
rb_sys (0.9.96)
|
217
|
+
rdoc (6.6.3.1)
|
219
218
|
psych (>= 4.0.0)
|
220
219
|
regexp_parser (2.9.0)
|
221
220
|
reline (0.4.3)
|
@@ -234,7 +233,7 @@ GEM
|
|
234
233
|
diff-lcs (>= 1.2.0, < 2.0)
|
235
234
|
rspec-support (~> 3.13.0)
|
236
235
|
rspec-support (3.13.0)
|
237
|
-
rubocop (1.
|
236
|
+
rubocop (1.63.1)
|
238
237
|
json (~> 2.3)
|
239
238
|
language_server-protocol (>= 3.17.0)
|
240
239
|
parallel (~> 1.10)
|
@@ -251,7 +250,6 @@ GEM
|
|
251
250
|
rubocop (>= 1.48.1, < 2.0)
|
252
251
|
rubocop-ast (>= 1.30.0, < 2.0)
|
253
252
|
ruby-progressbar (1.13.0)
|
254
|
-
ruby2_keywords (0.0.5)
|
255
253
|
standard (1.34.0)
|
256
254
|
language_server-protocol (~> 3.17.0.2)
|
257
255
|
lint_roller (~> 1.0)
|
@@ -268,10 +266,10 @@ GEM
|
|
268
266
|
standard
|
269
267
|
stringio (3.1.0)
|
270
268
|
thor (1.3.0)
|
271
|
-
tiktoken_ruby (0.0.
|
269
|
+
tiktoken_ruby (0.0.8)
|
272
270
|
rb_sys (>= 0.9.86)
|
273
|
-
tiktoken_ruby (0.0.
|
274
|
-
tiktoken_ruby (0.0.
|
271
|
+
tiktoken_ruby (0.0.8-x86_64-darwin)
|
272
|
+
tiktoken_ruby (0.0.8-x86_64-linux)
|
275
273
|
timeout (0.4.1)
|
276
274
|
to_bool (2.0.0)
|
277
275
|
tzinfo (2.0.6)
|
@@ -298,7 +296,7 @@ DEPENDENCIES
|
|
298
296
|
langchainrb_rails!
|
299
297
|
pry-byebug (~> 3.10.0)
|
300
298
|
rails (> 6.0.0)
|
301
|
-
rake (~> 13.
|
299
|
+
rake (~> 13.2)
|
302
300
|
rspec (~> 3.13)
|
303
301
|
rubocop
|
304
302
|
standardrb
|
@@ -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,6 +112,7 @@ 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,
|
@@ -119,6 +120,7 @@ module LangchainrbRails
|
|
119
120
|
&block
|
120
121
|
).chat_completion
|
121
122
|
end
|
123
|
+
# standard:enable Style/ArgumentsForwarding
|
122
124
|
end
|
123
125
|
end
|
124
126
|
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.
|
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-
|
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.
|
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.
|
32
|
+
version: '0.12'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: pry-byebug
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|