activeagent 0.3.2 → 0.4.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.
data/lib/active_agent.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require "yaml"
2
2
  require "abstract_controller"
3
- require "active_agent/action_prompt"
4
3
  require "active_agent/generation_provider"
5
4
  require "active_agent/version"
6
5
  require "active_agent/deprecator"
@@ -49,7 +48,7 @@ module ActiveAgent
49
48
 
50
49
  def load_configuration(file)
51
50
  if File.exist?(file)
52
- config_file = YAML.load(ERB.new(File.read(file)).result)
51
+ config_file = YAML.load(ERB.new(File.read(file)).result, aliases: true)
53
52
  env = ENV["RAILS_ENV"] || ENV["ENV"] || "development"
54
53
  @config = config_file[env] || config_file
55
54
  end
@@ -1 +1 @@
1
- <%= yield %>
1
+ <%= yield if block_given? %>
@@ -1 +1 @@
1
- <%= yield %>
1
+ <%= yield if block_given? %>
@@ -3,9 +3,5 @@ class ApplicationAgent < ActiveAgent::Base
3
3
  layout 'agent'
4
4
 
5
5
  generate_with :openai, model: "gpt-4o-mini", instructions: "You are a helpful assistant."
6
-
7
- def text_prompt
8
- prompt { |format| format.text { render plain: params[:message] } }
9
- end
10
6
  end
11
7
  <% end %>
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bowen
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-04-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: actionpack
@@ -130,6 +129,20 @@ dependencies:
130
129
  - - "<"
131
130
  - !ruby/object:Gem::Version
132
131
  version: '9.0'
132
+ - !ruby/object:Gem::Dependency
133
+ name: jbuilder
134
+ requirement: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ type: :development
140
+ prerelease: false
141
+ version_requirements: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
133
146
  description: The only agent-oriented AI framework designed for Rails, where Agents
134
147
  are Controllers. Build AI features with less complexity using the MVC conventions
135
148
  you love.
@@ -140,10 +153,9 @@ extra_rdoc_files: []
140
153
  files:
141
154
  - CHANGELOG.md
142
155
  - lib/active_agent.rb
143
- - lib/active_agent/README.md
144
156
  - lib/active_agent/action_prompt.rb
145
- - lib/active_agent/action_prompt/README.md
146
157
  - lib/active_agent/action_prompt/action.rb
158
+ - lib/active_agent/action_prompt/base.rb
147
159
  - lib/active_agent/action_prompt/message.rb
148
160
  - lib/active_agent/action_prompt/prompt.rb
149
161
  - lib/active_agent/base.rb
@@ -154,10 +166,11 @@ files:
154
166
  - lib/active_agent/generation_job.rb
155
167
  - lib/active_agent/generation_methods.rb
156
168
  - lib/active_agent/generation_provider.rb
157
- - lib/active_agent/generation_provider/README.md
158
169
  - lib/active_agent/generation_provider/anthropic_provider.rb
159
170
  - lib/active_agent/generation_provider/base.rb
171
+ - lib/active_agent/generation_provider/ollama_provider.rb
160
172
  - lib/active_agent/generation_provider/open_ai_provider.rb
173
+ - lib/active_agent/generation_provider/open_router_provider.rb
161
174
  - lib/active_agent/generation_provider/response.rb
162
175
  - lib/active_agent/inline_preview_interceptor.rb
163
176
  - lib/active_agent/log_subscriber.rb
@@ -192,7 +205,6 @@ metadata:
192
205
  documentation_uri: https://github.com/activeagents/activeagent
193
206
  source_code_uri: https://github.com/activeagents/activeagent
194
207
  rubygems_mfa_required: 'true'
195
- post_install_message:
196
208
  rdoc_options: []
197
209
  require_paths:
198
210
  - lib
@@ -207,8 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
219
  - !ruby/object:Gem::Version
208
220
  version: '0'
209
221
  requirements: []
210
- rubygems_version: 3.5.3
211
- signing_key:
222
+ rubygems_version: 3.6.9
212
223
  specification_version: 4
213
224
  summary: Rails AI Agents Framework
214
225
  test_files: []
@@ -1,21 +0,0 @@
1
- # Active Agent
2
- Active Agent is a Rails framework for creating and managing AI agents. It provides a structured way to interact with generation providers through agents with context including prompts, tools, and messages. It includes two core modules, Generation Provider and Action Prompt, along with several support classes to handle different aspects of agent creation and management.
3
-
4
- ## Core Modules
5
-
6
- - Generation Provider - module for configuring and interacting with generation providers through Prompts and Responses.
7
- - Action Prompt - module for defining prompts, tools, and messages. The Base class implements an AbstractController to render prompts and actions. Prompts are Action Views that provide instructions for the agent to generate content, formatted messages for the agent and users including **streaming generative UI**.
8
-
9
- ## Main Components
10
-
11
- - Base class - for creating and configuring agents.
12
- - Queued Generation - module for managing queued generation requests and responses. Using the Generation Job class to perform asynchronous generation requests, it provides a way to **stream generation** requests back to the Job, Agent, or User.
13
-
14
- ### ActiveAgent::Base
15
-
16
- The Base class is used to create agents that interact with generation providers through prompts and messages. It includes methods for configuring and interacting with generation providers using Prompts and Responses. The Base class also provides a structured way to render prompts and actions.
17
-
18
- #### Core Methods
19
-
20
- - `generate_with(provider, options = {})` - Configures the agent to generate content using the specified generation provider and options.
21
- - `streams_with(provider, options = {})` - Configures the agent to stream content using the specified generation provider's stream option.
File without changes
File without changes