ruby_llm-agent-evaluations 0.2.0 → 0.2.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c7cae718f0af572cfe99607d7d82e896ff635c332675c8e2df6c0e4b79f6a38
|
|
4
|
+
data.tar.gz: 43bae1d064264557c3c61293f7d1991ac951a43f7bec481e57371508e42f4726
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 070361d5bd53383114eb03ea872436af6e9501b4e19b6c0926671e948fce5e200ea7b151d4b12b15c79b8e87a6ddaf356bae858e8565c016c3e88ed826f2633e
|
|
7
|
+
data.tar.gz: a9124295de95c93f89e16565e7f73d6ede66a6210f59e7a517675ed9f9a2c4a640d298ea7cfdf9d11011b653a95240d7843a657896007b9485b5f847b3363967
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1
|
|
4
|
+
|
|
5
|
+
- Simplify new-project setup to one migration creating only runs, case results, and metric results, with `minimum_scores` from the start. Remove legacy schema detection, payload copying, temporary migration models, and the intermediate column-rename migration. Legacy database upgrades are no longer supported.
|
|
6
|
+
|
|
3
7
|
## 0.2.0
|
|
4
8
|
|
|
5
9
|
- Publish this project as `ruby_llm-agent-evaluations` to avoid the separately owned RubyGems package. Rename the executable and gemspec; preserve `RubyLLM::Evaluations`, `ruby_llm/evaluations`, Rails migration tasks, and PostgreSQL history. Version 0.2.0 is the first RubyGems release under the new name; the earlier section records this project's development history.
|
data/README.md
CHANGED
|
@@ -146,9 +146,9 @@ bin/rails ruby_llm_evaluations:install:migrations
|
|
|
146
146
|
bin/rails db:migrate
|
|
147
147
|
~~~
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
For standalone use, run `ruby_llm-agent-evaluations db:migrate` once before the first evaluation. Rails applications install the single engine migration and run `bin/rails db:migrate` as shown above.
|
|
150
150
|
|
|
151
|
-
PostgreSQL is required.
|
|
151
|
+
PostgreSQL is required. The single migration creates only three evaluation tables: `ruby_llm_evaluations_runs`, `ruby_llm_evaluations_case_results`, and `ruby_llm_evaluations_metric_results`. It creates `minimum_scores` directly, with the foreign keys and indexes needed for history and baseline comparisons. No legacy tables, payload imports, or custom schema-version tables are required or inspected. ActiveRecord manages its ordinary migration bookkeeping. Execution uses the host connection pool and does not establish, migrate, or disconnect it.
|
|
152
152
|
|
|
153
153
|
~~~ruby
|
|
154
154
|
# config/routes.rb
|
|
@@ -298,7 +298,7 @@ bundle exec rake integration
|
|
|
298
298
|
bundle exec rake test
|
|
299
299
|
|
|
300
300
|
gem build ruby_llm-agent-evaluations.gemspec
|
|
301
|
-
gem install ./ruby_llm-agent-evaluations-0.2.
|
|
301
|
+
gem install ./ruby_llm-agent-evaluations-0.2.1.gem
|
|
302
302
|
ruby_llm-agent-evaluations --help
|
|
303
303
|
~~~
|
|
304
304
|
|
|
@@ -4,44 +4,10 @@ class CreateAgentEvaluationHistory < ActiveRecord::Migration[7.1]
|
|
|
4
4
|
RUNS = "ruby_llm_evaluations_runs"
|
|
5
5
|
CASES = "ruby_llm_evaluations_case_results"
|
|
6
6
|
METRICS = "ruby_llm_evaluations_metric_results"
|
|
7
|
-
LEGACY = "ruby_llm_evaluations_legacy_runs"
|
|
8
|
-
LEGACY_VERSIONS = "ruby_llm_evaluations_schema_versions"
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
self.table_name = LEGACY
|
|
12
|
-
self.primary_key = "sequence"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
class LegacyVersion < ActiveRecord::Base
|
|
16
|
-
self.table_name = LEGACY_VERSIONS
|
|
17
|
-
self.primary_key = "version"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
class MigratedRun < ActiveRecord::Base
|
|
21
|
-
self.table_name = RUNS
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
class MigratedCase < ActiveRecord::Base
|
|
25
|
-
self.table_name = CASES
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
class MigratedMetric < ActiveRecord::Base
|
|
29
|
-
self.table_name = METRICS
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def up
|
|
8
|
+
def change
|
|
33
9
|
raise ActiveRecord::MigrationError, "evaluation history requires PostgreSQL" unless connection.adapter_name == "PostgreSQL"
|
|
34
10
|
|
|
35
|
-
legacy = table_exists?(RUNS) && column_exists?(RUNS, :payload)
|
|
36
|
-
if legacy
|
|
37
|
-
unless table_exists?(LEGACY_VERSIONS) && LegacyVersion.pluck(:version) == [1]
|
|
38
|
-
raise ActiveRecord::MigrationError, "unsupported legacy evaluation history version"
|
|
39
|
-
end
|
|
40
|
-
rename_table RUNS, LEGACY
|
|
41
|
-
elsif table_exists?(RUNS)
|
|
42
|
-
raise ActiveRecord::MigrationError, "evaluation model tables already exist without this migration"
|
|
43
|
-
end
|
|
44
|
-
|
|
45
11
|
create_table RUNS, id: :string do |table|
|
|
46
12
|
table.bigserial :sequence, null: false
|
|
47
13
|
table.string :suite, null: false
|
|
@@ -68,7 +34,7 @@ class CreateAgentEvaluationHistory < ActiveRecord::Migration[7.1]
|
|
|
68
34
|
table.jsonb :question
|
|
69
35
|
table.jsonb :expected_answer
|
|
70
36
|
table.jsonb :expected_actions
|
|
71
|
-
table.jsonb :
|
|
37
|
+
table.jsonb :minimum_scores, null: false, default: {}
|
|
72
38
|
table.jsonb :metadata, null: false, default: {}
|
|
73
39
|
table.jsonb :output
|
|
74
40
|
table.string :status, null: false
|
|
@@ -97,49 +63,5 @@ class CreateAgentEvaluationHistory < ActiveRecord::Migration[7.1]
|
|
|
97
63
|
end
|
|
98
64
|
add_index METRICS, [:case_result_id, :position], unique: true, name: "rle_metric_order"
|
|
99
65
|
add_index METRICS, [:case_result_id, :name], unique: true, name: "rle_metric_identity"
|
|
100
|
-
|
|
101
|
-
if legacy
|
|
102
|
-
copy_legacy_history
|
|
103
|
-
connection.reset_pk_sequence!(RUNS, "sequence", "#{RUNS}_sequence_seq")
|
|
104
|
-
drop_table LEGACY
|
|
105
|
-
end
|
|
106
|
-
drop_table LEGACY_VERSIONS if table_exists?(LEGACY_VERSIONS)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
def down
|
|
110
|
-
raise ActiveRecord::IrreversibleMigration, "evaluation history migration preserves append-only evidence"
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
private
|
|
114
|
-
|
|
115
|
-
def copy_legacy_history
|
|
116
|
-
[LegacyRun, MigratedRun, MigratedCase, MigratedMetric].each(&:reset_column_information)
|
|
117
|
-
LegacyRun.find_each do |row|
|
|
118
|
-
value = row.payload
|
|
119
|
-
run = MigratedRun.create!(
|
|
120
|
-
id: value.fetch("id"), sequence: row.sequence, suite: value.fetch("suite"), agent: value.fetch("agent"),
|
|
121
|
-
version: value.fetch("version", "1"), suite_digest: value.fetch("suite_digest"),
|
|
122
|
-
started_at: value.fetch("started_at"), finished_at: value.fetch("finished_at"),
|
|
123
|
-
status: value.fetch("status"), metadata: value.fetch("metadata", {}), summary: value.fetch("summary")
|
|
124
|
-
)
|
|
125
|
-
value.fetch("cases").each_with_index do |item, position|
|
|
126
|
-
metrics = item.fetch("evaluations")
|
|
127
|
-
question = MigratedCase.create!(
|
|
128
|
-
run_id: run.id, position: position, case_id: item.fetch("id"), name: item.fetch("name"),
|
|
129
|
-
question: item["input"], expected_answer: item["expected"], expected_actions: item["expected_actions"],
|
|
130
|
-
criteria: metrics.to_h { |metric| [metric.fetch("name"), metric.fetch("threshold")] },
|
|
131
|
-
metadata: item.fetch("metadata", {}), output: item["output"], status: item.fetch("status"),
|
|
132
|
-
duration_ms: item.fetch("duration_ms"), input_tokens: item["input_tokens"], output_tokens: item["output_tokens"],
|
|
133
|
-
cost: item["cost"], actions: item["actions"], response_metadata: item["response_metadata"], error_details: item["error"]
|
|
134
|
-
)
|
|
135
|
-
metrics.each_with_index do |metric, metric_position|
|
|
136
|
-
MigratedMetric.create!(
|
|
137
|
-
case_result_id: question.id, position: metric_position, name: metric.fetch("name"),
|
|
138
|
-
threshold: metric.fetch("threshold"), score: metric["score"], passed: metric.fetch("passed"),
|
|
139
|
-
reason: metric["reason"], error_details: metric["error"]
|
|
140
|
-
)
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
end
|
|
144
66
|
end
|
|
145
67
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_llm-agent-evaluations
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RubyLLM Evaluations contributors
|
|
@@ -94,7 +94,6 @@ files:
|
|
|
94
94
|
- app/models/ruby_llm/evaluations/run.rb
|
|
95
95
|
- config/routes.rb
|
|
96
96
|
- db/migrate/20261011000000_create_agent_evaluation_history.rb
|
|
97
|
-
- db/migrate/20261011000100_rename_case_criteria_to_minimum_scores.rb
|
|
98
97
|
- docs/images/dashboard-case.png
|
|
99
98
|
- docs/images/dashboard-history.png
|
|
100
99
|
- docs/images/dashboard-mobile.png
|