@nimble-way/nimble-js 0.20.0 → 1.0.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/CHANGELOG.md +9 -0
- package/README.md +10 -10
- package/client.d.mts +10 -39
- package/client.d.mts.map +1 -1
- package/client.d.ts +10 -39
- package/client.d.ts.map +1 -1
- package/client.js +8 -43
- package/client.js.map +1 -1
- package/client.mjs +8 -43
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/{task-agent/task-agent.d.mts → agents/agents.d.mts} +51 -213
- package/resources/agents/agents.d.mts.map +1 -0
- package/resources/{task-agent/task-agent.d.ts → agents/agents.d.ts} +51 -213
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +67 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +62 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/index.d.mts +4 -0
- package/resources/agents/index.d.mts.map +1 -0
- package/resources/agents/index.d.ts +4 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/{task-agent → agents}/index.js +3 -3
- package/resources/agents/index.js.map +1 -0
- package/resources/{task-agent → agents}/index.mjs +1 -1
- package/resources/agents/index.mjs.map +1 -0
- package/resources/{task-agent → agents}/runs.d.mts +192 -43
- package/resources/agents/runs.d.mts.map +1 -0
- package/resources/{task-agent → agents}/runs.d.ts +192 -43
- package/resources/agents/runs.d.ts.map +1 -0
- package/resources/agents/runs.js +63 -0
- package/resources/agents/runs.js.map +1 -0
- package/resources/agents/runs.mjs +59 -0
- package/resources/agents/runs.mjs.map +1 -0
- package/resources/{task-agent → agents}/templates.d.mts +3 -6
- package/resources/agents/templates.d.mts.map +1 -0
- package/resources/{task-agent → agents}/templates.d.ts +3 -6
- package/resources/agents/templates.d.ts.map +1 -0
- package/resources/{task-agent → agents}/templates.js +5 -8
- package/resources/agents/templates.js.map +1 -0
- package/resources/agents/templates.mjs +19 -0
- package/resources/agents/templates.mjs.map +1 -0
- package/resources/agents.d.mts +2 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +2 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/{task-agent.js → agents.js} +2 -2
- package/resources/agents.js.map +1 -0
- package/resources/{task-agent.mjs → agents.mjs} +2 -2
- package/resources/agents.mjs.map +1 -0
- package/resources/batches.js +3 -3
- package/resources/batches.mjs +3 -3
- package/resources/crawl.js +4 -4
- package/resources/crawl.mjs +4 -4
- package/resources/domain-knowledge.js +1 -1
- package/resources/domain-knowledge.mjs +1 -1
- package/resources/extract/extract.d.mts +1243 -0
- package/resources/extract/extract.d.mts.map +1 -0
- package/resources/extract/extract.d.ts +1243 -0
- package/resources/extract/extract.d.ts.map +1 -0
- package/resources/extract/extract.js +52 -0
- package/resources/extract/extract.js.map +1 -0
- package/resources/extract/extract.mjs +47 -0
- package/resources/extract/extract.mjs.map +1 -0
- package/resources/extract/index.d.mts +3 -0
- package/resources/extract/index.d.mts.map +1 -0
- package/resources/extract/index.d.ts +3 -0
- package/resources/extract/index.d.ts.map +1 -0
- package/resources/extract/index.js +9 -0
- package/resources/extract/index.js.map +1 -0
- package/resources/extract/index.mjs +4 -0
- package/resources/extract/index.mjs.map +1 -0
- package/resources/extract/templates/generations.d.mts +364 -0
- package/resources/extract/templates/generations.d.mts.map +1 -0
- package/resources/extract/templates/generations.d.ts +364 -0
- package/resources/extract/templates/generations.d.ts.map +1 -0
- package/resources/extract/templates/generations.js +39 -0
- package/resources/extract/templates/generations.js.map +1 -0
- package/resources/extract/templates/generations.mjs +35 -0
- package/resources/extract/templates/generations.mjs.map +1 -0
- package/resources/extract/templates/index.d.mts +4 -0
- package/resources/extract/templates/index.d.mts.map +1 -0
- package/resources/extract/templates/index.d.ts +4 -0
- package/resources/extract/templates/index.d.ts.map +1 -0
- package/resources/extract/templates/index.js +11 -0
- package/resources/extract/templates/index.js.map +1 -0
- package/resources/extract/templates/index.mjs +5 -0
- package/resources/extract/templates/index.mjs.map +1 -0
- package/resources/extract/templates/templates.d.mts +870 -0
- package/resources/extract/templates/templates.d.mts.map +1 -0
- package/resources/extract/templates/templates.d.ts +870 -0
- package/resources/extract/templates/templates.d.ts.map +1 -0
- package/resources/extract/templates/templates.js +120 -0
- package/resources/extract/templates/templates.js.map +1 -0
- package/resources/extract/templates/templates.mjs +115 -0
- package/resources/extract/templates/templates.mjs.map +1 -0
- package/resources/extract/templates/versions.d.mts +226 -0
- package/resources/extract/templates/versions.d.mts.map +1 -0
- package/resources/extract/templates/versions.d.ts +226 -0
- package/resources/extract/templates/versions.d.ts.map +1 -0
- package/resources/extract/templates/versions.js +42 -0
- package/resources/extract/templates/versions.js.map +1 -0
- package/resources/extract/templates/versions.mjs +38 -0
- package/resources/extract/templates/versions.mjs.map +1 -0
- package/resources/extract/templates.d.mts +2 -0
- package/resources/extract/templates.d.mts.map +1 -0
- package/resources/extract/templates.d.ts +2 -0
- package/resources/extract/templates.d.ts.map +1 -0
- package/resources/extract/templates.js +6 -0
- package/resources/extract/templates.js.map +1 -0
- package/resources/extract/templates.mjs +3 -0
- package/resources/extract/templates.mjs.map +1 -0
- package/resources/extract.d.mts +2 -0
- package/resources/extract.d.mts.map +1 -0
- package/resources/extract.d.ts +2 -0
- package/resources/extract.d.ts.map +1 -0
- package/resources/extract.js +6 -0
- package/resources/extract.js.map +1 -0
- package/resources/extract.mjs +3 -0
- package/resources/extract.mjs.map +1 -0
- package/resources/fast-serp.js +1 -1
- package/resources/fast-serp.mjs +1 -1
- package/resources/index.d.mts +4 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/jobs/index.d.mts +2 -2
- package/resources/jobs/index.d.mts.map +1 -1
- package/resources/jobs/index.d.ts +2 -2
- package/resources/jobs/index.d.ts.map +1 -1
- package/resources/jobs/index.js.map +1 -1
- package/resources/jobs/index.mjs.map +1 -1
- package/resources/jobs/jobs.d.mts +35 -103
- package/resources/jobs/jobs.d.mts.map +1 -1
- package/resources/jobs/jobs.d.ts +35 -103
- package/resources/jobs/jobs.d.ts.map +1 -1
- package/resources/jobs/jobs.js +10 -28
- package/resources/jobs/jobs.js.map +1 -1
- package/resources/jobs/jobs.mjs +11 -29
- package/resources/jobs/jobs.mjs.map +1 -1
- package/resources/jobs/runs/artifacts.d.mts +4 -12
- package/resources/jobs/runs/artifacts.d.mts.map +1 -1
- package/resources/jobs/runs/artifacts.d.ts +4 -12
- package/resources/jobs/runs/artifacts.d.ts.map +1 -1
- package/resources/jobs/runs/artifacts.js +8 -16
- package/resources/jobs/runs/artifacts.js.map +1 -1
- package/resources/jobs/runs/artifacts.mjs +8 -16
- package/resources/jobs/runs/artifacts.mjs.map +1 -1
- package/resources/jobs/runs/index.d.mts +1 -1
- package/resources/jobs/runs/index.d.mts.map +1 -1
- package/resources/jobs/runs/index.d.ts +1 -1
- package/resources/jobs/runs/index.d.ts.map +1 -1
- package/resources/jobs/runs/index.js.map +1 -1
- package/resources/jobs/runs/index.mjs.map +1 -1
- package/resources/jobs/runs/runs.d.mts +60 -28
- package/resources/jobs/runs/runs.d.mts.map +1 -1
- package/resources/jobs/runs/runs.d.ts +60 -28
- package/resources/jobs/runs/runs.d.ts.map +1 -1
- package/resources/jobs/runs/runs.js +12 -12
- package/resources/jobs/runs/runs.js.map +1 -1
- package/resources/jobs/runs/runs.mjs +12 -12
- package/resources/jobs/runs/runs.mjs.map +1 -1
- package/resources/media.js +2 -2
- package/resources/media.mjs +2 -2
- package/resources/serp.js +3 -3
- package/resources/serp.mjs +3 -3
- package/resources/tasks.js +3 -3
- package/resources/tasks.mjs +3 -3
- package/resources/top-level.d.mts +1 -1202
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +1 -1202
- package/resources/top-level.d.ts.map +1 -1
- package/src/client.ts +41 -123
- package/src/resources/{task-agent/task-agent.ts → agents/agents.ts} +71 -258
- package/src/resources/{task-agent → agents}/index.ts +14 -14
- package/src/resources/{task-agent → agents}/runs.ts +228 -54
- package/src/resources/{task-agent → agents}/templates.ts +5 -8
- package/src/resources/{task-agent.ts → agents.ts} +1 -1
- package/src/resources/batches.ts +3 -3
- package/src/resources/crawl.ts +4 -4
- package/src/resources/domain-knowledge.ts +1 -1
- package/src/resources/extract/extract.ts +5182 -0
- package/src/resources/extract/index.ts +25 -0
- package/src/resources/extract/templates/generations.ts +435 -0
- package/src/resources/extract/templates/index.ts +29 -0
- package/src/resources/extract/templates/templates.ts +1176 -0
- package/src/resources/extract/templates/versions.ts +284 -0
- package/src/resources/extract/templates.ts +3 -0
- package/src/resources/extract.ts +3 -0
- package/src/resources/fast-serp.ts +1 -1
- package/src/resources/index.ts +16 -36
- package/src/resources/jobs/index.ts +1 -1
- package/src/resources/jobs/jobs.ts +50 -125
- package/src/resources/jobs/runs/artifacts.ts +8 -16
- package/src/resources/jobs/runs/index.ts +1 -0
- package/src/resources/jobs/runs/runs.ts +75 -31
- package/src/resources/media.ts +2 -2
- package/src/resources/serp.ts +3 -3
- package/src/resources/tasks.ts +3 -3
- package/src/resources/top-level.ts +72 -5171
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/agent.d.mts +0 -641
- package/resources/agent.d.mts.map +0 -1
- package/resources/agent.d.ts +0 -641
- package/resources/agent.d.ts.map +0 -1
- package/resources/agent.js +0 -84
- package/resources/agent.js.map +0 -1
- package/resources/agent.mjs +0 -80
- package/resources/agent.mjs.map +0 -1
- package/resources/task-agent/index.d.mts +0 -4
- package/resources/task-agent/index.d.mts.map +0 -1
- package/resources/task-agent/index.d.ts +0 -4
- package/resources/task-agent/index.d.ts.map +0 -1
- package/resources/task-agent/index.js.map +0 -1
- package/resources/task-agent/index.mjs.map +0 -1
- package/resources/task-agent/runs.d.mts.map +0 -1
- package/resources/task-agent/runs.d.ts.map +0 -1
- package/resources/task-agent/runs.js +0 -63
- package/resources/task-agent/runs.js.map +0 -1
- package/resources/task-agent/runs.mjs +0 -59
- package/resources/task-agent/runs.mjs.map +0 -1
- package/resources/task-agent/task-agent.d.mts.map +0 -1
- package/resources/task-agent/task-agent.d.ts.map +0 -1
- package/resources/task-agent/task-agent.js +0 -80
- package/resources/task-agent/task-agent.js.map +0 -1
- package/resources/task-agent/task-agent.mjs +0 -75
- package/resources/task-agent/task-agent.mjs.map +0 -1
- package/resources/task-agent/templates.d.mts.map +0 -1
- package/resources/task-agent/templates.d.ts.map +0 -1
- package/resources/task-agent/templates.js.map +0 -1
- package/resources/task-agent/templates.mjs +0 -22
- package/resources/task-agent/templates.mjs.map +0 -1
- package/resources/task-agent.d.mts +0 -2
- package/resources/task-agent.d.mts.map +0 -1
- package/resources/task-agent.d.ts +0 -2
- package/resources/task-agent.d.ts.map +0 -1
- package/resources/task-agent.js.map +0 -1
- package/resources/task-agent.mjs.map +0 -1
- package/src/resources/agent.ts +0 -935
|
@@ -8,70 +8,141 @@ import { path } from '../../internal/utils/path';
|
|
|
8
8
|
|
|
9
9
|
export class Runs extends APIResource {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Start an agent run. The run executes asynchronously: the response returns
|
|
12
|
+
* immediately with status `queued`, then poll `GET .../runs/{run_id}` until
|
|
13
|
+
* `completed` and fetch the output from `GET .../runs/{run_id}/result` — or set
|
|
14
|
+
* `enable_events: true` and follow `GET .../runs/{run_id}/events` for live
|
|
15
|
+
* progress.
|
|
12
16
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
* To enrich existing records instead of researching from scratch, pass them in
|
|
18
|
+
* `input_data`; this requires an `output_schema` (on the request or the agent).
|
|
19
|
+
*/
|
|
20
|
+
create(agentID: string, body: RunCreateParams, options?: RequestOptions): APIPromise<RunCreateResponse> {
|
|
21
|
+
return this._client.post(path`/v2/agents/${agentID}/runs`, { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List the runs of an agent, newest first, paginated with `offset`/`limit`.
|
|
17
26
|
*/
|
|
18
27
|
list(
|
|
19
28
|
agentID: string,
|
|
20
29
|
query: RunListParams | null | undefined = {},
|
|
21
30
|
options?: RequestOptions,
|
|
22
31
|
): APIPromise<RunListResponse> {
|
|
23
|
-
return this._client.get(path`/
|
|
32
|
+
return this._client.get(path`/v2/agents/${agentID}/runs`, { query, ...options });
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* A run resolves only when (run_id, agent_id) match — otherwise 404. This means a
|
|
30
|
-
* stale URL with a swapped agent_id won't leak runs across instances even if the
|
|
31
|
-
* run_id is real.
|
|
32
|
-
*
|
|
33
|
-
* @deprecated
|
|
36
|
+
* Retrieve a run's current state. Poll this endpoint after creating a run: the run
|
|
37
|
+
* is finished once `status` is `completed`, `failed`, or `cancelled`.
|
|
34
38
|
*/
|
|
35
39
|
get(runID: string, params: RunGetParams, options?: RequestOptions): APIPromise<RunGetResponse> {
|
|
36
40
|
const { agent_id } = params;
|
|
37
|
-
return this._client.get(path`/
|
|
41
|
+
return this._client.get(path`/v2/agents/${agent_id}/runs/${runID}`, options);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
/**
|
|
41
|
-
* Fetch the
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* - 404 when the run doesn't belong to the agent.
|
|
46
|
-
* - 408 when the run is still active.
|
|
47
|
-
* - 422 (with TaskRunFailedResult body) when the run failed or was cancelled.
|
|
48
|
-
* - 200 (with TaskRunResult body) on success.
|
|
45
|
+
* Fetch the output of a completed run. The `output` is `type: "text"` (a prose
|
|
46
|
+
* answer) or `type: "json"` (structured data matching the output schema), plus
|
|
47
|
+
* `trust` metadata with per-claim citations for the answer.
|
|
49
48
|
*
|
|
50
|
-
*
|
|
49
|
+
* While the run is still `queued` or `running` this endpoint returns `409`; if the
|
|
50
|
+
* run `failed` or was `cancelled` it returns `422` with the run and error details.
|
|
51
51
|
*/
|
|
52
|
-
|
|
53
|
-
runID: string,
|
|
54
|
-
params: RunGetResultParams,
|
|
55
|
-
options?: RequestOptions,
|
|
56
|
-
): APIPromise<RunGetResultResponse> {
|
|
52
|
+
result(runID: string, params: RunResultParams, options?: RequestOptions): APIPromise<RunResultResponse> {
|
|
57
53
|
const { agent_id } = params;
|
|
58
|
-
return this._client.get(path`/
|
|
54
|
+
return this._client.get(path`/v2/agents/${agent_id}/runs/${runID}/result`, options);
|
|
59
55
|
}
|
|
60
56
|
|
|
61
57
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
58
|
+
* Stream a run's progress as
|
|
59
|
+
* [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)
|
|
60
|
+
* (`text/event-stream`). Create the run with `enable_events: true` to have events
|
|
61
|
+
* published. A keep-alive comment is sent every 15 seconds.
|
|
65
62
|
*/
|
|
66
63
|
streamEvents(runID: string, params: RunStreamEventsParams, options?: RequestOptions): APIPromise<void> {
|
|
67
64
|
const { agent_id } = params;
|
|
68
|
-
return this._client.get(path`/
|
|
65
|
+
return this._client.get(path`/v2/agents/${agent_id}/runs/${runID}/events`, {
|
|
69
66
|
...options,
|
|
70
67
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
71
68
|
});
|
|
72
69
|
}
|
|
73
70
|
}
|
|
74
71
|
|
|
72
|
+
export interface RunCreateResponse {
|
|
73
|
+
/**
|
|
74
|
+
* Run identifier, format "task*run*{uuid}".
|
|
75
|
+
*/
|
|
76
|
+
id: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* When the run was created.
|
|
80
|
+
*/
|
|
81
|
+
created_at: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Effort level used for the run.
|
|
85
|
+
*/
|
|
86
|
+
effort: 'low' | 'medium' | 'high' | 'x-high' | 'max';
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Interaction ID.
|
|
90
|
+
*/
|
|
91
|
+
interaction_id: string;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* True while status is 'queued' or 'running'.
|
|
95
|
+
*/
|
|
96
|
+
is_active: boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Current run status.
|
|
100
|
+
*/
|
|
101
|
+
status: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Web Search Agent instance this run belongs to.
|
|
105
|
+
*/
|
|
106
|
+
web_search_agent_id: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* When the run completed.
|
|
110
|
+
*/
|
|
111
|
+
completed_at?: string | null;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Error details when the run failed.
|
|
115
|
+
*/
|
|
116
|
+
error?: RunCreateResponse.Error | null;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Prompt submitted for the run.
|
|
120
|
+
*/
|
|
121
|
+
prompt?: string | null;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* When the run started executing.
|
|
125
|
+
*/
|
|
126
|
+
started_at?: string | null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export namespace RunCreateResponse {
|
|
130
|
+
/**
|
|
131
|
+
* Error details when the run failed.
|
|
132
|
+
*/
|
|
133
|
+
export interface Error {
|
|
134
|
+
/**
|
|
135
|
+
* Human-readable error description.
|
|
136
|
+
*/
|
|
137
|
+
message: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Reference ID (equals the run id).
|
|
141
|
+
*/
|
|
142
|
+
ref_id: string;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
75
146
|
export interface RunListResponse {
|
|
76
147
|
/**
|
|
77
148
|
* Items returned in this page.
|
|
@@ -244,25 +315,25 @@ export namespace RunGetResponse {
|
|
|
244
315
|
}
|
|
245
316
|
}
|
|
246
317
|
|
|
247
|
-
export type
|
|
248
|
-
|
|
|
249
|
-
|
|
|
318
|
+
export type RunResultResponse =
|
|
319
|
+
| RunResultResponse.TaskRunResultPublicV2
|
|
320
|
+
| RunResultResponse.TaskRunFailedResultPublicV2;
|
|
250
321
|
|
|
251
|
-
export namespace
|
|
252
|
-
export interface
|
|
322
|
+
export namespace RunResultResponse {
|
|
323
|
+
export interface TaskRunResultPublicV2 {
|
|
253
324
|
/**
|
|
254
325
|
* Output from the completed task.
|
|
255
326
|
*/
|
|
256
|
-
output:
|
|
327
|
+
output: TaskRunResultPublicV2.TaskRunTextOutputPublicV2 | TaskRunResultPublicV2.TaskRunJsonOutputPublicV2;
|
|
257
328
|
|
|
258
329
|
/**
|
|
259
330
|
* Task run object with status 'completed'.
|
|
260
331
|
*/
|
|
261
|
-
run:
|
|
332
|
+
run: TaskRunResultPublicV2.Run;
|
|
262
333
|
}
|
|
263
334
|
|
|
264
|
-
export namespace
|
|
265
|
-
export interface
|
|
335
|
+
export namespace TaskRunResultPublicV2 {
|
|
336
|
+
export interface TaskRunTextOutputPublicV2 {
|
|
266
337
|
/**
|
|
267
338
|
* The final prose answer.
|
|
268
339
|
*/
|
|
@@ -271,7 +342,7 @@ export namespace RunGetResultResponse {
|
|
|
271
342
|
/**
|
|
272
343
|
* Trust and citation metadata for the output.
|
|
273
344
|
*/
|
|
274
|
-
trust:
|
|
345
|
+
trust: TaskRunTextOutputPublicV2.Trust;
|
|
275
346
|
|
|
276
347
|
/**
|
|
277
348
|
* Output content type.
|
|
@@ -279,7 +350,7 @@ export namespace RunGetResultResponse {
|
|
|
279
350
|
type?: 'text';
|
|
280
351
|
}
|
|
281
352
|
|
|
282
|
-
export namespace
|
|
353
|
+
export namespace TaskRunTextOutputPublicV2 {
|
|
283
354
|
/**
|
|
284
355
|
* Trust and citation metadata for the output.
|
|
285
356
|
*/
|
|
@@ -438,7 +509,7 @@ export namespace RunGetResultResponse {
|
|
|
438
509
|
}
|
|
439
510
|
}
|
|
440
511
|
|
|
441
|
-
export interface
|
|
512
|
+
export interface TaskRunJsonOutputPublicV2 {
|
|
442
513
|
/**
|
|
443
514
|
* The final structured output.
|
|
444
515
|
*/
|
|
@@ -447,7 +518,7 @@ export namespace RunGetResultResponse {
|
|
|
447
518
|
/**
|
|
448
519
|
* Trust and citation metadata for the output.
|
|
449
520
|
*/
|
|
450
|
-
trust:
|
|
521
|
+
trust: TaskRunJsonOutputPublicV2.Trust;
|
|
451
522
|
|
|
452
523
|
/**
|
|
453
524
|
* Output content type.
|
|
@@ -455,7 +526,7 @@ export namespace RunGetResultResponse {
|
|
|
455
526
|
type?: 'json';
|
|
456
527
|
}
|
|
457
528
|
|
|
458
|
-
export namespace
|
|
529
|
+
export namespace TaskRunJsonOutputPublicV2 {
|
|
459
530
|
/**
|
|
460
531
|
* Trust and citation metadata for the output.
|
|
461
532
|
*/
|
|
@@ -692,19 +763,19 @@ export namespace RunGetResultResponse {
|
|
|
692
763
|
}
|
|
693
764
|
}
|
|
694
765
|
|
|
695
|
-
export interface
|
|
766
|
+
export interface TaskRunFailedResultPublicV2 {
|
|
696
767
|
/**
|
|
697
768
|
* Structured error detail.
|
|
698
769
|
*/
|
|
699
|
-
error:
|
|
770
|
+
error: TaskRunFailedResultPublicV2.Error;
|
|
700
771
|
|
|
701
772
|
/**
|
|
702
773
|
* Task run object with status 'failed'.
|
|
703
774
|
*/
|
|
704
|
-
run:
|
|
775
|
+
run: TaskRunFailedResultPublicV2.Run;
|
|
705
776
|
}
|
|
706
777
|
|
|
707
|
-
export namespace
|
|
778
|
+
export namespace TaskRunFailedResultPublicV2 {
|
|
708
779
|
/**
|
|
709
780
|
* Structured error detail.
|
|
710
781
|
*/
|
|
@@ -799,6 +870,107 @@ export namespace RunGetResultResponse {
|
|
|
799
870
|
}
|
|
800
871
|
}
|
|
801
872
|
|
|
873
|
+
export interface RunCreateParams {
|
|
874
|
+
/**
|
|
875
|
+
* User prompt or task instructions for the run.
|
|
876
|
+
*/
|
|
877
|
+
input: string;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Canonical effort tier names for the research graph.
|
|
881
|
+
*/
|
|
882
|
+
effort?: 'low' | 'medium' | 'high' | 'x-high' | 'max' | null;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Whether to stream run events when supported.
|
|
886
|
+
*/
|
|
887
|
+
enable_events?: boolean;
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Existing records to ENRICH: a list of partial rows, or a single object,
|
|
891
|
+
* mirroring output_schema's shape.
|
|
892
|
+
*/
|
|
893
|
+
input_data?: Array<{ [key: string]: unknown }> | { [key: string]: unknown } | null;
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* JSON schema overriding the agent's default structured output for this run.
|
|
897
|
+
*/
|
|
898
|
+
output_schema?: { [key: string]: unknown } | null;
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Previous interaction identifier used to continue a conversation.
|
|
902
|
+
*/
|
|
903
|
+
previous_interaction_id?: string | null;
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Source guidance overriding the agent default.
|
|
907
|
+
*/
|
|
908
|
+
sources?: RunCreateParams.Sources | null;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
export namespace RunCreateParams {
|
|
912
|
+
/**
|
|
913
|
+
* Source guidance overriding the agent default.
|
|
914
|
+
*/
|
|
915
|
+
export interface Sources {
|
|
916
|
+
/**
|
|
917
|
+
* Source groups the agent is allowed to use.
|
|
918
|
+
*/
|
|
919
|
+
allow?: Array<Sources.Allow>;
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Free-text guidance describing sources or domains to avoid.
|
|
923
|
+
*/
|
|
924
|
+
avoid?: string | null;
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Source groups the agent should not use.
|
|
928
|
+
*/
|
|
929
|
+
block?: Array<Sources.Block>;
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Free-text guidance describing sources or domains to prioritize.
|
|
933
|
+
*/
|
|
934
|
+
prioritize?: string | null;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
export namespace Sources {
|
|
938
|
+
export interface Allow {
|
|
939
|
+
/**
|
|
940
|
+
* Domains included in this source group.
|
|
941
|
+
*/
|
|
942
|
+
domains: Array<string>;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Source group title.
|
|
946
|
+
*/
|
|
947
|
+
title: string;
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Zero-based source group position.
|
|
951
|
+
*/
|
|
952
|
+
order?: number;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
export interface Block {
|
|
956
|
+
/**
|
|
957
|
+
* Domains included in this source group.
|
|
958
|
+
*/
|
|
959
|
+
domains: Array<string>;
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* Source group title.
|
|
963
|
+
*/
|
|
964
|
+
title: string;
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Zero-based source group position.
|
|
968
|
+
*/
|
|
969
|
+
order?: number;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
802
974
|
export interface RunListParams {
|
|
803
975
|
limit?: number;
|
|
804
976
|
|
|
@@ -809,7 +981,7 @@ export interface RunGetParams {
|
|
|
809
981
|
agent_id: string;
|
|
810
982
|
}
|
|
811
983
|
|
|
812
|
-
export interface
|
|
984
|
+
export interface RunResultParams {
|
|
813
985
|
agent_id: string;
|
|
814
986
|
}
|
|
815
987
|
|
|
@@ -819,12 +991,14 @@ export interface RunStreamEventsParams {
|
|
|
819
991
|
|
|
820
992
|
export declare namespace Runs {
|
|
821
993
|
export {
|
|
994
|
+
type RunCreateResponse as RunCreateResponse,
|
|
822
995
|
type RunListResponse as RunListResponse,
|
|
823
996
|
type RunGetResponse as RunGetResponse,
|
|
824
|
-
type
|
|
997
|
+
type RunResultResponse as RunResultResponse,
|
|
998
|
+
type RunCreateParams as RunCreateParams,
|
|
825
999
|
type RunListParams as RunListParams,
|
|
826
1000
|
type RunGetParams as RunGetParams,
|
|
827
|
-
type
|
|
1001
|
+
type RunResultParams as RunResultParams,
|
|
828
1002
|
type RunStreamEventsParams as RunStreamEventsParams,
|
|
829
1003
|
};
|
|
830
1004
|
}
|
|
@@ -7,24 +7,21 @@ import { path } from '../../internal/utils/path';
|
|
|
7
7
|
|
|
8
8
|
export class Templates extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* List
|
|
11
|
-
*
|
|
12
|
-
* @deprecated
|
|
10
|
+
* List the pre-built agent templates available to your account. Use a template's
|
|
11
|
+
* `template_name` with `POST /v2/agents` to create an agent instance from it.
|
|
13
12
|
*/
|
|
14
13
|
list(
|
|
15
14
|
query: TemplateListParams | null | undefined = {},
|
|
16
15
|
options?: RequestOptions,
|
|
17
16
|
): APIPromise<TemplateListResponse> {
|
|
18
|
-
return this._client.get('/
|
|
17
|
+
return this._client.get('/v2/agents/templates', { query, ...options });
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @deprecated
|
|
21
|
+
* Retrieve a single agent template by its stable `template_name`.
|
|
25
22
|
*/
|
|
26
23
|
get(templateName: string, options?: RequestOptions): APIPromise<TemplateGetResponse> {
|
|
27
|
-
return this._client.get(path`/
|
|
24
|
+
return this._client.get(path`/v2/agents/templates/${templateName}`, options);
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
27
|
|
package/src/resources/batches.ts
CHANGED
|
@@ -11,7 +11,7 @@ export class Batches extends APIResource {
|
|
|
11
11
|
* Retrieve a paginated list of batches for the authenticated account.
|
|
12
12
|
*/
|
|
13
13
|
list(options?: RequestOptions): APIPromise<void> {
|
|
14
|
-
return this._client.get('/
|
|
14
|
+
return this._client.get('/v2/batches', {
|
|
15
15
|
...options,
|
|
16
16
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
17
17
|
});
|
|
@@ -21,7 +21,7 @@ export class Batches extends APIResource {
|
|
|
21
21
|
* Retrieve the details of a batch including all its tasks and completion status.
|
|
22
22
|
*/
|
|
23
23
|
get(batchID: string, options?: RequestOptions): APIPromise<BatchGetResponse> {
|
|
24
|
-
return this._client.get(path`/
|
|
24
|
+
return this._client.get(path`/v2/batches/${batchID}`, options);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -29,7 +29,7 @@ export class Batches extends APIResource {
|
|
|
29
29
|
* details.
|
|
30
30
|
*/
|
|
31
31
|
progress(batchID: string, options?: RequestOptions): APIPromise<BatchProgressResponse> {
|
|
32
|
-
return this._client.get(path`/
|
|
32
|
+
return this._client.get(path`/v2/batches/${batchID}/progress`, options);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
package/src/resources/crawl.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class Crawl extends APIResource {
|
|
|
19
19
|
query: CrawlListParams | null | undefined = {},
|
|
20
20
|
options?: RequestOptions,
|
|
21
21
|
): APIPromise<CrawlListResponse> {
|
|
22
|
-
return this._client.get('/
|
|
22
|
+
return this._client.get('/v2/crawl', { query, ...options });
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -31,7 +31,7 @@ export class Crawl extends APIResource {
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
run(body: CrawlRunParams, options?: RequestOptions): APIPromise<CrawlRunResponse> {
|
|
34
|
-
return this._client.post('/
|
|
34
|
+
return this._client.post('/v2/crawl', { body, ...options });
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -45,7 +45,7 @@ export class Crawl extends APIResource {
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
status(id: string, options?: RequestOptions): APIPromise<CrawlStatusResponse> {
|
|
48
|
-
return this._client.get(path`/
|
|
48
|
+
return this._client.get(path`/v2/crawl/${id}`, options);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
@@ -59,7 +59,7 @@ export class Crawl extends APIResource {
|
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
61
|
terminate(id: string, options?: RequestOptions): APIPromise<CrawlTerminateResponse> {
|
|
62
|
-
return this._client.delete(path`/
|
|
62
|
+
return this._client.delete(path`/v2/crawl/${id}`, options);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -13,7 +13,7 @@ export class DomainKnowledge extends APIResource {
|
|
|
13
13
|
query: DomainKnowledgeGetDriverParams | null | undefined = {},
|
|
14
14
|
options?: RequestOptions,
|
|
15
15
|
): APIPromise<DomainKnowledgeGetDriverResponse> {
|
|
16
|
-
return this._client.get('/
|
|
16
|
+
return this._client.get('/v2/domain-knowledge/driver', { query, ...options });
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|