langchainrb_rails 0.1.9 → 0.1.10

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: dd852fd63863fc606ef15050595f869d0c5d51a59af35378a7ef12e74f630c43
4
- data.tar.gz: a7c97f6ca363c8a601b912b228aab5c3f7c8e729501c05ebbb36edfa4814891e
3
+ metadata.gz: f9763af7d92b1cd74c550438a35a65edd6030c247bfd676ae63808947a9214ca
4
+ data.tar.gz: 316642515d0fddc921fdc8f53b60ce75634ed2bc353e51280927f089c364d44b
5
5
  SHA512:
6
- metadata.gz: 7f7936870a0db496121851ee4a40aea28f25c4ab9e9d909cd3e5d70bd0fe74a06c1539afe56ab7a3848bf31e6f42c62906f3e2157bc96898ffe08e36cc1ecb48
7
- data.tar.gz: f5a6e6934991b462bf5034b10b17ce79713d573d6c6d65ed08ff1b26b359151892647293b3e96649baec08e034d0298367c52e65438f15b2e2dbc2665ef5f98e
6
+ metadata.gz: 496153be521fe4f50efceaf75e25ae0fec8ae1e78faf52987c6cb117eade71d14831ea75ccc69e7ec7cc6b3243a14330ac3b446507c51ab7db9b6064cdb19e4b
7
+ data.tar.gz: 3983b1c299076585a46f0f8f015d90e95dd2accd07757a551a5ff3ee00e47e2bb7a254cd5451b0e9cbab7093a0d1a0cb91f5a50edbd06b4894b39f83a299d3ca
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- langchainrb_rails (0.1.9)
5
- langchainrb (>= 0.7, < 0.12)
4
+ langchainrb_rails (0.1.10)
5
+ langchainrb (>= 0.7, < 0.14)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -138,7 +138,7 @@ GEM
138
138
  matrix (0.4.2)
139
139
  method_source (1.0.0)
140
140
  mini_mime (1.1.5)
141
- mini_portile2 (2.8.5)
141
+ mini_portile2 (2.8.6)
142
142
  minitest (5.22.3)
143
143
  mutex_m (0.2.0)
144
144
  net-imap (0.4.10)
@@ -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.2)
154
+ nokogiri (1.16.5)
155
155
  mini_portile2 (~> 2.8.2)
156
156
  racc (~> 1.4)
157
- nokogiri (1.16.2-x86_64-darwin)
157
+ nokogiri (1.16.5-x86_64-darwin)
158
158
  racc (~> 1.4)
159
- nokogiri (1.16.2-x86_64-linux)
159
+ nokogiri (1.16.5-x86_64-linux)
160
160
  racc (~> 1.4)
161
161
  parallel (1.24.0)
162
- parser (3.3.0.5)
162
+ parser (3.3.1.0)
163
163
  ast (~> 2.4.1)
164
164
  racc
165
165
  pragmatic_segmenter (0.3.23)
@@ -216,10 +216,11 @@ GEM
216
216
  rb_sys (0.9.96)
217
217
  rdoc (6.6.3.1)
218
218
  psych (>= 4.0.0)
219
- regexp_parser (2.9.0)
219
+ regexp_parser (2.9.1)
220
220
  reline (0.4.3)
221
221
  io-console (~> 0.5)
222
- rexml (3.2.6)
222
+ rexml (3.2.8)
223
+ strscan (>= 3.0.9)
223
224
  rspec (3.13.0)
224
225
  rspec-core (~> 3.13.0)
225
226
  rspec-expectations (~> 3.13.0)
@@ -233,7 +234,7 @@ GEM
233
234
  diff-lcs (>= 1.2.0, < 2.0)
234
235
  rspec-support (~> 3.13.0)
235
236
  rspec-support (3.13.0)
236
- rubocop (1.63.1)
237
+ rubocop (1.63.5)
237
238
  json (~> 2.3)
238
239
  language_server-protocol (>= 3.17.0)
239
240
  parallel (~> 1.10)
@@ -244,8 +245,8 @@ GEM
244
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.31.2)
248
- parser (>= 3.3.0.4)
248
+ rubocop-ast (1.31.3)
249
+ parser (>= 3.3.1.0)
249
250
  rubocop-performance (1.20.1)
250
251
  rubocop (>= 1.48.1, < 2.0)
251
252
  rubocop-ast (>= 1.30.0, < 2.0)
@@ -265,6 +266,7 @@ GEM
265
266
  standardrb (1.0.1)
266
267
  standard
267
268
  stringio (3.1.0)
269
+ strscan (3.1.0)
268
270
  thor (1.3.0)
269
271
  tiktoken_ruby (0.0.8)
270
272
  rb_sys (>= 0.9.86)
@@ -19,6 +19,15 @@ module LangchainrbRails
19
19
  "openai" => "Langchain::LLM::OpenAI",
20
20
  "replicate" => "Langchain::LLM::Replicate"
21
21
  }
22
+
23
+ def post_install_message
24
+ say "Please do the following to start Q&A with your #{model_name} records:", :green
25
+ say "1. Run `bundle install` to install the new gems."
26
+ say "2. Set an environment variable ENV['#{llm.upcase}_API_KEY'] for your #{llm_class}."
27
+ say "3. Run `rails db:migrate` to apply the database migrations to enable pgvector and add the embedding column."
28
+ say "4. In Rails console, run `#{model_name}.embed!` to set the embeddings for all records."
29
+ say "5. Ask a question in the Rails console, ie: `#{model_name}.ask('[YOUR QUESTION]')`"
30
+ end
22
31
  end
23
32
  end
24
33
  end
@@ -35,15 +35,6 @@ module LangchainrbRails
35
35
  gem "ruby-openai"
36
36
  end
37
37
 
38
- def post_install_message
39
- say "Please do the following to start Q&A with your #{model_name} records:", :green
40
- say "1. Run `bundle install` to install the new gems."
41
- say "2. Set `OPENAI_API_KEY` environment variable to your OpenAI API key."
42
- say "3. Run `rails db:migrate` to apply the database migrations to enable pgvector and add the embedding column."
43
- say "4. In Rails console, run `#{model_name}.embed!` to set the embeddings for all records."
44
- say "5. Ask a question in the Rails console, ie: `#{model_name}.ask('[YOUR QUESTION]')`"
45
- end
46
-
47
38
  private
48
39
 
49
40
  # @return [String] Name of the model
@@ -67,8 +58,8 @@ module LangchainrbRails
67
58
  end
68
59
 
69
60
  # @return [Integer] Dimension of the vector to be used
70
- def vector_dimension
71
- llm_class.default_dimension
61
+ def vector_dimensions
62
+ llm_class.default_dimensions
72
63
  end
73
64
  end
74
65
  end
@@ -5,6 +5,6 @@ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version
5
5
  .config
6
6
  .vectorsearch
7
7
  .llm
8
- .default_dimension
8
+ .default_dimensions
9
9
  end
10
10
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  LangchainrbRails.configure do |config|
4
4
  config.vectorsearch = Langchain::Vectorsearch::Pgvector.new(
5
- llm: <%= llm_class %>.new(api_key: ENV["OPENAI_API_KEY"])
5
+ llm: <%= llm_class %>.new(api_key: ENV["<%= llm.upcase %>_API_KEY"])
6
6
  )
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LangchainrbRails
4
- VERSION = "0.1.9"
4
+ VERSION = "0.1.10"
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.9
4
+ version: 0.1.10
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-04-20 00:00:00.000000000 Z
11
+ date: 2024-05-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.12'
22
+ version: '0.14'
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.12'
32
+ version: '0.14'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: pry-byebug
35
35
  requirement: !ruby/object:Gem::Requirement