activeagent 0.2.6.9 → 0.3

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: '08db8e070616e81109c24a4738d29cc5c7b2911a3b7584e90c23cd9a1072a20a'
4
- data.tar.gz: 424e66ddfde6018b15b33d440764604db3cb3c1c3bef3f6cc0c0e765cad8d06e
3
+ metadata.gz: bf6889f20afa4e61e46ab6edbe801186aee0d3fe85284f3ce6379509a6a76bc4
4
+ data.tar.gz: 3340dcc2d65740cea5a98f4c0640ac806e1686bb48bee2a3260cf3e65b5478b2
5
5
  SHA512:
6
- metadata.gz: d6b7d4b86153dfea08db656c6b0620229902d371fd0afccbc4eca30e961875a4982339dfd4cdc77c2349d9ecf7e9085a98de07a406c73c15cf4a25ffc0fe3548
7
- data.tar.gz: 4bb01d36f8610e25f0f0220f9b465779e15afa083786dfa8628def00b5a693a2804ff9665f967e484034ef30ea4312e2eafcc813aef1f66fb597ff7dd5bbbe49
6
+ metadata.gz: 8c63eaaad2c5049fac65902d5d5676f976580fffd40477287b149d29695c15b75143e1bbf8e60128c04adfc23531770c9ab1c7893a6cf73bd4f258315a93e251
7
+ data.tar.gz: 0be4d79a4755d23d1c7e2c659871d8e0480c05583e6fe1d6eae48571fd1d2540cc88ea53a827192109bf76476e237e8c09f1bbc64f97bca429416b3c7503154c
@@ -293,23 +293,6 @@ module ActiveAgent
293
293
  end
294
294
  end
295
295
 
296
- class LateAttachmentsProxy < SimpleDelegator
297
- def inline
298
- self
299
- end
300
-
301
- def []=(_name, _content)
302
- _raise_error
303
- end
304
-
305
- private
306
-
307
- def _raise_error
308
- raise "Can't add attachments after `prompt` was called.\n" \
309
- "Make sure to use `attachments[]=` before calling `prompt`."
310
- end
311
- end
312
-
313
296
  def prompt_with(*)
314
297
  prompt_context.update_prompt_context(*)
315
298
  end
@@ -323,6 +306,8 @@ module ActiveAgent
323
306
 
324
307
  prompt_context.context_id = headers[:context_id]
325
308
 
309
+ prompt_context.options = options.merge(headers[:options] || {})
310
+
326
311
  prompt_context.charset = charset = headers[:charset]
327
312
 
328
313
  responses = collect_responses(headers, &block)
@@ -105,6 +105,7 @@ module ActiveAgent
105
105
  end
106
106
 
107
107
  def chat_response(response)
108
+ binding.irb
108
109
  return @response if prompt.options[:stream]
109
110
 
110
111
  message_json = response.dig("choices", 0, "message")
@@ -1,3 +1,3 @@
1
1
  module ActiveAgent
2
- VERSION = "0.2.6.9"
2
+ VERSION = "0.3"
3
3
  end
@@ -30,13 +30,25 @@ module ActiveAgent
30
30
  def create_view_files
31
31
  actions.each do |action|
32
32
  @action = action
33
- @schema_path = File.join("app/views", class_path, file_name, "#{action}.json.jbuilder")
34
- @view_path = File.join("app/views", class_path, file_name, "#{action}.html.erb")
35
- template "action.json.jbuilder", @schema_path
36
- template "action.html.erb", @view_path
33
+
34
+ # Use configured template engines or fall back to defaults
35
+ json_template_engine = json_template_engine_for_views || "jbuilder"
36
+ html_template_engine = html_template_engine_for_views || "erb"
37
+
38
+ @schema_path = File.join("app/views", class_path, file_name, "#{action}.json.#{json_template_engine}")
39
+ @view_path = File.join("app/views", class_path, file_name, "#{action}.html.#{html_template_engine}")
40
+
41
+ template "action.json.#{json_template_engine}", @schema_path
42
+ template "action.html.#{html_template_engine}", @view_path
37
43
  end
38
44
  end
39
45
 
46
+ def create_layout_files
47
+ # Create the application agent layouts
48
+ template "layout.text.erb", "app/views/layouts/agent.text.erb"
49
+ template "layout.html.erb", "app/views/layouts/agent.html.erb"
50
+ end
51
+
40
52
  private
41
53
 
42
54
  def test_framework
@@ -47,6 +59,17 @@ module ActiveAgent
47
59
  ::Rails.application.config.generators.options[:rails][:template_engine]
48
60
  end
49
61
 
62
+ def json_template_engine_for_views
63
+ # Check if there's a specific JSON template engine configured
64
+ json_engine = ::Rails.application.config.generators.options[:rails][:json_template_engine]
65
+ json_engine || "jbuilder" # Default to jbuilder if not specified
66
+ end
67
+
68
+ def html_template_engine_for_views
69
+ # Use the configured template engine or default to erb
70
+ template_engine || "erb"
71
+ end
72
+
50
73
  def file_name # :doc:
51
74
  @_file_name ||= super + "_agent"
52
75
  end
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :activeagent do
3
+ # # Task goes here
4
+ # end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6.9
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bowen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-26 00:00:00.000000000 Z
11
+ date: 2025-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -184,6 +184,9 @@ files:
184
184
  - lib/generators/active_agent/templates/agent_spec.rb.tt
185
185
  - lib/generators/active_agent/templates/agent_test.rb.tt
186
186
  - lib/generators/active_agent/templates/application_agent.rb.tt
187
+ - lib/generators/active_agent/templates/layout.html.erb
188
+ - lib/generators/active_agent/templates/layout.text.erb
189
+ - lib/tasks/activeagent_tasks.rake
187
190
  homepage: https://activeagents.ai
188
191
  licenses:
189
192
  - MIT