action_ai 0.1.0 → 0.3.0
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 +35 -0
- data/README.rdoc +129 -1
- data/lib/action_ai/agent.rb +2 -0
- data/lib/action_ai/implicit_interaction.rb +19 -0
- data/lib/action_ai/interaction.rb +17 -0
- data/lib/action_ai/model_schema/active_model.rb +123 -0
- data/lib/action_ai/model_schema/active_record.rb +137 -0
- data/lib/action_ai/model_schema.rb +195 -0
- data/lib/action_ai/railtie.rb +8 -1
- data/lib/action_ai/refinements/numeric.rb +32 -0
- data/lib/action_ai/refinements/regexp.rb +13 -0
- data/lib/action_ai/schema.rb +20 -0
- data/lib/action_ai/structured_output.rb +85 -0
- data/lib/action_ai/version.rb +1 -1
- data/lib/action_ai.rb +6 -0
- data/lib/ruby_llm/protocols/echo.rb +26 -0
- data/lib/ruby_llm/providers/test.rb +5 -21
- data/lib/ruby_llm/tester.rb +7 -3
- metadata +182 -143
- data/lib/ruby_llm/providers/test/echo.rb +0 -47
metadata
CHANGED
|
@@ -1,169 +1,208 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: action_ai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Alexander Senko
|
|
7
|
+
- Alexander Senko
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- !ruby/object:Gem::
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- !ruby/object:Gem::
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: activesupport
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
-
|
|
17
|
+
- ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: "0"
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
-
|
|
25
|
+
- ">="
|
|
26
|
+
- !ruby/object:Gem::Version
|
|
27
|
+
version: "0"
|
|
28
|
+
- !ruby/object:Gem::Dependency
|
|
29
|
+
name: actionpack
|
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
|
31
|
+
requirements:
|
|
32
|
+
-
|
|
33
|
+
- ">="
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: "0"
|
|
36
|
+
type: :runtime
|
|
37
|
+
prerelease: false
|
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
-
|
|
41
|
+
- ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: "0"
|
|
44
|
+
- !ruby/object:Gem::Dependency
|
|
45
|
+
name: actionview
|
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
|
47
|
+
requirements:
|
|
48
|
+
-
|
|
49
|
+
- ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: "0"
|
|
52
|
+
type: :runtime
|
|
53
|
+
prerelease: false
|
|
54
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
55
|
+
requirements:
|
|
56
|
+
-
|
|
57
|
+
- ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: "0"
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: activejob
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
-
|
|
65
|
+
- ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: "0"
|
|
68
|
+
type: :runtime
|
|
69
|
+
prerelease: false
|
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
71
|
+
requirements:
|
|
72
|
+
-
|
|
73
|
+
- ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: "0"
|
|
76
|
+
- !ruby/object:Gem::Dependency
|
|
77
|
+
name: ruby_llm
|
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
-
|
|
81
|
+
- ~>
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: "2.0"
|
|
84
|
+
type: :runtime
|
|
85
|
+
prerelease: false
|
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
-
|
|
89
|
+
- ~>
|
|
90
|
+
- !ruby/object:Gem::Version
|
|
91
|
+
version: "2.0"
|
|
92
|
+
- !ruby/object:Gem::Dependency
|
|
93
|
+
name: magic-lookup
|
|
94
|
+
requirement: !ruby/object:Gem::Requirement
|
|
95
|
+
requirements:
|
|
96
|
+
-
|
|
97
|
+
- ">="
|
|
98
|
+
- !ruby/object:Gem::Version
|
|
99
|
+
version: "0"
|
|
100
|
+
type: :runtime
|
|
101
|
+
prerelease: false
|
|
102
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
103
|
+
requirements:
|
|
104
|
+
-
|
|
105
|
+
- ">="
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: "0"
|
|
108
|
+
- !ruby/object:Gem::Dependency
|
|
109
|
+
name: memery
|
|
110
|
+
requirement: !ruby/object:Gem::Requirement
|
|
111
|
+
requirements:
|
|
112
|
+
-
|
|
113
|
+
- ">="
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: "0"
|
|
116
|
+
type: :runtime
|
|
117
|
+
prerelease: false
|
|
118
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
119
|
+
requirements:
|
|
120
|
+
-
|
|
121
|
+
- ">="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: "0"
|
|
124
|
+
- !ruby/object:Gem::Dependency
|
|
125
|
+
name: rails-dom-testing
|
|
126
|
+
requirement: !ruby/object:Gem::Requirement
|
|
127
|
+
requirements:
|
|
128
|
+
-
|
|
129
|
+
- ~>
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: "2.2"
|
|
132
|
+
type: :runtime
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
-
|
|
137
|
+
- ~>
|
|
138
|
+
- !ruby/object:Gem::Version
|
|
139
|
+
version: "2.2"
|
|
140
|
+
description: "AI on Rails. Compose, run, and test AI prompts using the familiar controller/view pattern."
|
|
112
141
|
email: Alexander.Senko@gmail.com
|
|
113
142
|
executables: []
|
|
114
143
|
extensions: []
|
|
115
144
|
extra_rdoc_files: []
|
|
116
145
|
files:
|
|
117
|
-
- CHANGELOG.md
|
|
118
|
-
- MIT-LICENSE
|
|
119
|
-
- README.rdoc
|
|
120
|
-
- lib/action_ai.rb
|
|
121
|
-
- lib/action_ai/agent.rb
|
|
122
|
-
- lib/action_ai/callbacks.rb
|
|
123
|
-
- lib/action_ai/deprecator.rb
|
|
124
|
-
- lib/action_ai/execution_job.rb
|
|
125
|
-
- lib/action_ai/
|
|
126
|
-
- lib/action_ai/
|
|
127
|
-
- lib/action_ai/
|
|
128
|
-
- lib/action_ai/
|
|
129
|
-
- lib/action_ai/
|
|
130
|
-
- lib/action_ai/
|
|
131
|
-
- lib/action_ai/
|
|
132
|
-
- lib/action_ai/
|
|
133
|
-
- lib/action_ai/
|
|
134
|
-
- lib/action_ai/
|
|
135
|
-
- lib/action_ai/
|
|
136
|
-
- lib/
|
|
137
|
-
- lib/
|
|
138
|
-
- lib/
|
|
139
|
-
- lib/
|
|
140
|
-
- lib/
|
|
141
|
-
- lib/
|
|
142
|
-
- lib/
|
|
143
|
-
|
|
146
|
+
- CHANGELOG.md
|
|
147
|
+
- MIT-LICENSE
|
|
148
|
+
- README.rdoc
|
|
149
|
+
- lib/action_ai.rb
|
|
150
|
+
- lib/action_ai/agent.rb
|
|
151
|
+
- lib/action_ai/callbacks.rb
|
|
152
|
+
- lib/action_ai/deprecator.rb
|
|
153
|
+
- lib/action_ai/execution_job.rb
|
|
154
|
+
- lib/action_ai/implicit_interaction.rb
|
|
155
|
+
- lib/action_ai/interaction.rb
|
|
156
|
+
- lib/action_ai/log_subscriber.rb
|
|
157
|
+
- lib/action_ai/model_schema.rb
|
|
158
|
+
- lib/action_ai/model_schema/active_model.rb
|
|
159
|
+
- lib/action_ai/model_schema/active_record.rb
|
|
160
|
+
- lib/action_ai/parameterized.rb
|
|
161
|
+
- lib/action_ai/preview.rb
|
|
162
|
+
- lib/action_ai/prompt_helper.rb
|
|
163
|
+
- lib/action_ai/queued_execution.rb
|
|
164
|
+
- lib/action_ai/railtie.rb
|
|
165
|
+
- lib/action_ai/refinements/numeric.rb
|
|
166
|
+
- lib/action_ai/refinements/regexp.rb
|
|
167
|
+
- lib/action_ai/rescuable.rb
|
|
168
|
+
- lib/action_ai/schema.rb
|
|
169
|
+
- lib/action_ai/structured_output.rb
|
|
170
|
+
- lib/action_ai/test_case.rb
|
|
171
|
+
- lib/action_ai/test_helper.rb
|
|
172
|
+
- lib/action_ai/version.rb
|
|
173
|
+
- lib/rails/generators/ai/USAGE
|
|
174
|
+
- lib/rails/generators/ai/ai_generator.rb
|
|
175
|
+
- lib/rails/generators/ai/templates/agent.rb.tt
|
|
176
|
+
- lib/rails/generators/ai/templates/application_agent.rb.tt
|
|
177
|
+
- lib/ruby_llm/protocols/echo.rb
|
|
178
|
+
- lib/ruby_llm/providers/test.rb
|
|
179
|
+
- lib/ruby_llm/tester.rb
|
|
180
|
+
homepage: "https://github.com/Alexander-Senko/action_ai"
|
|
144
181
|
licenses:
|
|
145
|
-
- MIT
|
|
182
|
+
- MIT
|
|
146
183
|
metadata:
|
|
147
|
-
bug_tracker_uri: https://github.com/Alexander-Senko/action_ai/issues
|
|
148
|
-
changelog_uri: https://github.com/Alexander-Senko/action_ai/blob/v0.
|
|
149
|
-
source_code_uri: https://github.com/Alexander-Senko/action_ai/tree/v0.
|
|
150
|
-
rubygems_mfa_required:
|
|
184
|
+
bug_tracker_uri: "https://github.com/Alexander-Senko/action_ai/issues"
|
|
185
|
+
changelog_uri: "https://github.com/Alexander-Senko/action_ai/blob/v0.3.0/CHANGELOG.md"
|
|
186
|
+
source_code_uri: "https://github.com/Alexander-Senko/action_ai/tree/v0.3.0"
|
|
187
|
+
rubygems_mfa_required: "true"
|
|
151
188
|
rdoc_options: []
|
|
152
189
|
require_paths:
|
|
153
|
-
- lib
|
|
190
|
+
- lib
|
|
154
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
192
|
requirements:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
193
|
+
-
|
|
194
|
+
- ">="
|
|
195
|
+
- !ruby/object:Gem::Version
|
|
196
|
+
version: "3.4"
|
|
159
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
198
|
requirements:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
199
|
+
-
|
|
200
|
+
- ">="
|
|
201
|
+
- !ruby/object:Gem::Version
|
|
202
|
+
version: "0"
|
|
164
203
|
requirements:
|
|
165
|
-
- none
|
|
166
|
-
rubygems_version:
|
|
204
|
+
- none
|
|
205
|
+
rubygems_version: 4.1.0.dev
|
|
167
206
|
specification_version: 4
|
|
168
207
|
summary: AI prompt composition and running framework
|
|
169
208
|
test_files: []
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module RubyLLM
|
|
4
|
-
module Providers
|
|
5
|
-
# Echo model behavior for the RubyLLM Test provider.
|
|
6
|
-
#
|
|
7
|
-
# A deterministic response builder (`#echo_response`) returns
|
|
8
|
-
# incoming prompt content.
|
|
9
|
-
#
|
|
10
|
-
# It is intended to be mixed into `RubyLLM::Providers::Test`.
|
|
11
|
-
module Test::Echo
|
|
12
|
-
def self.id = "echo"
|
|
13
|
-
|
|
14
|
-
def self.info = Model::Info.new(
|
|
15
|
-
id:,
|
|
16
|
-
name:,
|
|
17
|
-
provider: Test.slug,
|
|
18
|
-
capabilities: Test.capabilities,
|
|
19
|
-
|
|
20
|
-
modalities: {
|
|
21
|
-
input: %w[text],
|
|
22
|
-
output: %w[text],
|
|
23
|
-
},
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
private
|
|
27
|
-
|
|
28
|
-
def echo_response(messages, **) = {
|
|
29
|
-
content: RubyLLM.concat_content(messages.map(&:content)),
|
|
30
|
-
}
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def self.concat_content *parts
|
|
35
|
-
strings, contents = parts
|
|
36
|
-
.flatten
|
|
37
|
-
.partition { it.is_a? String }
|
|
38
|
-
|
|
39
|
-
Content.new(
|
|
40
|
-
[*strings, *contents.map(&:text)]
|
|
41
|
-
.reject(&:empty?)
|
|
42
|
-
.join("\n\n"),
|
|
43
|
-
contents.sum([], &:attachments)
|
|
44
|
-
.map(&:source)
|
|
45
|
-
)
|
|
46
|
-
end
|
|
47
|
-
end
|