raix 0.4.7 → 0.4.8
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 +4 -0
- data/Gemfile.lock +2 -1
- data/lib/raix/predicate.rb +12 -5
- data/lib/raix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 205dfe2efa97dd596884ca2063e33e0c76da34ae052f98e18e8c75c423752b3a
|
4
|
+
data.tar.gz: 24bfe7d9b6d20a701d70a96366937bf96c4999ea26469c8cc645e4ae874ce5c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea57058bb1e8614decd24d295a641b4e2e6d90ac2d5b2d744b3531561f13304e4e8e41a679c9e0f80b16fdcf0477c8c61262ed9b4fbb451d507db24469540037
|
7
|
+
data.tar.gz: f6c255abef3c7d2e7440075d4114f564050ffcf95e431dc5301ea6a516cd89f1baf3d96346e86614192d85330e4f234673b89eb9d19930043f0882c8ee2451eb
|
data/CHANGELOG.md
CHANGED
@@ -32,3 +32,7 @@
|
|
32
32
|
## [0.4.7] - 2024-11-12
|
33
33
|
- adds missing requires `raix/predicate` so that it can be used in a Rails app automatically
|
34
34
|
- adds missing openai support for `Predicate`
|
35
|
+
|
36
|
+
## [0.4.8] - 2024-11-12
|
37
|
+
- adds documentation for `Predicate` maybe handler
|
38
|
+
- logs to stdout when a response is unhandled by `Predicate`
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
raix (0.4.
|
4
|
+
raix (0.4.8)
|
5
5
|
activesupport (>= 6.0)
|
6
6
|
open_router (~> 0.2)
|
7
7
|
ruby-openai (~> 7.0)
|
@@ -211,6 +211,7 @@ GEM
|
|
211
211
|
PLATFORMS
|
212
212
|
arm64-darwin-21
|
213
213
|
arm64-darwin-22
|
214
|
+
arm64-darwin-24
|
214
215
|
x86_64-linux
|
215
216
|
|
216
217
|
DEPENDENCIES
|
data/lib/raix/predicate.rb
CHANGED
@@ -3,19 +3,24 @@
|
|
3
3
|
module Raix
|
4
4
|
# A module for handling yes/no questions using AI chat completion.
|
5
5
|
# When included in a class, it provides methods to define handlers for
|
6
|
-
# yes and no responses.
|
6
|
+
# yes and no responses. All handlers are optional. Any response that
|
7
|
+
# does not begin with "yes, " or "no, " will be considered a maybe.
|
7
8
|
#
|
8
9
|
# @example
|
9
10
|
# class Question
|
10
11
|
# include Raix::Predicate
|
11
12
|
#
|
12
|
-
# yes do |explanation|
|
13
|
+
# yes? do |explanation|
|
13
14
|
# puts "Yes: #{explanation}"
|
14
15
|
# end
|
15
16
|
#
|
16
|
-
# no do |explanation|
|
17
|
+
# no? do |explanation|
|
17
18
|
# puts "No: #{explanation}"
|
18
19
|
# end
|
20
|
+
#
|
21
|
+
# maybe? do |explanation|
|
22
|
+
# puts "Maybe: #{explanation}"
|
23
|
+
# end
|
19
24
|
# end
|
20
25
|
#
|
21
26
|
# question = Question.new
|
@@ -38,8 +43,10 @@ module Raix
|
|
38
43
|
instance_exec(response, &self.class.yes_block) if self.class.yes_block
|
39
44
|
elsif response.downcase.start_with?("no,")
|
40
45
|
instance_exec(response, &self.class.no_block) if self.class.no_block
|
41
|
-
elsif
|
42
|
-
instance_exec(response, &self.class.maybe_block)
|
46
|
+
elsif self.class.maybe_block
|
47
|
+
instance_exec(response, &self.class.maybe_block)
|
48
|
+
else
|
49
|
+
puts "[Raix::Predicate] Unhandled response: #{response}"
|
43
50
|
end
|
44
51
|
end
|
45
52
|
end
|
data/lib/raix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Obie Fernandez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|