activeagent 1.9.6 → 1.9.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +612 -28
  3. data/README.md +9 -0
  4. data/lib/active_agent/base.rb +1 -0
  5. data/lib/active_agent/cli/eval_commands.rb +50 -7
  6. data/lib/active_agent/concerns/tooling.rb +11 -0
  7. data/lib/active_agent/evals/capture.rb +286 -0
  8. data/lib/active_agent/evals/catalog.rb +150 -19
  9. data/lib/active_agent/evals/gate_check.rb +79 -0
  10. data/lib/active_agent/evals/pass_thresholds.rb +137 -0
  11. data/lib/active_agent/evals/patterns.rb +80 -0
  12. data/lib/active_agent/evals/publisher.rb +124 -8
  13. data/lib/active_agent/evals/report.rb +165 -20
  14. data/lib/active_agent/evals/report_html.rb +91 -17
  15. data/lib/active_agent/evals/report_markdown.rb +63 -6
  16. data/lib/active_agent/evals/result.rb +10 -2
  17. data/lib/active_agent/evals/rspec.rb +87 -0
  18. data/lib/active_agent/evals/ruby_llm.rb +105 -3
  19. data/lib/active_agent/evals/runner.rb +59 -16
  20. data/lib/active_agent/evals/scenario.rb +12 -4
  21. data/lib/active_agent/evals/scenario_parser.rb +9 -1
  22. data/lib/active_agent/evals/scorer.rb +53 -23
  23. data/lib/active_agent/evals/suite.rb +117 -6
  24. data/lib/active_agent/evals/test_helper.rb +286 -0
  25. data/lib/active_agent/evals.rb +9 -1
  26. data/lib/active_agent/model_capabilities.rb +1 -1
  27. data/lib/active_agent/providers/_base_provider.rb +18 -2
  28. data/lib/active_agent/providers/anthropic_provider.rb +10 -0
  29. data/lib/active_agent/providers/atlas_cloud/options.rb +35 -0
  30. data/lib/active_agent/providers/atlas_cloud_provider.rb +45 -0
  31. data/lib/active_agent/providers/bedrock/bearer_client.rb +2 -1
  32. data/lib/active_agent/providers/cheaper_inference/_types.rb +17 -0
  33. data/lib/active_agent/providers/cheaper_inference/options.rb +39 -0
  34. data/lib/active_agent/providers/cheaper_inference_provider.rb +72 -0
  35. data/lib/active_agent/providers/common/usage.rb +6 -1
  36. data/lib/active_agent/providers/ollama/_types.rb +1 -0
  37. data/lib/active_agent/providers/ollama/catalog.rb +221 -0
  38. data/lib/active_agent/providers/ollama/cloud.rb +109 -0
  39. data/lib/active_agent/providers/ollama/options.rb +66 -2
  40. data/lib/active_agent/providers/ollama_provider.rb +55 -3
  41. data/lib/active_agent/providers/open_ai/responses_provider.rb +7 -0
  42. data/lib/active_agent/providers/requesty_provider.rb +8 -0
  43. data/lib/active_agent/providers/ruby_llm/tool_proxy.rb +15 -0
  44. data/lib/active_agent/providers/ruby_llm_provider.rb +41 -5
  45. data/lib/active_agent/providers/runcrate/_types.rb +17 -0
  46. data/lib/active_agent/providers/runcrate/options.rb +39 -0
  47. data/lib/active_agent/providers/runcrate_provider.rb +72 -0
  48. data/lib/active_agent/railtie.rb +4 -0
  49. data/lib/active_agent/version.rb +1 -1
  50. data/lib/tasks/active_agent/evals.rake +28 -0
  51. metadata +27 -5
  52. data/lib/tasks/activeagent_tasks.rake +0 -4
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../open_ai/options"
4
+
5
+ module ActiveAgent
6
+ module Providers
7
+ module Runcrate
8
+ # Configuration options for the Runcrate provider.
9
+ #
10
+ # Extends OpenAI::Options, overriding the base URL to point at
11
+ # Runcrate's OpenAI-compatible inference API and resolving the API key
12
+ # from RUNCRATE_API_KEY. Runcrate does not use organization or project
13
+ # identifiers.
14
+ #
15
+ # @example Basic configuration
16
+ # options = Options.new(api_key: ENV["RUNCRATE_API_KEY"])
17
+ #
18
+ # @see https://runcrate.ai/docs/models/overview
19
+ # @see https://runcrate.ai/dashboard/api-keys Runcrate API Keys
20
+ class Options < ActiveAgent::Providers::OpenAI::Options
21
+ # @!attribute base_url
22
+ # @return [String] API endpoint (default: "https://api.runcrate.ai/v1")
23
+ attribute :base_url, :string, as: "https://api.runcrate.ai/v1"
24
+
25
+ private
26
+
27
+ def resolve_api_key(kwargs)
28
+ kwargs[:api_key] ||
29
+ kwargs[:access_token] ||
30
+ ENV["RUNCRATE_API_KEY"]
31
+ end
32
+
33
+ # Not used as part of Runcrate
34
+ def resolve_organization_id(kwargs) = nil
35
+ def resolve_project_id(kwargs) = nil
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,72 @@
1
+ require_relative "_base_provider"
2
+
3
+ require_gem!(:openai, __FILE__)
4
+
5
+ require_relative "open_ai_provider"
6
+ require_relative "runcrate/_types"
7
+
8
+ module ActiveAgent
9
+ module Providers
10
+ # Provides access to Runcrate's OpenAI-compatible inference API for
11
+ # open-weight models.
12
+ #
13
+ # Extends the OpenAI provider to work with Runcrate's OpenAI-compatible
14
+ # API. Model ids are the vendor-prefixed names Runcrate lists at
15
+ # +/v1/models+ (e.g. +deepseek-ai/DeepSeek-V4.1-Flash+).
16
+ #
17
+ # Runcrate is a plain OpenAI-compatible API: requests, responses and
18
+ # transforms are identical to the OpenAI Chat API, so this provider
19
+ # reuses OpenAI::Chat::RequestType and OpenAI::Chat::Transforms directly.
20
+ # The only Runcrate-specific configuration is the base URL and API key,
21
+ # which live in Runcrate::Options.
22
+ #
23
+ # @example Configuration in active_agent.yml
24
+ # runcrate:
25
+ # service: "Runcrate"
26
+ # api_key: <%= ENV["RUNCRATE_API_KEY"] %>
27
+ # model: "deepseek-ai/DeepSeek-V4.1-Flash"
28
+ #
29
+ # @see OpenAI::ChatProvider
30
+ # @see https://runcrate.ai/docs/models/overview
31
+ class RuncrateProvider < OpenAI::ChatProvider
32
+ # @return [String]
33
+ def self.service_name
34
+ "Runcrate"
35
+ end
36
+
37
+ # @return [Class]
38
+ def self.options_klass
39
+ Runcrate::Options
40
+ end
41
+
42
+ # @return [ActiveModel::Type::Value]
43
+ def self.prompt_request_type
44
+ OpenAI::Chat::RequestType.new
45
+ end
46
+
47
+ # @return [ActiveModel::Type::Value]
48
+ def self.embed_request_type
49
+ OpenAI::Embedding::RequestType.new
50
+ end
51
+
52
+ protected
53
+
54
+ # Executes an embedding request via Runcrate's OpenAI-compatible API.
55
+ #
56
+ # @param parameters [Hash]
57
+ # @return [Hash] symbolized API response
58
+ def api_embed_execute(parameters)
59
+ client.embeddings.create(**parameters).as_json.deep_symbolize_keys
60
+ end
61
+
62
+ # @see BaseProvider#api_response_normalize
63
+ # @param api_response [OpenAI::Models::ChatCompletion]
64
+ # @return [Hash] normalized response hash
65
+ def api_response_normalize(api_response)
66
+ return api_response unless api_response
67
+
68
+ OpenAI::Chat::Transforms.gem_to_hash(api_response)
69
+ end
70
+ end
71
+ end
72
+ end
@@ -15,6 +15,10 @@ module ActiveAgent
15
15
  config.active_agent.telemetry = ActiveSupport::OrderedOptions.new
16
16
  config.eager_load_namespaces << ActiveAgent
17
17
 
18
+ rake_tasks do
19
+ load File.expand_path("../tasks/active_agent/evals.rake", __dir__)
20
+ end
21
+
18
22
  initializer "active_agent.deprecator", before: :load_environment_config do |app|
19
23
  app.deprecators[:active_agent] = ActiveAgent.deprecator
20
24
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveAgent
2
- VERSION = "1.9.6"
2
+ VERSION = "1.9.8"
3
3
  end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Evals are ordinary tests under test/evals that each call a model, so
4
+ # `rails test` skips them (ActiveAgent::Evals::TestCase checks EVALS) and this
5
+ # task runs them: it switches EVALS on and hands test/evals to the same runner
6
+ # `rails test` uses, so seeds, parallel workers and reporters behave the same.
7
+ #
8
+ # bin/rails test:evals
9
+ # bin/rails test:evals TEST=test/evals/support_agent_test.rb
10
+ # bin/rails test:evals TESTOPTS="--seed 1234 -v"
11
+ # EVALS=1 bin/rails test test/evals/support_agent_test.rb:12 # one eval, through rails test
12
+ # EVALS=1 bin/rails test # the whole suite, evals included
13
+ namespace :test do
14
+ desc "Run the agent evals in test/evals (switches EVALS on); TEST=path narrows, TESTOPTS passes options"
15
+ task :evals do
16
+ require "active_agent/evals/test_helper"
17
+ require "rails/test_unit/runner"
18
+
19
+ paths = Array(ENV["TEST"]).map(&:to_s).reject(&:empty?).presence || [ "test/evals" ]
20
+ # A path, a path:line or a glob, as `rails test` takes them.
21
+ missing = paths.reject { |path| File.exist?(path.sub(/:\d+\z/, "")) || Dir.glob(path).any? }
22
+ abort "No evals found: #{missing.join(", ")} does not exist. Evals are tests under test/evals." if missing.any?
23
+
24
+ ENV[ActiveAgent::Evals::TestHelper::ENV_KEY] = "1"
25
+ runner = Rails::TestUnit::Runner
26
+ runner.respond_to?(:run_from_rake) ? runner.run_from_rake("test", paths) : runner.rake_run(paths)
27
+ end
28
+ 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: 1.9.6
4
+ version: 1.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bowen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-30 00:00:00.000000000 Z
11
+ date: 2026-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -162,16 +162,22 @@ dependencies:
162
162
  name: anthropic
163
163
  requirement: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - "~>"
165
+ - - ">="
166
166
  - !ruby/object:Gem::Version
167
167
  version: '1.12'
168
+ - - "<"
169
+ - !ruby/object:Gem::Version
170
+ version: '3'
168
171
  type: :development
169
172
  prerelease: false
170
173
  version_requirements: !ruby/object:Gem::Requirement
171
174
  requirements:
172
- - - "~>"
175
+ - - ">="
173
176
  - !ruby/object:Gem::Version
174
177
  version: '1.12'
178
+ - - "<"
179
+ - !ruby/object:Gem::Version
180
+ version: '3'
175
181
  - !ruby/object:Gem::Dependency
176
182
  name: aws-sdk-bedrockruntime
177
183
  requirement: !ruby/object:Gem::Requirement
@@ -464,20 +470,25 @@ files:
464
470
  - lib/active_agent/delegation/schema.rb
465
471
  - lib/active_agent/deprecator.rb
466
472
  - lib/active_agent/evals.rb
473
+ - lib/active_agent/evals/capture.rb
467
474
  - lib/active_agent/evals/catalog.rb
468
475
  - lib/active_agent/evals/comparison.rb
469
476
  - lib/active_agent/evals/correlation.rb
470
477
  - lib/active_agent/evals/design_tokens.rb
471
478
  - lib/active_agent/evals/diagnosis.rb
472
479
  - lib/active_agent/evals/format.rb
480
+ - lib/active_agent/evals/gate_check.rb
473
481
  - lib/active_agent/evals/judge.rb
474
482
  - lib/active_agent/evals/model_spec.rb
483
+ - lib/active_agent/evals/pass_thresholds.rb
484
+ - lib/active_agent/evals/patterns.rb
475
485
  - lib/active_agent/evals/publisher.rb
476
486
  - lib/active_agent/evals/replay.rb
477
487
  - lib/active_agent/evals/report.rb
478
488
  - lib/active_agent/evals/report_html.rb
479
489
  - lib/active_agent/evals/report_markdown.rb
480
490
  - lib/active_agent/evals/result.rb
491
+ - lib/active_agent/evals/rspec.rb
481
492
  - lib/active_agent/evals/ruby_llm.rb
482
493
  - lib/active_agent/evals/runner.rb
483
494
  - lib/active_agent/evals/scenario.rb
@@ -485,6 +496,7 @@ files:
485
496
  - lib/active_agent/evals/scorer.rb
486
497
  - lib/active_agent/evals/statistics.rb
487
498
  - lib/active_agent/evals/suite.rb
499
+ - lib/active_agent/evals/test_helper.rb
488
500
  - lib/active_agent/generation.rb
489
501
  - lib/active_agent/generation_job.rb
490
502
  - lib/active_agent/inline_preview_interceptor.rb
@@ -500,6 +512,8 @@ files:
500
512
  - lib/active_agent/providers/anthropic/request.rb
501
513
  - lib/active_agent/providers/anthropic/transforms.rb
502
514
  - lib/active_agent/providers/anthropic_provider.rb
515
+ - lib/active_agent/providers/atlas_cloud/options.rb
516
+ - lib/active_agent/providers/atlas_cloud_provider.rb
503
517
  - lib/active_agent/providers/azure/_types.rb
504
518
  - lib/active_agent/providers/azure/options.rb
505
519
  - lib/active_agent/providers/azure_open_ai_provider.rb
@@ -510,6 +524,9 @@ files:
510
524
  - lib/active_agent/providers/bedrock/bearer_client.rb
511
525
  - lib/active_agent/providers/bedrock/options.rb
512
526
  - lib/active_agent/providers/bedrock_provider.rb
527
+ - lib/active_agent/providers/cheaper_inference/_types.rb
528
+ - lib/active_agent/providers/cheaper_inference/options.rb
529
+ - lib/active_agent/providers/cheaper_inference_provider.rb
513
530
  - lib/active_agent/providers/common/messages/_types.rb
514
531
  - lib/active_agent/providers/common/messages/assistant.rb
515
532
  - lib/active_agent/providers/common/messages/base.rb
@@ -554,9 +571,11 @@ files:
554
571
  - lib/active_agent/providers/mock/request.rb
555
572
  - lib/active_agent/providers/mock_provider.rb
556
573
  - lib/active_agent/providers/ollama/_types.rb
574
+ - lib/active_agent/providers/ollama/catalog.rb
557
575
  - lib/active_agent/providers/ollama/chat/_types.rb
558
576
  - lib/active_agent/providers/ollama/chat/request.rb
559
577
  - lib/active_agent/providers/ollama/chat/transforms.rb
578
+ - lib/active_agent/providers/ollama/cloud.rb
560
579
  - lib/active_agent/providers/ollama/embedding/_types.rb
561
580
  - lib/active_agent/providers/ollama/embedding/request.rb
562
581
  - lib/active_agent/providers/ollama/embedding/transforms.rb
@@ -617,6 +636,9 @@ files:
617
636
  - lib/active_agent/providers/ruby_llm/tool_proxy.rb
618
637
  - lib/active_agent/providers/ruby_llm_provider.rb
619
638
  - lib/active_agent/providers/rubyllm_provider.rb
639
+ - lib/active_agent/providers/runcrate/_types.rb
640
+ - lib/active_agent/providers/runcrate/options.rb
641
+ - lib/active_agent/providers/runcrate_provider.rb
620
642
  - lib/active_agent/railtie.rb
621
643
  - lib/active_agent/railtie/schema_generator_extension.rb
622
644
  - lib/active_agent/schema_generator.rb
@@ -654,7 +676,7 @@ files:
654
676
  - lib/generators/test_unit/templates/functional_test.rb.tt
655
677
  - lib/generators/test_unit/templates/preview.rb.tt
656
678
  - lib/rails/agents_controller.rb
657
- - lib/tasks/activeagent_tasks.rake
679
+ - lib/tasks/active_agent/evals.rake
658
680
  homepage: https://activeagents.ai
659
681
  licenses:
660
682
  - MIT
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :activeagent do
3
- # # Task goes here
4
- # end