@dalmia/calibrate-mcp 0.0.39 → 0.0.41
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/bin/mcp-server.js +633 -551
- package/bin/mcp-server.js.map +28 -26
- package/esm/funcs/agentTestsListRunsForAgent.js +1 -0
- package/esm/funcs/agentTestsListRunsForAgent.js.map +1 -1
- package/esm/landing-page.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +1 -1
- package/esm/models/agentcreate.d.ts +26 -0
- package/esm/models/agentcreate.d.ts.map +1 -1
- package/esm/models/agentcreate.js +18 -0
- package/esm/models/agentcreate.js.map +1 -1
- package/esm/models/agentresponse.d.ts +26 -0
- package/esm/models/agentresponse.d.ts.map +1 -1
- package/esm/models/agentresponse.js +17 -0
- package/esm/models/agentresponse.js.map +1 -1
- package/esm/models/agentsummary.d.ts +26 -0
- package/esm/models/agentsummary.d.ts.map +1 -1
- package/esm/models/agentsummary.js +17 -0
- package/esm/models/agentsummary.js.map +1 -1
- package/esm/models/agenttestrunlistitem.d.ts +2 -0
- package/esm/models/agenttestrunlistitem.d.ts.map +1 -1
- package/esm/models/agenttestrunlistitem.js +2 -0
- package/esm/models/agenttestrunlistitem.js.map +1 -1
- package/esm/models/bulktestitem.d.ts +2 -1
- package/esm/models/bulktestitem.d.ts.map +1 -1
- package/esm/models/bulktestitem.js +4 -2
- package/esm/models/bulktestitem.js.map +1 -1
- package/esm/models/bulktestupload.d.ts +4 -0
- package/esm/models/bulktestupload.d.ts.map +1 -1
- package/esm/models/bulktestupload.js +5 -2
- package/esm/models/bulktestupload.js.map +1 -1
- package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.d.ts +1 -0
- package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.d.ts.map +1 -1
- package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.js +1 -0
- package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.js.map +1 -1
- package/esm/models/taskagreementresponse.js +1 -1
- package/esm/models/taskagreementresponse.js.map +1 -1
- package/esm/models/testcreate.d.ts +4 -0
- package/esm/models/testcreate.d.ts.map +1 -1
- package/esm/models/testcreate.js +6 -3
- package/esm/models/testcreate.js.map +1 -1
- package/esm/models/testlistresponse.d.ts +4 -0
- package/esm/models/testlistresponse.d.ts.map +1 -1
- package/esm/models/testlistresponse.js +5 -2
- package/esm/models/testlistresponse.js.map +1 -1
- package/esm/models/testresponse.d.ts +4 -0
- package/esm/models/testresponse.d.ts.map +1 -1
- package/esm/models/testresponse.js +5 -2
- package/esm/models/testresponse.js.map +1 -1
- package/esm/models/testupdate.d.ts +2 -0
- package/esm/models/testupdate.d.ts.map +1 -1
- package/esm/models/testupdate.js +4 -2
- package/esm/models/testupdate.js.map +1 -1
- package/esm/models/traceingest.d.ts +6 -1
- package/esm/models/traceingest.d.ts.map +1 -1
- package/esm/models/traceingest.js +8 -1
- package/esm/models/traceingest.js.map +1 -1
- package/esm/models/tracetoolcall.d.ts +1 -0
- package/esm/models/tracetoolcall.d.ts.map +1 -1
- package/esm/models/tracetoolcall.js +1 -0
- package/esm/models/tracetoolcall.js.map +1 -1
- package/package.json +1 -1
- package/src/funcs/agentTestsListRunsForAgent.ts +1 -0
- package/src/landing-page.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/agentcreate.ts +36 -0
- package/src/models/agentresponse.ts +35 -0
- package/src/models/agentsummary.ts +35 -0
- package/src/models/agenttestrunlistitem.ts +6 -0
- package/src/models/bulktestitem.ts +10 -5
- package/src/models/bulktestupload.ts +6 -2
- package/src/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.ts +4 -0
- package/src/models/taskagreementresponse.ts +1 -1
- package/src/models/testcreate.ts +7 -3
- package/src/models/testlistresponse.ts +6 -2
- package/src/models/testresponse.ts +6 -2
- package/src/models/testupdate.ts +4 -2
- package/src/models/traceingest.ts +18 -3
- package/src/models/tracetoolcall.ts +4 -0
|
@@ -15,20 +15,25 @@ import {
|
|
|
15
15
|
|
|
16
16
|
export type BulkTestItem = {
|
|
17
17
|
name: string;
|
|
18
|
-
conversation_history
|
|
18
|
+
conversation_history?: Array<ChatMessage> | null | undefined;
|
|
19
|
+
input?: string | null | undefined;
|
|
19
20
|
evaluators?: Array<RoutersTestsEvaluatorRef> | null | undefined;
|
|
20
21
|
tool_calls?: Array<ExpectedToolCall> | null | undefined;
|
|
21
22
|
inputs?: { [k: string]: any } | null | undefined;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
export const BulkTestItem$zodSchema: z.ZodType<BulkTestItem> = z.object({
|
|
25
|
-
conversation_history: z.array(ChatMessage$zodSchema).
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
conversation_history: z.array(ChatMessage$zodSchema).nullable().optional()
|
|
27
|
+
.describe(
|
|
28
|
+
"Ordered messages ending at the user turn the agent should answer. **Required for `response` and `conversation` batches**, and for `tool_call` batches aimed at a conversational agent",
|
|
29
|
+
),
|
|
28
30
|
evaluators: z.array(RoutersTestsEvaluatorRef$zodSchema).nullable().optional()
|
|
29
31
|
.describe(
|
|
30
|
-
"Evaluators to link. Used by `response` and `
|
|
32
|
+
"Evaluators to link. Used by `response`, `conversation`, and `general` tests",
|
|
31
33
|
),
|
|
34
|
+
input: z.string().nullable().optional().describe(
|
|
35
|
+
"Standalone prompt with no conversation around it. **Required for `general` batches**, and for `tool_call` batches aimed at a general agent",
|
|
36
|
+
),
|
|
32
37
|
inputs: z.record(z.string(), z.any()).nullable().optional().describe(
|
|
33
38
|
"Extra request fields for this test, overriding the agent's `default_inputs` per key",
|
|
34
39
|
),
|
|
@@ -14,6 +14,7 @@ import { BulkTestItem, BulkTestItem$zodSchema } from "./bulktestitem.js";
|
|
|
14
14
|
* - `response`: judges the generated reply
|
|
15
15
|
* - `tool_call`: diffs the generated tool calls
|
|
16
16
|
* - `conversation`: judges the full conversation
|
|
17
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
17
18
|
*
|
|
18
19
|
* Applied to every test in the batch
|
|
19
20
|
*/
|
|
@@ -21,6 +22,7 @@ export const BulkTestUploadType = {
|
|
|
21
22
|
Response: "response",
|
|
22
23
|
ToolCall: "tool_call",
|
|
23
24
|
Conversation: "conversation",
|
|
25
|
+
General: "general",
|
|
24
26
|
} as const;
|
|
25
27
|
/**
|
|
26
28
|
* What the test judges:
|
|
@@ -30,6 +32,7 @@ export const BulkTestUploadType = {
|
|
|
30
32
|
* - `response`: judges the generated reply
|
|
31
33
|
* - `tool_call`: diffs the generated tool calls
|
|
32
34
|
* - `conversation`: judges the full conversation
|
|
35
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
33
36
|
*
|
|
34
37
|
* Applied to every test in the batch
|
|
35
38
|
*/
|
|
@@ -39,8 +42,9 @@ export const BulkTestUploadType$zodSchema = z.enum([
|
|
|
39
42
|
"response",
|
|
40
43
|
"tool_call",
|
|
41
44
|
"conversation",
|
|
45
|
+
"general",
|
|
42
46
|
]).describe(
|
|
43
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n\n\nApplied to every test in the batch",
|
|
47
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n\n\nApplied to every test in the batch",
|
|
44
48
|
);
|
|
45
49
|
|
|
46
50
|
export type BulkTestUpload = {
|
|
@@ -61,6 +65,6 @@ export const BulkTestUpload$zodSchema: z.ZodType<BulkTestUpload> = z.object({
|
|
|
61
65
|
"Test items to create, at most 500 per request, with names unique within the batch",
|
|
62
66
|
),
|
|
63
67
|
type: BulkTestUploadType$zodSchema.describe(
|
|
64
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n\n\nApplied to every test in the batch",
|
|
68
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n\n\nApplied to every test in the batch",
|
|
65
69
|
),
|
|
66
70
|
});
|
|
@@ -49,6 +49,7 @@ export type GetAgentTestRunsAgentTestsAgentAgentUuidRunsGetRequest = {
|
|
|
49
49
|
type?: GetAgentTestRunsAgentTestsAgentAgentUuidRunsGetType | null | undefined;
|
|
50
50
|
status?: TaskStatus | null | undefined;
|
|
51
51
|
has_failures?: boolean | null | undefined;
|
|
52
|
+
around?: string | null | undefined;
|
|
52
53
|
limit?: number | null | undefined;
|
|
53
54
|
offset?: number | undefined;
|
|
54
55
|
xAPIKey?: string | null | undefined;
|
|
@@ -57,6 +58,9 @@ export type GetAgentTestRunsAgentTestsAgentAgentUuidRunsGetRequest = {
|
|
|
57
58
|
export const GetAgentTestRunsAgentTestsAgentAgentUuidRunsGetRequest$zodSchema:
|
|
58
59
|
z.ZodType<GetAgentTestRunsAgentTestsAgentAgentUuidRunsGetRequest> = z.object({
|
|
59
60
|
agent_uuid: z.string().describe("Agent whose test runs to list"),
|
|
61
|
+
around: z.string().describe(
|
|
62
|
+
"ID of a run to jump to, returning the page that contains it instead of the page at `offset`",
|
|
63
|
+
).nullable().optional(),
|
|
60
64
|
has_failures: z.boolean().describe(
|
|
61
65
|
"Filter by whether the run has any failing test case or model. `true` returns only runs with failures (or errors), `false` only clean runs. Omit for both",
|
|
62
66
|
).nullable().optional(),
|
|
@@ -25,7 +25,7 @@ export const TaskAgreementResponse$zodSchema: z.ZodType<TaskAgreementResponse> =
|
|
|
25
25
|
bucket: z.string().describe("Time bucket used for the trend series"),
|
|
26
26
|
days: z.int().describe("Length of the trailing window in days"),
|
|
27
27
|
evaluators: z.array(z.record(z.string(), z.any())).describe(
|
|
28
|
-
"Agreement between each evaluator and the annotators, plus that evaluator's own results, one entry per linked evaluator",
|
|
28
|
+
"Agreement between each evaluator and the annotators, plus that evaluator's own results and the human results, one entry per linked evaluator",
|
|
29
29
|
),
|
|
30
30
|
human_human: HumanAgreementBlock$zodSchema,
|
|
31
31
|
task_id: z.string().describe("ID of the task"),
|
package/src/models/testcreate.ts
CHANGED
|
@@ -17,11 +17,13 @@ import {
|
|
|
17
17
|
* - `response`: judges the generated reply
|
|
18
18
|
* - `tool_call`: diffs the generated tool calls
|
|
19
19
|
* - `conversation`: judges the full conversation
|
|
20
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
20
21
|
*/
|
|
21
22
|
export const TestCreateType = {
|
|
22
23
|
Response: "response",
|
|
23
24
|
ToolCall: "tool_call",
|
|
24
25
|
Conversation: "conversation",
|
|
26
|
+
General: "general",
|
|
25
27
|
} as const;
|
|
26
28
|
/**
|
|
27
29
|
* What the test judges:
|
|
@@ -31,6 +33,7 @@ export const TestCreateType = {
|
|
|
31
33
|
* - `response`: judges the generated reply
|
|
32
34
|
* - `tool_call`: diffs the generated tool calls
|
|
33
35
|
* - `conversation`: judges the full conversation
|
|
36
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
34
37
|
*/
|
|
35
38
|
export type TestCreateType = ClosedEnum<typeof TestCreateType>;
|
|
36
39
|
|
|
@@ -38,8 +41,9 @@ export const TestCreateType$zodSchema = z.enum([
|
|
|
38
41
|
"response",
|
|
39
42
|
"tool_call",
|
|
40
43
|
"conversation",
|
|
44
|
+
"general",
|
|
41
45
|
]).describe(
|
|
42
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
|
|
46
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
|
|
43
47
|
);
|
|
44
48
|
|
|
45
49
|
export type TestCreate = {
|
|
@@ -51,7 +55,7 @@ export type TestCreate = {
|
|
|
51
55
|
|
|
52
56
|
export const TestCreate$zodSchema: z.ZodType<TestCreate> = z.object({
|
|
53
57
|
config: z.record(z.string(), z.any()).nullable().optional().describe(
|
|
54
|
-
"The calibrate test config
|
|
58
|
+
"The calibrate test config.\n\n- `history`: the conversation up to the agent's turn, required for `response` and `conversation` tests and for a `tool_call` test aimed at a conversational agent. Each item is `{role, content}` with `role` one of `user`, `assistant`, `tool`. A `tool` message also carries `tool_call_id` and `name`.\n- `input`: a standalone prompt with no conversation around it, required for `general` tests and for a `tool_call` test aimed at a `general` agent. A string, not a conversation.\n- `evaluation`: the required `{type, ...}`, where `type` matches the test's `type` below.\n- `settings`: an optional object, e.g. `{\"language\": \"en\"}`.\n\nA `tool_call` test carries exactly one of `history` or `input`, and which one it carries decides the agent it can be linked to.\n\n`evaluation` by test type:\n- `response`: judge the agent's reply, graded by the linked evaluators. `{\"type\": \"response\"}`\n- `conversation`: append the reply and judge the whole conversation. `{\"type\": \"conversation\"}`\n- `tool_call`: diff the agent's tool calls against expected ones. Add `tool_calls`, a list of `{tool, arguments, accept_any_arguments?}`.\n- `general`: judge a standalone, non-conversational input/output pair, graded by the linked evaluators. `{\"type\": \"general\"}`\n\nFor `tool_call`, each expected argument value is one of:\n- `{\"match_type\": \"exact\", \"value\": <any>}`: must equal `value`\n- `{\"match_type\": \"llm_judge\", \"criteria\": \"...\"}`: judged against the criteria\n- `{\"match_type\": \"any\"}`: any value, only checks the argument was passed\n\n`response` / `conversation` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"What is your return policy?\"}],\n \"evaluation\": {\"type\": \"response\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\n`tool_call` example, for a conversational agent. Swap `history` for `input` to aim it at a `general` agent:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"Book room 101 for tomorrow\"}],\n \"evaluation\": {\n \"type\": \"tool_call\",\n \"tool_calls\": [\n {\n \"tool\": \"book_room\",\n \"arguments\": {\n \"room\": {\"match_type\": \"exact\", \"value\": \"101\"},\n \"date\": {\"match_type\": \"llm_judge\", \"criteria\": \"tomorrow's date\"}\n },\n \"accept_any_arguments\": false\n }\n ]\n }\n}\n```\n\n`general` example:\n```json\n{\n \"input\": \"Summarize this article: ...\",\n \"evaluation\": {\"type\": \"general\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\nEvaluators are linked via the separate `evaluators` field, not inside `config`.\n\nOmit to create the test with no config and fill it in later via update",
|
|
55
59
|
),
|
|
56
60
|
evaluators: z.array(RoutersTestsEvaluatorRef$zodSchema).nullable().optional()
|
|
57
61
|
.describe(
|
|
@@ -59,6 +63,6 @@ export const TestCreate$zodSchema: z.ZodType<TestCreate> = z.object({
|
|
|
59
63
|
),
|
|
60
64
|
name: z.string().describe("Name of the test, unique within the workspace"),
|
|
61
65
|
type: TestCreateType$zodSchema.describe(
|
|
62
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
|
|
66
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
|
|
63
67
|
),
|
|
64
68
|
});
|
|
@@ -14,11 +14,13 @@ import { TestListConfig, TestListConfig$zodSchema } from "./testlistconfig.js";
|
|
|
14
14
|
* - `response`: judges the generated reply
|
|
15
15
|
* - `tool_call`: diffs the generated tool calls
|
|
16
16
|
* - `conversation`: judges the full conversation
|
|
17
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
17
18
|
*/
|
|
18
19
|
export const TestListResponseType = {
|
|
19
20
|
Response: "response",
|
|
20
21
|
ToolCall: "tool_call",
|
|
21
22
|
Conversation: "conversation",
|
|
23
|
+
General: "general",
|
|
22
24
|
} as const;
|
|
23
25
|
/**
|
|
24
26
|
* What the test judges:
|
|
@@ -28,6 +30,7 @@ export const TestListResponseType = {
|
|
|
28
30
|
* - `response`: judges the generated reply
|
|
29
31
|
* - `tool_call`: diffs the generated tool calls
|
|
30
32
|
* - `conversation`: judges the full conversation
|
|
33
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
31
34
|
*/
|
|
32
35
|
export type TestListResponseType = ClosedEnum<typeof TestListResponseType>;
|
|
33
36
|
|
|
@@ -35,8 +38,9 @@ export const TestListResponseType$zodSchema = z.enum([
|
|
|
35
38
|
"response",
|
|
36
39
|
"tool_call",
|
|
37
40
|
"conversation",
|
|
41
|
+
"general",
|
|
38
42
|
]).describe(
|
|
39
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
|
|
43
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
|
|
40
44
|
);
|
|
41
45
|
|
|
42
46
|
/**
|
|
@@ -63,7 +67,7 @@ export const TestListResponse$zodSchema: z.ZodType<TestListResponse> = z.object(
|
|
|
63
67
|
created_at: z.string().describe("When the test was created (ISO 8601 UTC)"),
|
|
64
68
|
name: z.string().describe("Name of the test"),
|
|
65
69
|
type: TestListResponseType$zodSchema.describe(
|
|
66
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
|
|
70
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
|
|
67
71
|
),
|
|
68
72
|
updated_at: z.string().describe(
|
|
69
73
|
"When the test was last updated (ISO 8601 UTC)",
|
|
@@ -13,11 +13,13 @@ import { ClosedEnum } from "../types/enums.js";
|
|
|
13
13
|
* - `response`: judges the generated reply
|
|
14
14
|
* - `tool_call`: diffs the generated tool calls
|
|
15
15
|
* - `conversation`: judges the full conversation
|
|
16
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
16
17
|
*/
|
|
17
18
|
export const TestResponseType = {
|
|
18
19
|
Response: "response",
|
|
19
20
|
ToolCall: "tool_call",
|
|
20
21
|
Conversation: "conversation",
|
|
22
|
+
General: "general",
|
|
21
23
|
} as const;
|
|
22
24
|
/**
|
|
23
25
|
* What the test judges:
|
|
@@ -27,6 +29,7 @@ export const TestResponseType = {
|
|
|
27
29
|
* - `response`: judges the generated reply
|
|
28
30
|
* - `tool_call`: diffs the generated tool calls
|
|
29
31
|
* - `conversation`: judges the full conversation
|
|
32
|
+
* - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
|
|
30
33
|
*/
|
|
31
34
|
export type TestResponseType = ClosedEnum<typeof TestResponseType>;
|
|
32
35
|
|
|
@@ -34,8 +37,9 @@ export const TestResponseType$zodSchema = z.enum([
|
|
|
34
37
|
"response",
|
|
35
38
|
"tool_call",
|
|
36
39
|
"conversation",
|
|
40
|
+
"general",
|
|
37
41
|
]).describe(
|
|
38
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
|
|
42
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
|
|
39
43
|
);
|
|
40
44
|
|
|
41
45
|
export type TestResponse = {
|
|
@@ -58,7 +62,7 @@ export const TestResponse$zodSchema: z.ZodType<TestResponse> = z.object({
|
|
|
58
62
|
),
|
|
59
63
|
name: z.string().describe("Name of the test"),
|
|
60
64
|
type: TestResponseType$zodSchema.describe(
|
|
61
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
|
|
65
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
|
|
62
66
|
),
|
|
63
67
|
updated_at: z.string().describe(
|
|
64
68
|
"When the test was last updated (ISO 8601 UTC)",
|
package/src/models/testupdate.ts
CHANGED
|
@@ -13,6 +13,7 @@ export const TestUpdateType = {
|
|
|
13
13
|
Response: "response",
|
|
14
14
|
ToolCall: "tool_call",
|
|
15
15
|
Conversation: "conversation",
|
|
16
|
+
General: "general",
|
|
16
17
|
} as const;
|
|
17
18
|
export type TestUpdateType = ClosedEnum<typeof TestUpdateType>;
|
|
18
19
|
|
|
@@ -20,6 +21,7 @@ export const TestUpdateType$zodSchema = z.enum([
|
|
|
20
21
|
"response",
|
|
21
22
|
"tool_call",
|
|
22
23
|
"conversation",
|
|
24
|
+
"general",
|
|
23
25
|
]);
|
|
24
26
|
|
|
25
27
|
export type TestUpdate = {
|
|
@@ -31,7 +33,7 @@ export type TestUpdate = {
|
|
|
31
33
|
|
|
32
34
|
export const TestUpdate$zodSchema: z.ZodType<TestUpdate> = z.object({
|
|
33
35
|
config: z.record(z.string(), z.any()).nullable().optional().describe(
|
|
34
|
-
"The calibrate test config
|
|
36
|
+
"The calibrate test config.\n\n- `history`: the conversation up to the agent's turn, required for `response` and `conversation` tests and for a `tool_call` test aimed at a conversational agent. Each item is `{role, content}` with `role` one of `user`, `assistant`, `tool`. A `tool` message also carries `tool_call_id` and `name`.\n- `input`: a standalone prompt with no conversation around it, required for `general` tests and for a `tool_call` test aimed at a `general` agent. A string, not a conversation.\n- `evaluation`: the required `{type, ...}`, where `type` matches the test's `type` below.\n- `settings`: an optional object, e.g. `{\"language\": \"en\"}`.\n\nA `tool_call` test carries exactly one of `history` or `input`, and which one it carries decides the agent it can be linked to.\n\n`evaluation` by test type:\n- `response`: judge the agent's reply, graded by the linked evaluators. `{\"type\": \"response\"}`\n- `conversation`: append the reply and judge the whole conversation. `{\"type\": \"conversation\"}`\n- `tool_call`: diff the agent's tool calls against expected ones. Add `tool_calls`, a list of `{tool, arguments, accept_any_arguments?}`.\n- `general`: judge a standalone, non-conversational input/output pair, graded by the linked evaluators. `{\"type\": \"general\"}`\n\nFor `tool_call`, each expected argument value is one of:\n- `{\"match_type\": \"exact\", \"value\": <any>}`: must equal `value`\n- `{\"match_type\": \"llm_judge\", \"criteria\": \"...\"}`: judged against the criteria\n- `{\"match_type\": \"any\"}`: any value, only checks the argument was passed\n\n`response` / `conversation` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"What is your return policy?\"}],\n \"evaluation\": {\"type\": \"response\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\n`tool_call` example, for a conversational agent. Swap `history` for `input` to aim it at a `general` agent:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"Book room 101 for tomorrow\"}],\n \"evaluation\": {\n \"type\": \"tool_call\",\n \"tool_calls\": [\n {\n \"tool\": \"book_room\",\n \"arguments\": {\n \"room\": {\"match_type\": \"exact\", \"value\": \"101\"},\n \"date\": {\"match_type\": \"llm_judge\", \"criteria\": \"tomorrow's date\"}\n },\n \"accept_any_arguments\": false\n }\n ]\n }\n}\n```\n\n`general` example:\n```json\n{\n \"input\": \"Summarize this article: ...\",\n \"evaluation\": {\"type\": \"general\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\nEvaluators are linked via the separate `evaluators` field, not inside `config`.\n\nReplaces the stored config. Omit to leave unchanged",
|
|
35
37
|
),
|
|
36
38
|
evaluators: z.array(RoutersTestsEvaluatorRef$zodSchema).nullable().optional()
|
|
37
39
|
.describe(
|
|
@@ -41,6 +43,6 @@ export const TestUpdate$zodSchema: z.ZodType<TestUpdate> = z.object({
|
|
|
41
43
|
"New test name. Omit to leave unchanged",
|
|
42
44
|
),
|
|
43
45
|
type: TestUpdateType$zodSchema.nullable().optional().describe(
|
|
44
|
-
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n\n\nImmutable. Omit it, or send the current value",
|
|
46
|
+
"What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n\n\nImmutable. Omit it, or send the current value",
|
|
45
47
|
),
|
|
46
48
|
});
|
|
@@ -10,11 +10,23 @@ import {
|
|
|
10
10
|
import { TraceOutput, TraceOutput$zodSchema } from "./traceoutput.js";
|
|
11
11
|
import { TraceTurn, TraceTurn$zodSchema } from "./traceturn.js";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* What the agent was given for this turn. For a `general` agent, the standalone prompt as a string. For a `conversation` agent, the history up to the reported output, oldest turn first, in OpenAI chat format
|
|
15
|
+
*/
|
|
16
|
+
export type Input = string | Array<TraceTurn>;
|
|
17
|
+
|
|
18
|
+
export const Input$zodSchema: z.ZodType<Input> = z.union([
|
|
19
|
+
z.string(),
|
|
20
|
+
z.array(TraceTurn$zodSchema),
|
|
21
|
+
]).describe(
|
|
22
|
+
"What the agent was given for this turn. For a `general` agent, the standalone prompt as a string. For a `conversation` agent, the history up to the reported output, oldest turn first, in OpenAI chat format",
|
|
23
|
+
);
|
|
24
|
+
|
|
13
25
|
export type TraceIngest = {
|
|
14
26
|
agent_id: string;
|
|
15
27
|
message_id?: string | null | undefined;
|
|
16
28
|
conversation_id?: string | null | undefined;
|
|
17
|
-
input: Array<TraceTurn>;
|
|
29
|
+
input: string | Array<TraceTurn>;
|
|
18
30
|
output: TraceOutput;
|
|
19
31
|
metadata?: Array<TraceMetadataEntry> | null | undefined;
|
|
20
32
|
};
|
|
@@ -26,8 +38,11 @@ export const TraceIngest$zodSchema: z.ZodType<TraceIngest> = z.object({
|
|
|
26
38
|
conversation_id: z.string().nullable().optional().describe(
|
|
27
39
|
"Your own ID for the conversation this turn belongs to, stored for reference only. Omit if you have none",
|
|
28
40
|
),
|
|
29
|
-
input: z.
|
|
30
|
-
|
|
41
|
+
input: z.union([
|
|
42
|
+
z.string(),
|
|
43
|
+
z.array(TraceTurn$zodSchema),
|
|
44
|
+
]).describe(
|
|
45
|
+
"What the agent was given for this turn. For a `general` agent, the standalone prompt as a string. For a `conversation` agent, the history up to the reported output, oldest turn first, in OpenAI chat format",
|
|
31
46
|
),
|
|
32
47
|
message_id: z.string().nullable().optional().describe(
|
|
33
48
|
"Your own ID for the last user message in `input`, stored for reference only. Omit if you have none",
|
|
@@ -7,11 +7,15 @@ import * as z from "zod";
|
|
|
7
7
|
export type TraceToolCall = {
|
|
8
8
|
tool: string;
|
|
9
9
|
arguments?: { [k: string]: any } | null | undefined;
|
|
10
|
+
output?: any | undefined;
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
export const TraceToolCall$zodSchema: z.ZodType<TraceToolCall> = z.object({
|
|
13
14
|
arguments: z.record(z.string(), z.any()).nullable().optional().describe(
|
|
14
15
|
"Argument values the agent passed to the tool. Omit when the call had none",
|
|
15
16
|
),
|
|
17
|
+
output: z.any().optional().describe(
|
|
18
|
+
"What the tool returned for this call. Any JSON value. Omit when you do not record it",
|
|
19
|
+
),
|
|
16
20
|
tool: z.string().describe("Name of the tool the agent called"),
|
|
17
21
|
});
|