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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8437f48c9a995054696648dfbe3386a5f0d8c8a62379765d2eca8694cf3adb3b
4
- data.tar.gz: d2c36a69342e2fef94472abc25e813a0ee8bbef9aba15e68b275d89d307a6405
3
+ metadata.gz: '01569fad6afcf4d422b666778989e7bafd1c6e994b6e2be7801ccb5842a7aa3d'
4
+ data.tar.gz: f60ddf02e1a8405cf393e8c581cce61415f459d3207a7c8dc531cbe4e0e87f27
5
5
  SHA512:
6
- metadata.gz: d1d120fe448ee693ba627cfdfe213cd42030fe8448f72c8cf6ecaddb62d2ac5f7b07ded6191142ec28571b41acbdf8c96b458420889e7fb75990f53f51b3ab43
7
- data.tar.gz: 816b6feffe0339f52798062de3f36188b3d6574203289f450fd07de2e1e600b29aa956a8ba50947d3ae27540a4132222f3b31bb865784f88e24074388a852058
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
 
@@ -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] 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)
@@ -168,7 +168,7 @@ class LLM::Console
168
168
  attr_reader :agent
169
169
 
170
170
  ##
171
- # @param [LLM::Console] console
171
+ # @param [LLM::Console] repl
172
172
  # @return [LLM::Console::Command]
173
173
  def initialize(repl)
174
174
  @repl = repl
@@ -55,7 +55,7 @@ class LLM::Console
55
55
  attr_writer :paste
56
56
 
57
57
  ##
58
- # @param [LLM::Console] console
58
+ # @param [LLM::Console] repl
59
59
  # @return [LLM::Console::Input]
60
60
  def initialize(repl, options = {})
61
61
  @repl = repl
@@ -12,7 +12,7 @@ class LLM::Console
12
12
  # @api private
13
13
  class Status
14
14
  ##
15
- # @param [LLM::Console] console
15
+ # @param [LLM::Console] repl
16
16
  # @return [LLM::Console::Status]
17
17
  def initialize(repl)
18
18
  @repl = repl
@@ -13,7 +13,7 @@ class LLM::Console
13
13
  attr_reader :tools
14
14
 
15
15
  ##
16
- # @param [LLM::Console] console
16
+ # @param [LLM::Console] repl
17
17
  # @return [LLM::Console::Stream]
18
18
  def initialize(repl, queue)
19
19
  @repl = repl
@@ -24,8 +24,8 @@ class LLM::Console
24
24
  attr_reader :input
25
25
 
26
26
  ##
27
- # @param [LLM::Console] console
28
- # A read-eval-print loop.
27
+ # @param [LLM::Console] repl
28
+ # A console.
29
29
  # @return [LLM::Console::Window]
30
30
  def initialize(repl)
31
31
  @repl = repl
@@ -6,7 +6,7 @@ class LLM::Registry
6
6
  # metadata (pricing, limits, capabilities, and
7
7
  # modalities).
8
8
  #
9
- # Models are {Comparable} by price: input cost first, then
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
@@ -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
 
@@ -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
- # One or more command-line arguments
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] subcommand
20
- # @param [Array<String>, nil] arguments
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]
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LLM
4
- VERSION = "15.2.1"
4
+ VERSION = "15.2.2"
5
5
  end
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
- "Ask the https://r.uby.dev chatbot." \
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.1
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? \nAsk the https://r.uby.dev
699
- chatbot.\nIt is connected to the official GitHub repository.\n100% free to use.\nBuilt
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