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 +4 -4
- data/lib/active_agent/base.rb +2 -17
- data/lib/active_agent/generation_provider/open_ai_provider.rb +1 -0
- data/lib/active_agent/version.rb +1 -1
- data/lib/generators/active_agent/agent_generator.rb +27 -4
- data/lib/generators/active_agent/templates/layout.html.erb +1 -0
- data/lib/generators/active_agent/templates/layout.text.erb +1 -0
- data/lib/tasks/activeagent_tasks.rake +4 -0
- metadata +5 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: bf6889f20afa4e61e46ab6edbe801186aee0d3fe85284f3ce6379509a6a76bc4
         | 
| 4 | 
            +
              data.tar.gz: 3340dcc2d65740cea5a98f4c0640ac806e1686bb48bee2a3260cf3e65b5478b2
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 8c63eaaad2c5049fac65902d5d5676f976580fffd40477287b149d29695c15b75143e1bbf8e60128c04adfc23531770c9ab1c7893a6cf73bd4f258315a93e251
         | 
| 7 | 
            +
              data.tar.gz: 0be4d79a4755d23d1c7e2c659871d8e0480c05583e6fe1d6eae48571fd1d2540cc88ea53a827192109bf76476e237e8c09f1bbc64f97bca429416b3c7503154c
         | 
    
        data/lib/active_agent/base.rb
    CHANGED
    
    | @@ -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)
         | 
    
        data/lib/active_agent/version.rb
    CHANGED
    
    
| @@ -30,13 +30,25 @@ module ActiveAgent | |
| 30 30 | 
             
                  def create_view_files
         | 
| 31 31 | 
             
                    actions.each do |action|
         | 
| 32 32 | 
             
                      @action = action
         | 
| 33 | 
            -
                       | 
| 34 | 
            -
                       | 
| 35 | 
            -
                       | 
| 36 | 
            -
                       | 
| 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 %>
         | 
    
        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. | 
| 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- | 
| 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
         |