agentv 5.0.0-next.1 → 5.2.0-next.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.
- package/README.md +239 -53
- package/dist/{agentv-provider-AYXH7WLW-NJRC6UQX.js → agentv-provider-AYXH7WLW-6YZKZ7PS.js} +2 -2
- package/dist/{artifact-writer-QD52FC56.js → artifact-writer-SN6UNL5G.js} +15 -8
- package/dist/{chunk-GZJMODLW.js → chunk-3S6A2RKR.js} +45880 -30542
- package/dist/chunk-3S6A2RKR.js.map +1 -0
- package/dist/{chunk-6Q56CEXV.js → chunk-3X357HS4.js} +7900 -8985
- package/dist/chunk-3X357HS4.js.map +1 -0
- package/dist/{chunk-6JVM4GJI.js → chunk-46K2OET3.js} +187 -80
- package/dist/chunk-46K2OET3.js.map +1 -0
- package/dist/{chunk-IJEZFZJR.js → chunk-7BGERE6L.js} +2 -2
- package/dist/chunk-7BGERE6L.js.map +1 -0
- package/dist/{chunk-UG4JHZYM.js → chunk-ALVZQUZP.js} +670 -1427
- package/dist/chunk-ALVZQUZP.js.map +1 -0
- package/dist/{chunk-RCIEHFQ2.js → chunk-PEUTJS7B.js} +3 -3
- package/dist/{chunk-5H446C7X.js → chunk-QMRVH5ZP.js} +2 -8
- package/dist/{chunk-IBI7A5RP.js → chunk-T4AD3H3Y.js} +3444 -2251
- package/dist/chunk-T4AD3H3Y.js.map +1 -0
- package/dist/cli.js +8 -9
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/assets/{index-D5_8DE_B.js → index-DNgf3qJ2.js} +1 -1
- package/dist/dashboard/assets/index-D_bokML8.css +1 -0
- package/dist/dashboard/assets/index-r_jSJmlw.js +121 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/{dist-KJ6PELQY.js → dist-DEPJOMCA.js} +74 -60
- package/dist/{docker-workspace-ZJ2ESVBI-6UDETQII.js → docker-workspace-NNK4Z6FR-QRTIG6TM.js} +3 -3
- package/dist/{exec-MYPAJJP7-C5HD5WG5.js → exec-4HFFRQ3B-AXDMJNLJ.js} +3 -3
- package/dist/index.js +8 -9
- package/dist/{interactive-2WMVAASS.js → interactive-36ZNMQB2.js} +13 -29
- package/dist/interactive-36ZNMQB2.js.map +1 -0
- package/dist/skills/agentv-bench/SKILL.md +38 -34
- package/dist/skills/agentv-bench/agents/analyzer.md +6 -6
- package/dist/skills/agentv-bench/agents/comparator.md +4 -5
- package/dist/skills/agentv-bench/agents/grader.md +4 -4
- package/dist/skills/agentv-bench/references/autoresearch.md +3 -3
- package/dist/skills/agentv-bench/references/description-optimization.md +2 -2
- package/dist/skills/agentv-bench/references/environment-adaptation.md +10 -10
- package/dist/skills/agentv-bench/references/eval-yaml-spec.md +51 -30
- package/dist/skills/agentv-bench/references/migrating-from-skill-creator.md +4 -4
- package/dist/skills/agentv-bench/references/subagent-pipeline.md +13 -12
- package/dist/skills/agentv-eval-migrations/SKILL.md +33 -0
- package/dist/skills/agentv-eval-migrations/references/breaking-changes.md +1012 -0
- package/dist/skills/agentv-eval-review/SKILL.md +6 -3
- package/dist/skills/agentv-eval-review/scripts/lint_eval.py +1 -1
- package/dist/skills/agentv-eval-writer/SKILL.md +380 -246
- package/dist/skills/agentv-eval-writer/references/{config-schema.json → config.schema.json} +6 -5
- package/dist/skills/agentv-eval-writer/references/custom-evaluators.md +23 -18
- package/dist/skills/agentv-eval-writer/references/eval.schema.json +9852 -0
- package/dist/skills/agentv-eval-writer/references/python-helpers.md +8 -8
- package/dist/skills/agentv-eval-writer/references/rubric-evaluator.md +21 -22
- package/dist/skills/agentv-trace-analyst/SKILL.md +4 -4
- package/dist/templates/.agentv/targets.yaml +41 -40
- package/dist/{ts-eval-loader-RE43OAGX-AMRCUKBZ.js → ts-eval-loader-OMG2JBHP-OP5RR7A3.js} +5 -4
- package/package.json +19 -4
- package/dist/chunk-6JVM4GJI.js.map +0 -1
- package/dist/chunk-6Q56CEXV.js.map +0 -1
- package/dist/chunk-76FOHROU.js +0 -96
- package/dist/chunk-76FOHROU.js.map +0 -1
- package/dist/chunk-GZJMODLW.js.map +0 -1
- package/dist/chunk-HSHTTN6C.js +0 -565
- package/dist/chunk-HSHTTN6C.js.map +0 -1
- package/dist/chunk-IBI7A5RP.js.map +0 -1
- package/dist/chunk-IJEZFZJR.js.map +0 -1
- package/dist/chunk-LRULMAAA.js +0 -1711
- package/dist/chunk-LRULMAAA.js.map +0 -1
- package/dist/chunk-R3CXYNTN.js +0 -1238
- package/dist/chunk-R3CXYNTN.js.map +0 -1
- package/dist/chunk-UG4JHZYM.js.map +0 -1
- package/dist/chunk-VQ2ZO7XJ.js +0 -2098
- package/dist/chunk-VQ2ZO7XJ.js.map +0 -1
- package/dist/chunk-XALGXSKB.js +0 -21
- package/dist/chunk-XALGXSKB.js.map +0 -1
- package/dist/dashboard/assets/index-BVMrdN8a.js +0 -119
- package/dist/dashboard/assets/index-DZWXfWsv.css +0 -1
- package/dist/esm-NNMQYIKT.js +0 -32
- package/dist/esm-R77SNOF5.js +0 -65
- package/dist/esm-RVQPUGWH.js +0 -1207
- package/dist/esm-RVQPUGWH.js.map +0 -1
- package/dist/esm-TTEMJEVV.js +0 -933
- package/dist/esm-TTEMJEVV.js.map +0 -1
- package/dist/esm-ZADQ4XQH-QUFGGZL4.js +0 -924
- package/dist/esm-ZADQ4XQH-QUFGGZL4.js.map +0 -1
- package/dist/exec-MYPAJJP7-C5HD5WG5.js.map +0 -1
- package/dist/getMachineId-bsd-HSK5LZMG.js +0 -41
- package/dist/getMachineId-bsd-HSK5LZMG.js.map +0 -1
- package/dist/getMachineId-darwin-4DP6CCJV.js +0 -41
- package/dist/getMachineId-darwin-4DP6CCJV.js.map +0 -1
- package/dist/getMachineId-linux-44LJ5UJB.js +0 -33
- package/dist/getMachineId-linux-44LJ5UJB.js.map +0 -1
- package/dist/getMachineId-unsupported-NVK6IATM.js +0 -24
- package/dist/getMachineId-unsupported-NVK6IATM.js.map +0 -1
- package/dist/getMachineId-win-YZ36S7VA.js +0 -43
- package/dist/getMachineId-win-YZ36S7VA.js.map +0 -1
- package/dist/interactive-2WMVAASS.js.map +0 -1
- package/dist/otlp-json-file-exporter-RY63S3IG-PZBQPVYY.js +0 -9
- package/dist/otlp-json-file-exporter-RY63S3IG-PZBQPVYY.js.map +0 -1
- package/dist/skills/agentv-eval-writer/references/eval-schema.json +0 -17295
- package/dist/skills/agentv-eval-writer/references/experiment-schema.json +0 -278
- package/dist/src-76ISS3LH.js +0 -1733
- package/dist/src-76ISS3LH.js.map +0 -1
- package/dist/ts-eval-loader-RE43OAGX-AMRCUKBZ.js.map +0 -1
- /package/dist/{agentv-provider-AYXH7WLW-NJRC6UQX.js.map → agentv-provider-AYXH7WLW-6YZKZ7PS.js.map} +0 -0
- /package/dist/{artifact-writer-QD52FC56.js.map → artifact-writer-SN6UNL5G.js.map} +0 -0
- /package/dist/{chunk-RCIEHFQ2.js.map → chunk-PEUTJS7B.js.map} +0 -0
- /package/dist/{chunk-5H446C7X.js.map → chunk-QMRVH5ZP.js.map} +0 -0
- /package/dist/{dist-KJ6PELQY.js.map → dist-DEPJOMCA.js.map} +0 -0
- /package/dist/{docker-workspace-ZJ2ESVBI-6UDETQII.js.map → docker-workspace-NNK4Z6FR-QRTIG6TM.js.map} +0 -0
- /package/dist/{esm-NNMQYIKT.js.map → exec-4HFFRQ3B-AXDMJNLJ.js.map} +0 -0
- /package/dist/{esm-R77SNOF5.js.map → ts-eval-loader-OMG2JBHP-OP5RR7A3.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "AgentV Config Schema",
|
|
4
|
-
"description": "Schema for .agentv/config.yaml configuration files",
|
|
4
|
+
"description": "Schema for .agentv/config.yaml and .agentv/config.local.yaml configuration files",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"$schema": {
|
|
@@ -37,6 +37,11 @@
|
|
|
37
37
|
"description": "Always keep temp workspaces after eval (equivalent to --keep-workspaces)",
|
|
38
38
|
"default": false
|
|
39
39
|
},
|
|
40
|
+
"workspace_path": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Machine-local existing workspace directory for eval runs (equivalent to --workspace-path). Only honored in .agentv/config.local.yaml; do not commit local paths.",
|
|
43
|
+
"examples": ["/home/user/workspaces/my-eval"]
|
|
44
|
+
},
|
|
40
45
|
"otel_file": {
|
|
41
46
|
"type": "string",
|
|
42
47
|
"description": "Write OTLP JSON trace to this path (equivalent to --otel-file). Supports {timestamp} placeholder.",
|
|
@@ -145,10 +150,6 @@
|
|
|
145
150
|
"auto_push": {
|
|
146
151
|
"type": "boolean",
|
|
147
152
|
"description": "Push result commits best-effort after each completed run."
|
|
148
|
-
},
|
|
149
|
-
"require_push": {
|
|
150
|
-
"type": "boolean",
|
|
151
|
-
"description": "Fail the command if a configured push fails after writing local artifacts."
|
|
152
153
|
}
|
|
153
154
|
},
|
|
154
155
|
"additionalProperties": false
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
# Custom Graders
|
|
1
|
+
# Custom Graders and Assertions
|
|
2
|
+
|
|
3
|
+
Use **custom assertions** for reusable assertion types discovered from `.agentv/assertions/` via `defineAssertion()`. Use **script graders** for command-backed or LLM-backed scoring components referenced with `type: script` and `command:`.
|
|
4
|
+
|
|
5
|
+
Promptfoo normally calls eval custom logic assertions and uses fixed assertion types such as `javascript`, `python`, `ruby`, and `webhook`. AgentV follows that assertion terminology for `defineAssertion()` and extends it with arbitrary discovered assertion type names.
|
|
2
6
|
|
|
3
7
|
## Wire Format
|
|
4
8
|
|
|
@@ -6,7 +10,6 @@
|
|
|
6
10
|
|
|
7
11
|
```json
|
|
8
12
|
{
|
|
9
|
-
"criteria": "string",
|
|
10
13
|
"input_files": ["path"],
|
|
11
14
|
"input": [{"role": "user", "content": "..."}],
|
|
12
15
|
"expected_output": [{"role": "assistant", "content": "..."}],
|
|
@@ -54,34 +57,34 @@
|
|
|
54
57
|
```typescript
|
|
55
58
|
import {
|
|
56
59
|
createTargetClient,
|
|
57
|
-
|
|
60
|
+
defineScriptGrader,
|
|
58
61
|
defineEval,
|
|
59
62
|
definePromptTemplate,
|
|
60
63
|
graders,
|
|
61
64
|
} from '@agentv/sdk';
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
- `
|
|
67
|
+
- `defineScriptGrader(fn)` - Wraps evaluation function with stdin/stdout handling
|
|
65
68
|
- `defineEval(definition)` - Defines a YAML-aligned `.eval.ts` suite
|
|
66
|
-
- `graders` - Helper catalog that returns ordinary AgentV `
|
|
69
|
+
- `graders` - Helper catalog that returns ordinary AgentV `assert` entries
|
|
67
70
|
- `createTargetClient()` - Returns LLM proxy client (when `target: {}` configured)
|
|
68
71
|
- `.invoke({question, systemPrompt})` - Single LLM call
|
|
69
72
|
- `.invokeBatch(requests)` - Batch LLM calls
|
|
70
73
|
- `definePromptTemplate(fn)` - Wraps prompt generation function
|
|
71
74
|
- Raw stdin uses `snake_case`; SDK handlers receive `camelCase`
|
|
72
|
-
- Context fields: `input`, `expectedOutput`, `output`, `messages`, `
|
|
75
|
+
- Context fields: `input`, `expectedOutput`, `output`, `messages`, `config`, `trace`, `traceSummary`, `tokenUsage`, `costUsd`, `durationMs`, `startTime`, `endTime`
|
|
73
76
|
|
|
74
77
|
For Python, the repo-local helper example in `examples/features/sdk-python/` keeps canonical `snake_case` fields and rejects deprecated wire aliases like `output_text`, `input_text`, and `reference_answer`. It is not a separate Python runner or a promised published package; generated evals still run through the AgentV CLI.
|
|
75
78
|
|
|
76
79
|
## YAML-Aligned Helper Example
|
|
77
80
|
|
|
78
|
-
Use helper factories for reusable Braintrust/DeepEval-inspired checks, but keep the result as AgentV `
|
|
81
|
+
Use helper factories for reusable Braintrust/DeepEval-inspired checks, but keep the result as AgentV `assert` entries:
|
|
79
82
|
|
|
80
83
|
```typescript
|
|
81
84
|
import { defineEval, graders } from '@agentv/sdk';
|
|
82
85
|
|
|
83
86
|
function ragFaithfulness() {
|
|
84
|
-
return graders.
|
|
87
|
+
return graders.llmRubric(undefined, {
|
|
85
88
|
name: 'rag-faithfulness',
|
|
86
89
|
target: 'grader-target',
|
|
87
90
|
prompt: 'Grade whether the answer is supported by the retrieved context.',
|
|
@@ -94,7 +97,7 @@ export default defineEval({
|
|
|
94
97
|
{
|
|
95
98
|
id: 'grounded-answer',
|
|
96
99
|
input: 'Answer using the retrieved context.',
|
|
97
|
-
|
|
100
|
+
assert: [
|
|
98
101
|
graders.contains('source', { name: 'mentions-source' }),
|
|
99
102
|
ragFaithfulness(),
|
|
100
103
|
],
|
|
@@ -106,12 +109,12 @@ export default defineEval({
|
|
|
106
109
|
The helper lowers to ordinary YAML:
|
|
107
110
|
|
|
108
111
|
```yaml
|
|
109
|
-
|
|
112
|
+
assert:
|
|
110
113
|
- name: mentions-source
|
|
111
114
|
type: contains
|
|
112
115
|
value: source
|
|
113
116
|
- name: rag-faithfulness
|
|
114
|
-
type: llm-
|
|
117
|
+
type: llm-rubric
|
|
115
118
|
target: grader-target
|
|
116
119
|
prompt: Grade whether the answer is supported by the retrieved context.
|
|
117
120
|
```
|
|
@@ -120,7 +123,7 @@ assertions:
|
|
|
120
123
|
|
|
121
124
|
```python
|
|
122
125
|
#!/usr/bin/env python3
|
|
123
|
-
from agentv_py.grader import Assertion,
|
|
126
|
+
from agentv_py.grader import Assertion, ScriptGraderResult, define_script_grader
|
|
124
127
|
|
|
125
128
|
|
|
126
129
|
def evaluate(context):
|
|
@@ -129,26 +132,29 @@ def evaluate(context):
|
|
|
129
132
|
for kw in ["async", "await"]:
|
|
130
133
|
assertions.append(Assertion(text=f"Keyword '{kw}'", passed=kw in candidate))
|
|
131
134
|
passed = sum(1 for item in assertions if item.passed)
|
|
132
|
-
return
|
|
135
|
+
return ScriptGraderResult(
|
|
133
136
|
score=passed / max(len(assertions), 1),
|
|
134
137
|
assertions=assertions,
|
|
135
138
|
)
|
|
136
139
|
|
|
137
140
|
|
|
138
141
|
if __name__ == "__main__":
|
|
139
|
-
|
|
142
|
+
define_script_grader(evaluate)
|
|
140
143
|
```
|
|
141
144
|
|
|
142
145
|
## TypeScript Example
|
|
143
146
|
|
|
144
147
|
```typescript
|
|
145
148
|
#!/usr/bin/env bun
|
|
146
|
-
import {
|
|
149
|
+
import { defineScriptGrader } from '@agentv/sdk';
|
|
147
150
|
|
|
148
|
-
export default
|
|
151
|
+
export default defineScriptGrader(({ output, expectedOutput }) => {
|
|
149
152
|
const candidate = output ?? '';
|
|
153
|
+
const expected = expectedOutput
|
|
154
|
+
?.map((message) => (typeof message.content === 'string' ? message.content : ''))
|
|
155
|
+
.join('\n') ?? '';
|
|
150
156
|
const assertions: Array<{ text: string; passed: boolean }> = [];
|
|
151
|
-
if (candidate.includes(
|
|
157
|
+
if (expected.length > 0 && candidate.includes(expected)) {
|
|
152
158
|
assertions.push({ text: 'Matches expected outcome', passed: true });
|
|
153
159
|
} else {
|
|
154
160
|
assertions.push({ text: 'Does not match expected outcome', passed: false });
|
|
@@ -167,7 +173,6 @@ Derived from test fields (users never author these directly):
|
|
|
167
173
|
|
|
168
174
|
| Variable | Source |
|
|
169
175
|
|----------|--------|
|
|
170
|
-
| `criteria` | Test `criteria` field |
|
|
171
176
|
| `input` | Full resolved input array (JSON) |
|
|
172
177
|
| `expected_output` | Full resolved expected array (JSON) |
|
|
173
178
|
| `output` | Final answer / scored result string |
|