@databricks/appkit-ui 0.72.0 → 0.74.0
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/CLAUDE.md +24 -0
- package/NOTICE.md +1 -0
- package/dist/cli/commands/agent/eval.js +85 -16
- package/dist/cli/commands/agent/eval.js.map +1 -1
- package/dist/react/ui/button.d.ts +1 -1
- package/docs/api/appkit/Class.AppKitError.md +1 -0
- package/docs/api/appkit/Class.DatabaseValidationError.md +191 -0
- package/docs/api/appkit/Function.defineEvalConfig.md +18 -0
- package/docs/api/appkit/Function.defineSchema.md +1 -1
- package/docs/api/appkit/Function.discoverEvalConfigs.md +18 -0
- package/docs/api/appkit/Function.formatResultsJUnit.md +18 -0
- package/docs/api/appkit/Function.formatResultsJson.md +18 -0
- package/docs/api/appkit/Function.readEvalDataset.md +21 -0
- package/docs/api/appkit/Function.resolveWorkspaceClient.md +18 -0
- package/docs/api/appkit/Function.runWithRetries.md +28 -0
- package/docs/api/appkit/Function.userTurns.md +20 -0
- package/docs/api/appkit/Interface.AssertionHandle.md +1 -1
- package/docs/api/appkit/Interface.DatabaseValidationIssue.md +21 -0
- package/docs/api/appkit/Interface.DatasetRow.md +21 -0
- package/docs/api/appkit/Interface.DiscoveredEvalConfig.md +25 -0
- package/docs/api/appkit/Interface.DriveResult.md +28 -0
- package/docs/api/appkit/Interface.EntityMutationHooks.md +173 -0
- package/docs/api/appkit/Interface.EvalDefinition.md +50 -0
- package/docs/api/appkit/Interface.EvalDriver.md +26 -5
- package/docs/api/appkit/Interface.EvalResult.md +11 -0
- package/docs/api/appkit/Interface.EvalSummary.md +11 -0
- package/docs/api/appkit/Interface.HookApp.md +12 -0
- package/docs/api/appkit/Interface.HookContext.md +21 -0
- package/docs/api/appkit/Interface.ReadEvalDatasetOptions.md +34 -0
- package/docs/api/appkit/Interface.ReadSerializerContext.md +21 -0
- package/docs/api/appkit/Interface.RunEvalOptions.md +22 -0
- package/docs/api/appkit/Interface.RunEvalsOptions.md +45 -1
- package/docs/api/appkit/Interface.TestContext.md +67 -8
- package/docs/api/appkit/TypeAlias.DatabaseApiConfig.md +53 -0
- package/docs/api/appkit/TypeAlias.DatabaseApiWriteOperation.md +8 -0
- package/docs/api/appkit/TypeAlias.DatabaseApiWritesConfig.md +49 -0
- package/docs/api/appkit/TypeAlias.DatabaseExports.md +3 -3
- package/docs/api/appkit/TypeAlias.EntityHooks.md +25 -0
- package/docs/api/appkit/TypeAlias.IDatabaseConfig.md +16 -5
- package/docs/api/appkit/TypeAlias.ReadSerializer.md +19 -0
- package/docs/api/appkit/TypeAlias.TransactionClient.md +19 -0
- package/docs/api/appkit.md +142 -119
- package/docs/plugins/database.md +144 -0
- package/llms.txt +24 -0
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Function: discoverEvalConfigs()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function discoverEvalConfigs(rootDir: string): DiscoveredEvalConfig[];
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Discover the per-agent `evals.config.ts` (from [defineEvalConfig](./docs/api/appkit/Function.defineEvalConfig.md)) at `<rootDir>/server/agents/<agent>/evals/evals.config.ts`. Config is per-agent: each agent's config applies only to that agent's evals. Agents without a config file are omitted. Returns a stable, sorted list.
|
|
9
|
+
|
|
10
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| --------- | -------- |
|
|
14
|
+
| `rootDir` | `string` |
|
|
15
|
+
|
|
16
|
+
## Returns[](#returns "Direct link to Returns")
|
|
17
|
+
|
|
18
|
+
[`DiscoveredEvalConfig`](./docs/api/appkit/Interface.DiscoveredEvalConfig.md)\[]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Function: formatResultsJUnit()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function formatResultsJUnit(results: EvalResult[]): string;
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Render results as JUnit XML for standard CI test reporters: a single `<testsuite name="appkit-agent-evals">` with one `<testcase>` per result. Failures carry a `<failure>` (error or failing-gate summary); skips a `<skipped>`. All attribute/text values are XML-escaped.
|
|
9
|
+
|
|
10
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| --------- | ------------------------------------------------------------------ |
|
|
14
|
+
| `results` | [`EvalResult`](./docs/api/appkit/Interface.EvalResult.md)\[] |
|
|
15
|
+
|
|
16
|
+
## Returns[](#returns "Direct link to Returns")
|
|
17
|
+
|
|
18
|
+
`string`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Function: formatResultsJson()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function formatResultsJson(results: EvalResult[]): string;
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Render results as a machine-readable JSON report (2-space indented): `{ summary: EvalSummary, results: EvalResult[] }`. Faithful to the types — every field present on a result round-trips.
|
|
9
|
+
|
|
10
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| --------- | ------------------------------------------------------------------ |
|
|
14
|
+
| `results` | [`EvalResult`](./docs/api/appkit/Interface.EvalResult.md)\[] |
|
|
15
|
+
|
|
16
|
+
## Returns[](#returns "Direct link to Returns")
|
|
17
|
+
|
|
18
|
+
`string`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Function: readEvalDataset()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function readEvalDataset(client: WorkspaceClient, options: ReadEvalDatasetOptions): Promise<DatasetRow[]>;
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Read a Databricks managed evaluation dataset (a Unity Catalog table with `inputs`/`expectations` columns) into rows, over the public SQL Statement Execution API. Reuses SQLWarehouseConnector for submit/poll/transform — its result transform already JSON-parses string columns into objects, so `inputs`/`expectations` come back as records whether the table stores them as JSON strings or structs.
|
|
9
|
+
|
|
10
|
+
The Python `mlflow.genai.datasets` API needs a Spark session (no TS equivalent), so we read the backing table directly.
|
|
11
|
+
|
|
12
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
13
|
+
|
|
14
|
+
| Parameter | Type |
|
|
15
|
+
| --------- | --------------------------------------------------------------------------------------- |
|
|
16
|
+
| `client` | [`WorkspaceClient`](./docs/api/appkit/Interface.WorkspaceClient.md) |
|
|
17
|
+
| `options` | [`ReadEvalDatasetOptions`](./docs/api/appkit/Interface.ReadEvalDatasetOptions.md) |
|
|
18
|
+
|
|
19
|
+
## Returns[](#returns "Direct link to Returns")
|
|
20
|
+
|
|
21
|
+
`Promise`<[`DatasetRow`](./docs/api/appkit/Interface.DatasetRow.md)\[]>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Function: resolveWorkspaceClient()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function resolveWorkspaceClient(options: ResolveDatabricksAuthOptions): WorkspaceClient | undefined;
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Construct a Databricks `WorkspaceClient` for the eval runner — the object the SDK-backed connectors (e.g. `SQLWarehouseConnector`) take. An explicit host+token builds a PAT client; otherwise the profile (or ambient config) is used and the SDK resolves credentials, minting OAuth as needed. Returns `undefined` if construction throws (missing/invalid config).
|
|
9
|
+
|
|
10
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
11
|
+
|
|
12
|
+
| Parameter | Type |
|
|
13
|
+
| --------- | --------------------------------------------------------------------------------------------------- |
|
|
14
|
+
| `options` | [`ResolveDatabricksAuthOptions`](./docs/api/appkit/Interface.ResolveDatabricksAuthOptions.md) |
|
|
15
|
+
|
|
16
|
+
## Returns[](#returns "Direct link to Returns")
|
|
17
|
+
|
|
18
|
+
[`WorkspaceClient`](./docs/api/appkit/Interface.WorkspaceClient.md) | `undefined`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Function: runWithRetries()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function runWithRetries(
|
|
5
|
+
retries: number,
|
|
6
|
+
attempt: (attemptNumber: number) => Promise<EvalResult>,
|
|
7
|
+
options: {
|
|
8
|
+
baseDelayMs?: number;
|
|
9
|
+
}): Promise<EvalResult>;
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Run `attempt` up to `1 + retries` times, stopping as soon as it returns a result that is neither a thrown error / per-eval timeout (`error`) nor a transport/agent turn failure (`infraFailure`). Assertion failures set neither, so a failed-but-completed eval is returned on the first try and never retried. Returns the last result when every attempt failed on infra.
|
|
14
|
+
|
|
15
|
+
Between attempts it waits a full-jittered exponential backoff (infra flakes are overload-correlated). `retries` is coerced to a finite non-negative integer; `baseDelayMs: 0` disables the wait (tests).
|
|
16
|
+
|
|
17
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
18
|
+
|
|
19
|
+
| Parameter | Type |
|
|
20
|
+
| ---------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `retries` | `number` |
|
|
22
|
+
| `attempt` | (`attemptNumber`: `number`) => `Promise`<[`EvalResult`](./docs/api/appkit/Interface.EvalResult.md)> |
|
|
23
|
+
| `options` | { `baseDelayMs?`: `number`; } |
|
|
24
|
+
| `options.baseDelayMs?` | `number` |
|
|
25
|
+
|
|
26
|
+
## Returns[](#returns "Direct link to Returns")
|
|
27
|
+
|
|
28
|
+
`Promise`<[`EvalResult`](./docs/api/appkit/Interface.EvalResult.md)>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Function: userTurns()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function userTurns(input: Record<string, unknown>): string[];
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
Extract every user-message content, in order, from an MLflow `{"messages":[{"role":"user","content":"..."}]}` input. A dataset row can carry a full multi-turn conversation; replaying these against one thread (one `t.send` per returned string) lets the agent see the accumulating history.
|
|
9
|
+
|
|
10
|
+
Only `role === "user"` turns are returned — any interleaved `assistant`/ `system` messages in the row are ignored, since the agent generates its own responses; you never inject the dataset's assistant turns. A single-user-turn row yields a one-element array (backward compatible); a row with no `messages` yields `[]`.
|
|
11
|
+
|
|
12
|
+
## Parameters[](#parameters "Direct link to Parameters")
|
|
13
|
+
|
|
14
|
+
| Parameter | Type |
|
|
15
|
+
| --------- | ----------------------------- |
|
|
16
|
+
| `input` | `Record`<`string`, `unknown`> |
|
|
17
|
+
|
|
18
|
+
## Returns[](#returns "Direct link to Returns")
|
|
19
|
+
|
|
20
|
+
`string`\[]
|
|
@@ -11,7 +11,7 @@ atLeast(threshold: number): AssertionHandle;
|
|
|
11
11
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Set the pass threshold for a scored assertion: it passes only when the score is at least `threshold`. Keeps the current severity (gate unless also chained with `.soft()`).
|
|
15
15
|
|
|
16
16
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
17
17
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Interface: DatabaseValidationIssue
|
|
2
|
+
|
|
3
|
+
One rejected field; `path` names public columns, never their values.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### message[](#message "Direct link to message")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
readonly message: string;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### path[](#path "Direct link to path")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
readonly path: readonly string[];
|
|
20
|
+
|
|
21
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Interface: DatasetRow
|
|
2
|
+
|
|
3
|
+
One row of a managed evaluation dataset. `inputs` are the kwargs passed to the agent for the turn; `expectations` (when present) is the row's ground truth / guidelines. Mirrors the `{inputs, expectations}` shape of `mlflow.genai` datasets and of the Unity Catalog table backing a managed eval dataset.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### expectations?[](#expectations "Direct link to expectations?")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
optional expectations: Record<string, unknown>;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### inputs[](#inputs "Direct link to inputs")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
inputs: Record<string, unknown>;
|
|
20
|
+
|
|
21
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: DiscoveredEvalConfig
|
|
2
|
+
|
|
3
|
+
A per-agent `evals.config.ts` found under `server/agents/<agent>/evals/`.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### agent[](#agent "Direct link to agent")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
agent: string;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The agent id whose evals this config applies to.
|
|
15
|
+
|
|
16
|
+
***
|
|
17
|
+
|
|
18
|
+
### file[](#file "Direct link to file")
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
file: string;
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Absolute path to the `evals.config.ts` file.
|
|
@@ -37,6 +37,34 @@ Whether the turn completed without an agent/stream error.
|
|
|
37
37
|
|
|
38
38
|
***
|
|
39
39
|
|
|
40
|
+
### toolCallDetails[](#toolcalldetails "Direct link to toolCallDetails")
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
toolCallDetails: {
|
|
44
|
+
args: Record<string, unknown>;
|
|
45
|
+
name: string;
|
|
46
|
+
}[];
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Tool calls with their parsed arguments, in call order.
|
|
51
|
+
|
|
52
|
+
#### args[](#args "Direct link to args")
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
args: Record<string, unknown>;
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### name[](#name "Direct link to name")
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
name: string;
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
40
68
|
### toolCalls[](#toolcalls "Direct link to toolCalls")
|
|
41
69
|
|
|
42
70
|
```ts
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Interface: EntityMutationHooks\<TTable>
|
|
2
|
+
|
|
3
|
+
Mutation lifecycle for one entity. A before hook may return a replacement payload, which is revalidated against the trusted schema before it is persisted. Every hook, the mutation, and any write a hook issues through `ctx.app.database` share one transaction, so a rejection anywhere rolls all of them back. Throw `DatabaseValidationError` to answer a generated route with `422`; any other failure stays an opaque server error.
|
|
4
|
+
|
|
5
|
+
## Type Parameters[](#type-parameters "Direct link to Type Parameters")
|
|
6
|
+
|
|
7
|
+
| Type Parameter | Default type |
|
|
8
|
+
| --------------------------- | ------------ |
|
|
9
|
+
| `TTable` *extends* `string` | `string` |
|
|
10
|
+
|
|
11
|
+
## Methods[](#methods "Direct link to Methods")
|
|
12
|
+
|
|
13
|
+
### afterCreate()?[](#aftercreate "Direct link to afterCreate()?")
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
optional afterCreate(row: FacetOf<TTable, "row">, context: HookContext): MaybePromise<void>;
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
#### Parameters[](#parameters "Direct link to Parameters")
|
|
21
|
+
|
|
22
|
+
| Parameter | Type |
|
|
23
|
+
| --------- | ----------------------------------------------------------------- |
|
|
24
|
+
| `row` | `FacetOf`<`TTable`, `"row"`> |
|
|
25
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
26
|
+
|
|
27
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
28
|
+
|
|
29
|
+
`MaybePromise`<`void`>
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### afterDelete()?[](#afterdelete "Direct link to afterDelete()?")
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
optional afterDelete(id: IdValue, context: HookContext): MaybePromise<void>;
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Parameters[](#parameters-1 "Direct link to Parameters")
|
|
41
|
+
|
|
42
|
+
| Parameter | Type |
|
|
43
|
+
| --------- | ----------------------------------------------------------------- |
|
|
44
|
+
| `id` | `IdValue` |
|
|
45
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
46
|
+
|
|
47
|
+
#### Returns[](#returns-1 "Direct link to Returns")
|
|
48
|
+
|
|
49
|
+
`MaybePromise`<`void`>
|
|
50
|
+
|
|
51
|
+
***
|
|
52
|
+
|
|
53
|
+
### afterUpdate()?[](#afterupdate "Direct link to afterUpdate()?")
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
optional afterUpdate(row: FacetOf<TTable, "row">, context: HookContext): MaybePromise<void>;
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Parameters[](#parameters-2 "Direct link to Parameters")
|
|
61
|
+
|
|
62
|
+
| Parameter | Type |
|
|
63
|
+
| --------- | ----------------------------------------------------------------- |
|
|
64
|
+
| `row` | `FacetOf`<`TTable`, `"row"`> |
|
|
65
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
66
|
+
|
|
67
|
+
#### Returns[](#returns-2 "Direct link to Returns")
|
|
68
|
+
|
|
69
|
+
`MaybePromise`<`void`>
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### afterUpsert()?[](#afterupsert "Direct link to afterUpsert()?")
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
optional afterUpsert(row: FacetOf<TTable, "row">, context: HookContext): MaybePromise<void>;
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Parameters[](#parameters-3 "Direct link to Parameters")
|
|
81
|
+
|
|
82
|
+
| Parameter | Type |
|
|
83
|
+
| --------- | ----------------------------------------------------------------- |
|
|
84
|
+
| `row` | `FacetOf`<`TTable`, `"row"`> |
|
|
85
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
86
|
+
|
|
87
|
+
#### Returns[](#returns-3 "Direct link to Returns")
|
|
88
|
+
|
|
89
|
+
`MaybePromise`<`void`>
|
|
90
|
+
|
|
91
|
+
***
|
|
92
|
+
|
|
93
|
+
### beforeCreate()?[](#beforecreate "Direct link to beforeCreate()?")
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
optional beforeCreate(values: FacetOf<TTable, "insert">, context: HookContext): MaybePromise<void | FacetOf<TTable, "insert">>;
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Parameters[](#parameters-4 "Direct link to Parameters")
|
|
101
|
+
|
|
102
|
+
| Parameter | Type |
|
|
103
|
+
| --------- | ----------------------------------------------------------------- |
|
|
104
|
+
| `values` | `FacetOf`<`TTable`, `"insert"`> |
|
|
105
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
106
|
+
|
|
107
|
+
#### Returns[](#returns-4 "Direct link to Returns")
|
|
108
|
+
|
|
109
|
+
`MaybePromise`<`void` | `FacetOf`<`TTable`, `"insert"`>>
|
|
110
|
+
|
|
111
|
+
***
|
|
112
|
+
|
|
113
|
+
### beforeDelete()?[](#beforedelete "Direct link to beforeDelete()?")
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
optional beforeDelete(id: IdValue, context: HookContext): MaybePromise<void>;
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Parameters[](#parameters-5 "Direct link to Parameters")
|
|
121
|
+
|
|
122
|
+
| Parameter | Type |
|
|
123
|
+
| --------- | ----------------------------------------------------------------- |
|
|
124
|
+
| `id` | `IdValue` |
|
|
125
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
126
|
+
|
|
127
|
+
#### Returns[](#returns-5 "Direct link to Returns")
|
|
128
|
+
|
|
129
|
+
`MaybePromise`<`void`>
|
|
130
|
+
|
|
131
|
+
***
|
|
132
|
+
|
|
133
|
+
### beforeUpdate()?[](#beforeupdate "Direct link to beforeUpdate()?")
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
optional beforeUpdate(
|
|
137
|
+
id: IdValue,
|
|
138
|
+
values: FacetOf<TTable, "update">,
|
|
139
|
+
context: HookContext): MaybePromise<void | FacetOf<TTable, "update">>;
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Parameters[](#parameters-6 "Direct link to Parameters")
|
|
144
|
+
|
|
145
|
+
| Parameter | Type |
|
|
146
|
+
| --------- | ----------------------------------------------------------------- |
|
|
147
|
+
| `id` | `IdValue` |
|
|
148
|
+
| `values` | `FacetOf`<`TTable`, `"update"`> |
|
|
149
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
150
|
+
|
|
151
|
+
#### Returns[](#returns-6 "Direct link to Returns")
|
|
152
|
+
|
|
153
|
+
`MaybePromise`<`void` | `FacetOf`<`TTable`, `"update"`>>
|
|
154
|
+
|
|
155
|
+
***
|
|
156
|
+
|
|
157
|
+
### beforeUpsert()?[](#beforeupsert "Direct link to beforeUpsert()?")
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
optional beforeUpsert(values: FacetOf<TTable, "insert">, context: HookContext): MaybePromise<void | FacetOf<TTable, "insert">>;
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### Parameters[](#parameters-7 "Direct link to Parameters")
|
|
165
|
+
|
|
166
|
+
| Parameter | Type |
|
|
167
|
+
| --------- | ----------------------------------------------------------------- |
|
|
168
|
+
| `values` | `FacetOf`<`TTable`, `"insert"`> |
|
|
169
|
+
| `context` | [`HookContext`](./docs/api/appkit/Interface.HookContext.md) |
|
|
170
|
+
|
|
171
|
+
#### Returns[](#returns-7 "Direct link to Returns")
|
|
172
|
+
|
|
173
|
+
`MaybePromise`<`void` | `FacetOf`<`TTable`, `"insert"`>>
|
|
@@ -15,6 +15,34 @@ Target agent id. Defaults to the eval's parent `server/agents/<id>` dir.
|
|
|
15
15
|
|
|
16
16
|
***
|
|
17
17
|
|
|
18
|
+
### dataset?[](#dataset "Direct link to dataset?")
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
optional dataset: {
|
|
22
|
+
limit?: number;
|
|
23
|
+
table: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Run this eval once per row of a Databricks managed evaluation dataset (a Unity Catalog `catalog.schema.table` with `inputs`/`expectations` columns). Each row is bound to `t.input`/`t.expected`. Requires the runner to have a workspace client + warehouse (`--warehouse-id`). Omit for a single-run eval.
|
|
29
|
+
|
|
30
|
+
#### limit?[](#limit "Direct link to limit?")
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
optional limit: number;
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### table[](#table "Direct link to table")
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
table: string;
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
***
|
|
45
|
+
|
|
18
46
|
### description?[](#description "Direct link to description?")
|
|
19
47
|
|
|
20
48
|
```ts
|
|
@@ -24,6 +52,28 @@ optional description: string;
|
|
|
24
52
|
|
|
25
53
|
Short human description, shown in reports.
|
|
26
54
|
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### tags?[](#tags "Direct link to tags?")
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
optional tags: string[];
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Free-form tags for filtering (see the runner's `tags` / `--tag` option).
|
|
65
|
+
|
|
66
|
+
***
|
|
67
|
+
|
|
68
|
+
### timeoutMs?[](#timeoutms "Direct link to timeoutMs?")
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
optional timeoutMs: number;
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Per-eval timeout (ms): `runEval` races the test against it and records a non-passing result instead of hanging. Overrides the runner/CLI default.
|
|
76
|
+
|
|
27
77
|
## Methods[](#methods "Direct link to Methods")
|
|
28
78
|
|
|
29
79
|
### test()[](#test "Direct link to test()")
|
|
@@ -4,19 +4,40 @@ Abstraction over how the agent is driven. The HTTP driver posts to a running app
|
|
|
4
4
|
|
|
5
5
|
## Methods[](#methods "Direct link to Methods")
|
|
6
6
|
|
|
7
|
+
### reset()?[](#reset "Direct link to reset()?")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
optional reset(): void;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Drop the current conversation so the next `send` starts a fresh thread. Optional: drivers without a session concept omit it.
|
|
15
|
+
|
|
16
|
+
#### Returns[](#returns "Direct link to Returns")
|
|
17
|
+
|
|
18
|
+
`void`
|
|
19
|
+
|
|
20
|
+
***
|
|
21
|
+
|
|
7
22
|
### send()[](#send "Direct link to send()")
|
|
8
23
|
|
|
9
24
|
```ts
|
|
10
|
-
send(message: string
|
|
25
|
+
send(message: string, options?: {
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
}): Promise<DriveResult>;
|
|
11
28
|
|
|
12
29
|
```
|
|
13
30
|
|
|
31
|
+
Drive one turn. `options.signal`, when provided, aborts the in-flight turn: the runner passes its per-eval timeout signal so a timed-out eval cancels the request instead of leaking a live stream.
|
|
32
|
+
|
|
14
33
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
15
34
|
|
|
16
|
-
| Parameter
|
|
17
|
-
|
|
|
18
|
-
| `message`
|
|
35
|
+
| Parameter | Type |
|
|
36
|
+
| ----------------- | ----------------------------- |
|
|
37
|
+
| `message` | `string` |
|
|
38
|
+
| `options?` | { `signal?`: `AbortSignal`; } |
|
|
39
|
+
| `options.signal?` | `AbortSignal` |
|
|
19
40
|
|
|
20
|
-
#### Returns[](#returns "Direct link to Returns")
|
|
41
|
+
#### Returns[](#returns-1 "Direct link to Returns")
|
|
21
42
|
|
|
22
43
|
`Promise`<[`DriveResult`](./docs/api/appkit/Interface.DriveResult.md)>
|
|
@@ -42,6 +42,17 @@ id: string;
|
|
|
42
42
|
|
|
43
43
|
***
|
|
44
44
|
|
|
45
|
+
### infraFailure?[](#infrafailure "Direct link to infraFailure?")
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
optional infraFailure: boolean;
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
A turn failed at the transport/agent level (`succeeded: false`), not on an assertion — a retryable infra flake, distinct from `error`.
|
|
53
|
+
|
|
54
|
+
***
|
|
55
|
+
|
|
45
56
|
### passed[](#passed "Direct link to passed")
|
|
46
57
|
|
|
47
58
|
```ts
|
|
@@ -31,6 +31,17 @@ passed: number;
|
|
|
31
31
|
|
|
32
32
|
***
|
|
33
33
|
|
|
34
|
+
### passRate[](#passrate "Direct link to passRate")
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
passRate: number;
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Fraction of scored (non-skipped) evals that passed, 0..1 (1 when none scored).
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
34
45
|
### skipped[](#skipped "Direct link to skipped")
|
|
35
46
|
|
|
36
47
|
```ts
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Interface: HookApp
|
|
2
|
+
|
|
3
|
+
The only capability a hook receives: entities bound to its transaction.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### database[](#database "Direct link to database")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
readonly database: TransactionClient;
|
|
11
|
+
|
|
12
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Interface: HookContext
|
|
2
|
+
|
|
3
|
+
Which entity is being mutated, and the surface a hook may write through.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### app[](#app "Direct link to app")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
readonly app: HookApp;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### entity[](#entity "Direct link to entity")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
readonly entity: string;
|
|
20
|
+
|
|
21
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Interface: ReadEvalDatasetOptions
|
|
2
|
+
|
|
3
|
+
## Properties[](#properties "Direct link to Properties")
|
|
4
|
+
|
|
5
|
+
### limit?[](#limit "Direct link to limit?")
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
optional limit: number;
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Optional row cap.
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### table[](#table "Direct link to table")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
table: string;
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Fully-qualified UC table: `catalog.schema.table`.
|
|
24
|
+
|
|
25
|
+
***
|
|
26
|
+
|
|
27
|
+
### warehouseId[](#warehouseid "Direct link to warehouseId")
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
warehouseId: string;
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
SQL warehouse id to run the read against.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Interface: ReadSerializerContext
|
|
2
|
+
|
|
3
|
+
Which entity and generated operation produced the row being shaped.
|
|
4
|
+
|
|
5
|
+
## Properties[](#properties "Direct link to Properties")
|
|
6
|
+
|
|
7
|
+
### entity[](#entity "Direct link to entity")
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
readonly entity: string;
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
***
|
|
15
|
+
|
|
16
|
+
### operation[](#operation "Direct link to operation")
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
readonly operation: "detail" | "list";
|
|
20
|
+
|
|
21
|
+
```
|