llm.rb 15.2.1 → 15.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/llm/active_record/acts_as_llm.rb +6 -0
- data/lib/llm/console/buffer.rb +1 -1
- data/lib/llm/console/command.rb +1 -1
- data/lib/llm/console/input.rb +1 -1
- data/lib/llm/console/status.rb +1 -1
- data/lib/llm/console/stream.rb +1 -1
- data/lib/llm/console/window.rb +2 -2
- data/lib/llm/registry/model.rb +1 -1
- data/lib/llm/sequel/plugin.rb +6 -0
- data/lib/llm/tools/exec.rb +1 -3
- data/lib/llm/tools/git.rb +5 -2
- data/lib/llm/tools/read_file.rb +1 -1
- data/lib/llm/version.rb +1 -1
- data/llm.gemspec +1 -7
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '01569fad6afcf4d422b666778989e7bafd1c6e994b6e2be7801ccb5842a7aa3d'
|
|
4
|
+
data.tar.gz: f60ddf02e1a8405cf393e8c581cce61415f459d3207a7c8dc531cbe4e0e87f27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8d9f88421f209e72e1631cbe3e4119d80af29aa72dc44a1917a6dfcbaa76b3d8014d70afe1c771177f6a755ea2d840ffaf92a850606fdd9d08db5c0d0283d0d6
|
|
7
|
+
data.tar.gz: b9d2417b3d2ce4f54ae5c657791518261332508b7dcfe726f19f81d97a27f329220a81ea2ced411fd15625b11c3964c69e1bcfef5df799f9ee0d16f2342cdd56
|
data/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,23 @@
|
|
|
17
17
|
|
|
18
18
|
*No unreleased changes yet. Check back after the next release.*
|
|
19
19
|
|
|
20
|
+
## v15.2.2
|
|
21
|
+
|
|
22
|
+
Changes since `v15.2.1`.
|
|
23
|
+
|
|
24
|
+
This release fixes the `set_provider`, `set_context`, and `set_tracer`
|
|
25
|
+
callbacks installed by `acts_as_llm` and `plugin :llm` so a subclass
|
|
26
|
+
inherits them from its superclass instead of raising.
|
|
27
|
+
|
|
28
|
+
### Fix
|
|
29
|
+
|
|
30
|
+
* **activerecord, sequel: inherit `set_provider` from a superclass** <br>
|
|
31
|
+
The `set_provider`, `set_context`, and `set_tracer` callbacks installed by
|
|
32
|
+
`acts_as_llm` / `plugin :llm` (and their agent counterparts) are now resolved
|
|
33
|
+
through the normal method lookup chain. Defining a callback on a superclass,
|
|
34
|
+
the usual single-table inheritance setup, no longer raises
|
|
35
|
+
`NotImplementedError`, and a subclass can still override it.
|
|
36
|
+
|
|
20
37
|
## v15.2.1
|
|
21
38
|
|
|
22
39
|
Changes since `v15.2.0`.
|
|
@@ -220,19 +220,25 @@ module LLM::ActiveRecord
|
|
|
220
220
|
|
|
221
221
|
##
|
|
222
222
|
# @return [LLM::Provider]
|
|
223
|
+
# @raise [NotImplementedError]
|
|
224
|
+
# when neither this model nor one of its ancestors implements the
|
|
225
|
+
# callback
|
|
223
226
|
def set_provider
|
|
227
|
+
return super if defined?(super)
|
|
224
228
|
raise NotImplementedError, "implement the set_provider callback"
|
|
225
229
|
end
|
|
226
230
|
|
|
227
231
|
##
|
|
228
232
|
# @return [Hash]
|
|
229
233
|
def set_context
|
|
234
|
+
return super if defined?(super)
|
|
230
235
|
EMPTY_HASH.dup
|
|
231
236
|
end
|
|
232
237
|
|
|
233
238
|
##
|
|
234
239
|
# @return [LLM::Tracer]
|
|
235
240
|
def set_tracer
|
|
241
|
+
return super if defined?(super)
|
|
236
242
|
nil
|
|
237
243
|
end
|
|
238
244
|
|
data/lib/llm/console/buffer.rb
CHANGED
|
@@ -16,7 +16,7 @@ class LLM::Console
|
|
|
16
16
|
# row by overwriting its contents repeatedly.
|
|
17
17
|
class Buffer
|
|
18
18
|
##
|
|
19
|
-
# @param [LLM::Console]
|
|
19
|
+
# @param [LLM::Console] repl
|
|
20
20
|
# An instance of {LLM::Console LLM::Console}.
|
|
21
21
|
# @return [LLM::Console::Buffer]
|
|
22
22
|
def initialize(repl)
|
data/lib/llm/console/command.rb
CHANGED
data/lib/llm/console/input.rb
CHANGED
data/lib/llm/console/status.rb
CHANGED
data/lib/llm/console/stream.rb
CHANGED
data/lib/llm/console/window.rb
CHANGED
data/lib/llm/registry/model.rb
CHANGED
|
@@ -6,7 +6,7 @@ class LLM::Registry
|
|
|
6
6
|
# metadata (pricing, limits, capabilities, and
|
|
7
7
|
# modalities).
|
|
8
8
|
#
|
|
9
|
-
# Models are
|
|
9
|
+
# Models are `Comparable` by price: input cost first, then
|
|
10
10
|
# output cost, so `models.sort` orders them from cheapest to
|
|
11
11
|
# most expensive.
|
|
12
12
|
class Model
|
data/lib/llm/sequel/plugin.rb
CHANGED
|
@@ -320,19 +320,25 @@ module LLM::Sequel
|
|
|
320
320
|
|
|
321
321
|
##
|
|
322
322
|
# @return [LLM::Provider]
|
|
323
|
+
# @raise [NotImplementedError]
|
|
324
|
+
# when neither this model nor one of its ancestors implements the
|
|
325
|
+
# callback
|
|
323
326
|
def set_provider
|
|
327
|
+
return super if defined?(super)
|
|
324
328
|
raise NotImplementedError, "implement the set_provider callback"
|
|
325
329
|
end
|
|
326
330
|
|
|
327
331
|
##
|
|
328
332
|
# @return [Hash]
|
|
329
333
|
def set_context
|
|
334
|
+
return super if defined?(super)
|
|
330
335
|
Plugin::EMPTY_HASH.dup
|
|
331
336
|
end
|
|
332
337
|
|
|
333
338
|
##
|
|
334
339
|
# @return [LLM::Tracer]
|
|
335
340
|
def set_tracer
|
|
341
|
+
return super if defined?(super)
|
|
336
342
|
nil
|
|
337
343
|
end
|
|
338
344
|
|
data/lib/llm/tools/exec.rb
CHANGED
|
@@ -46,10 +46,8 @@ class LLM::Tool
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
##
|
|
49
|
-
# @param [String] name
|
|
50
|
-
# The name of a command
|
|
51
49
|
# @param [Array<String>] arguments
|
|
52
|
-
#
|
|
50
|
+
# A command and its arguments. The first element is the command name.
|
|
53
51
|
# @param [Integer] timeout
|
|
54
52
|
# The maximum allowed time for the command to run (in seconds)
|
|
55
53
|
# @param [Integer] max_bytes
|
data/lib/llm/tools/git.rb
CHANGED
|
@@ -16,8 +16,11 @@ class LLM::Tool
|
|
|
16
16
|
defaults arguments: [], timeout: 5
|
|
17
17
|
|
|
18
18
|
##
|
|
19
|
-
# @param [String]
|
|
20
|
-
#
|
|
19
|
+
# @param [Array<String>] arguments
|
|
20
|
+
# One or more git arguments. The first is the subcommand and must be
|
|
21
|
+
# one of `log`, `diff`, `commit`, `checkout`, `branch`, or `show`.
|
|
22
|
+
# @param [Integer] timeout
|
|
23
|
+
# The maximum time to allow the command to run (in seconds)
|
|
21
24
|
# @return [Hash]
|
|
22
25
|
def call(arguments: [], timeout: 5)
|
|
23
26
|
subcommand = arguments[0]
|
data/lib/llm/tools/read_file.rb
CHANGED
|
@@ -4,7 +4,7 @@ class LLM::Tool
|
|
|
4
4
|
##
|
|
5
5
|
# The {LLM::Tool::ReadFile} class implements a tool that
|
|
6
6
|
# can read the contents of a file. It returns the content
|
|
7
|
-
# as structured lines ({lineno:, content:}), so the model can
|
|
7
|
+
# as structured lines (`{lineno:, content:}`), so the model can
|
|
8
8
|
# reference line numbers when requesting a narrower range.
|
|
9
9
|
class ReadFile < self
|
|
10
10
|
require_relative "utils"
|
data/lib/llm/version.rb
CHANGED
data/llm.gemspec
CHANGED
|
@@ -37,13 +37,7 @@ DESCRIPTION
|
|
|
37
37
|
spec.post_install_message = "\n" \
|
|
38
38
|
"Got a question about llm.rb? " \
|
|
39
39
|
"\n" \
|
|
40
|
-
"
|
|
41
|
-
"\n" \
|
|
42
|
-
"It is connected to the official GitHub repository." \
|
|
43
|
-
"\n" \
|
|
44
|
-
"100% free to use." \
|
|
45
|
-
"\n" \
|
|
46
|
-
"Built with llm.rb and DeepSeek." \
|
|
40
|
+
"The https://r.uby.dev website can help." \
|
|
47
41
|
"\n\n"
|
|
48
42
|
|
|
49
43
|
spec.add_development_dependency "webmock", "~> 3.24.0"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: llm.rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 15.2.
|
|
4
|
+
version: 15.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Gleeson
|
|
@@ -695,9 +695,8 @@ metadata:
|
|
|
695
695
|
source_code_uri: https://github.com/r-uby-dev/llm
|
|
696
696
|
documentation_uri: https://r.uby.dev
|
|
697
697
|
changelog_uri: https://github.com/r-uby-dev/llm/blob/main/CHANGELOG.md
|
|
698
|
-
post_install_message: "\nGot a question about llm.rb? \
|
|
699
|
-
|
|
700
|
-
with llm.rb and DeepSeek.\n\n"
|
|
698
|
+
post_install_message: "\nGot a question about llm.rb? \nThe https://r.uby.dev website
|
|
699
|
+
can help.\n\n"
|
|
701
700
|
rdoc_options: []
|
|
702
701
|
require_paths:
|
|
703
702
|
- lib
|