ruby_llm-modes 0.1.0 → 0.1.1
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 +8 -0
- data/README.md +2 -2
- data/lib/ruby_llm/modes/classifiers/judge.rb +4 -2
- data/lib/ruby_llm/modes/router.rb +1 -1
- data/lib/ruby_llm/modes/version.rb +1 -1
- data/ruby_llm-modes.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 755b03b85f42540d9c7ccff774763791113e8db055a86a2667ddc5cc603d4959
|
|
4
|
+
data.tar.gz: 394a9ace1fed3aaa7f7ec0bccf871c6fb6d735d36f650b9a7ecdd737951eceb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e0f8b7f92b92520578b35a31b27e39954d1b1c313ca0d6c6f2d2c955865d1df749d9c5be90761bd901b3692130213680f8a970e13b0a923101e0a4ed72980df
|
|
7
|
+
data.tar.gz: 38703a7b68a5f4b383a37b641c0c7f74046fe1be718225b626a1f139dbe3de479e8948a1dde71c4c4493107ecc967f7478e7068dba860242376a654c5988ee5a
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.1] - 2026-10-14
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- README, the `:judge` declaration error, and the classifier comment name
|
|
15
|
+
ruby_llm 2.1.0 as the release that ships `RubyLLM.judge`, instead of
|
|
16
|
+
pointing at RubyLLM's main branch.
|
|
17
|
+
|
|
10
18
|
## [0.1.0] - 2026-09-26
|
|
11
19
|
|
|
12
20
|
### Added
|
data/README.md
CHANGED
|
@@ -62,7 +62,7 @@ gem "ruby_llm-modes"
|
|
|
62
62
|
|
|
63
63
|
Requires [RubyLLM](https://rubyllm.com) 2.0 or newer and Ruby 3.2 or newer.
|
|
64
64
|
|
|
65
|
-
The `:judge` example above
|
|
65
|
+
The `:judge` example above requires RubyLLM 2.1.0 or newer; RubyLLM 2.0.0 supports `:chat`.
|
|
66
66
|
|
|
67
67
|
## Modes
|
|
68
68
|
|
|
@@ -193,7 +193,7 @@ One `RubyLLM.judge` call with a single `choice` question whose options are the m
|
|
|
193
193
|
|
|
194
194
|
`confidence` comes from the judgment model with the distribution and reflects how **concentrated** it is on one mode, not a self-report. The gem passes it through as is. There is no free text, so `reason` is nil and a clarification has to be a mode of its own.
|
|
195
195
|
|
|
196
|
-
`model:` and `provider:` are passed to `RubyLLM.judge` as given; without them RubyLLM's defaults apply. `judge:` replaces `RubyLLM.judge` with any callable taking the same arguments and returning a `RubyLLM::Judgment`. `RubyLLM.judge`
|
|
196
|
+
`model:` and `provider:` are passed to `RubyLLM.judge` as given; without them RubyLLM's defaults apply. `judge:` replaces `RubyLLM.judge` with any callable taking the same arguments and returning a `RubyLLM::Judgment`. `RubyLLM.judge` ships with ruby_llm 2.1.0 and newer. On an older release, `classify_with :judge` raises `DeclarationError` unless `judge:` is given.
|
|
197
197
|
|
|
198
198
|
## Custom classifiers
|
|
199
199
|
|
|
@@ -19,7 +19,7 @@ module RubyLLM
|
|
|
19
19
|
# RubyLLM.judge; it is called with the same arguments and must return
|
|
20
20
|
# a Judgment.
|
|
21
21
|
#
|
|
22
|
-
# RubyLLM.judge
|
|
22
|
+
# RubyLLM.judge ships with ruby_llm 2.1.0 and newer. Without it the
|
|
23
23
|
# backend cannot run, and the router says so when it is built.
|
|
24
24
|
class Judge
|
|
25
25
|
QUESTION = <<~TEXT.strip
|
|
@@ -78,7 +78,9 @@ module RubyLLM
|
|
|
78
78
|
|
|
79
79
|
def judge
|
|
80
80
|
return @judge if @judge
|
|
81
|
-
|
|
81
|
+
unless self.class.available?
|
|
82
|
+
raise DeclarationError, "RubyLLM.judge is not available in ruby_llm #{RubyLLM::VERSION}; the :judge backend needs ruby_llm 2.1.0 or newer"
|
|
83
|
+
end
|
|
82
84
|
|
|
83
85
|
RubyLLM.method(:judge)
|
|
84
86
|
end
|
|
@@ -249,7 +249,7 @@ module RubyLLM
|
|
|
249
249
|
when :judge
|
|
250
250
|
return if classifier_spec[:options][:judge] || Classifiers::Judge.available?
|
|
251
251
|
|
|
252
|
-
raise DeclarationError, "#{name}: RubyLLM.judge is not available in ruby_llm #{RubyLLM::VERSION}; the :judge backend needs
|
|
252
|
+
raise DeclarationError, "#{name}: RubyLLM.judge is not available in ruby_llm #{RubyLLM::VERSION}; the :judge backend needs ruby_llm 2.1.0 or newer"
|
|
253
253
|
when Symbol
|
|
254
254
|
raise DeclarationError, "#{name}: unknown classifier backend #{backend.inspect}"
|
|
255
255
|
else
|
data/ruby_llm-modes.gemspec
CHANGED
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.authors = [ "Andrey Samsonov" ]
|
|
9
9
|
spec.email = [ "me@samsonov.io" ]
|
|
10
10
|
|
|
11
|
-
spec.summary = "
|
|
12
|
-
spec.description = "
|
|
11
|
+
spec.summary = "Declarative chat modes and automatic routing for RubyLLM"
|
|
12
|
+
spec.description = "Declaratively define multiple modes for a RubyLLM chat and automatically route each user message to the appropriate mode. Each mode has its own instructions, tools, model, and reasoning effort, while all modes share the conversation history. Configure mode availability and fallbacks, and inspect or test routing decisions independently of the response."
|
|
13
13
|
spec.homepage = "https://github.com/kryzhovnik/ruby_llm-modes"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
spec.required_ruby_version = ">= 3.2.0"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_llm-modes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrey Samsonov
|
|
@@ -43,10 +43,11 @@ dependencies:
|
|
|
43
43
|
- - "~>"
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
45
|
version: '1.1'
|
|
46
|
-
description:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
description: Declaratively define multiple modes for a RubyLLM chat and automatically
|
|
47
|
+
route each user message to the appropriate mode. Each mode has its own instructions,
|
|
48
|
+
tools, model, and reasoning effort, while all modes share the conversation history.
|
|
49
|
+
Configure mode availability and fallbacks, and inspect or test routing decisions
|
|
50
|
+
independently of the response.
|
|
50
51
|
email:
|
|
51
52
|
- me@samsonov.io
|
|
52
53
|
executables: []
|
|
@@ -93,6 +94,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
93
94
|
requirements: []
|
|
94
95
|
rubygems_version: 3.6.9
|
|
95
96
|
specification_version: 4
|
|
96
|
-
summary:
|
|
97
|
-
a classifier'
|
|
97
|
+
summary: Declarative chat modes and automatic routing for RubyLLM
|
|
98
98
|
test_files: []
|