Skip to content

Commit aefb27c

Browse files
authored
Remove Override Operators (#66)
* Use non-override constants * Update Langchain Dependency * Update Langchain Dependency
1 parent 99c173e commit aefb27c

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

Gemfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: .
33
specs:
44
langchainrb_rails (0.1.8)
5-
langchainrb (>= 0.7, < 0.11)
5+
langchainrb (>= 0.7, < 0.12)
66

77
GEM
88
remote: https://rubygems.org/
@@ -112,16 +112,16 @@ GEM
112112
rdoc
113113
reline (>= 0.4.2)
114114
json (2.7.2)
115-
json-schema (4.2.0)
115+
json-schema (4.3.0)
116116
addressable (>= 2.8)
117-
langchainrb (0.10.0)
117+
langchainrb (0.11.2)
118118
activesupport (>= 7.0.8)
119119
baran (~> 0.1.9)
120120
colorize (~> 1.1.0)
121121
json-schema (~> 4)
122122
matrix
123123
pragmatic_segmenter (~> 0.3.0)
124-
tiktoken_ruby (~> 0.0.7)
124+
tiktoken_ruby (~> 0.0.8)
125125
to_bool (~> 2.0.0)
126126
zeitwerk (~> 2.5)
127127
language_server-protocol (3.17.0.3)
@@ -172,7 +172,7 @@ GEM
172172
pry (>= 0.13, < 0.15)
173173
psych (5.1.2)
174174
stringio
175-
public_suffix (5.0.4)
175+
public_suffix (5.0.5)
176176
racc (1.7.3)
177177
rack (3.0.9.1)
178178
rack-session (2.0.0)
@@ -213,7 +213,7 @@ GEM
213213
zeitwerk (~> 2.6)
214214
rainbow (3.1.1)
215215
rake (13.2.1)
216-
rb_sys (0.9.90)
216+
rb_sys (0.9.94)
217217
rdoc (6.6.3.1)
218218
psych (>= 4.0.0)
219219
regexp_parser (2.9.0)
@@ -266,10 +266,10 @@ GEM
266266
standard
267267
stringio (3.1.0)
268268
thor (1.3.0)
269-
tiktoken_ruby (0.0.7)
269+
tiktoken_ruby (0.0.8)
270270
rb_sys (>= 0.9.86)
271-
tiktoken_ruby (0.0.7-x86_64-darwin)
272-
tiktoken_ruby (0.0.7-x86_64-linux)
271+
tiktoken_ruby (0.0.8-x86_64-darwin)
272+
tiktoken_ruby (0.0.8-x86_64-linux)
273273
timeout (0.4.1)
274274
to_bool (2.0.0)
275275
tzinfo (2.0.6)

langchainrb_rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
3030
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
3131
spec.require_paths = ["lib"]
3232

33-
spec.add_dependency "langchainrb", ">= 0.7", "< 0.11"
33+
spec.add_dependency "langchainrb", ">= 0.7", "< 0.12"
3434

3535
spec.add_development_dependency "pry-byebug", "~> 3.10.0"
3636
spec.add_development_dependency "yard", "~> 0.9.34"

lib/langchainrb_overrides/vectorsearch/pgvector.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@ class Pgvector < Base
1515
# pgvector = Langchain::Vectorsearch::Pgvector.new(llm:)
1616
#
1717

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-
2618
attr_reader :operator, :llm
2719
attr_accessor :model
2820

@@ -36,7 +28,7 @@ def initialize(llm:)
3628
# These happen in the template files.
3729
# depends_on "neighbor"
3830

39-
@operator = DEFAULT_OPERATOR
31+
@operator = OPERATORS[DEFAULT_OPERATOR]
4032

4133
super(llm: llm)
4234
end

0 commit comments

Comments
 (0)