parallel-web 0.3.2 → 0.4.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 +44 -0
- package/client.d.mts +40 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +40 -2
- package/client.d.ts.map +1 -1
- package/client.js +39 -0
- package/client.js.map +1 -1
- package/client.mjs +39 -0
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +12 -1
- package/resources/beta/beta.d.mts +40 -61
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +40 -61
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +11 -2
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +11 -2
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/findall.d.mts +167 -8
- package/resources/beta/findall.d.mts.map +1 -1
- package/resources/beta/findall.d.ts +167 -8
- package/resources/beta/findall.d.ts.map +1 -1
- package/resources/beta/findall.js +108 -0
- package/resources/beta/findall.js.map +1 -1
- package/resources/beta/findall.mjs +108 -0
- package/resources/beta/findall.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -2
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/task-group.d.mts +50 -5
- package/resources/beta/task-group.d.mts.map +1 -1
- package/resources/beta/task-group.d.ts +50 -5
- package/resources/beta/task-group.d.ts.map +1 -1
- package/resources/beta/task-group.js +45 -3
- package/resources/beta/task-group.js.map +1 -1
- package/resources/beta/task-group.mjs +45 -3
- package/resources/beta/task-group.mjs.map +1 -1
- package/resources/beta/task-run.d.mts +77 -270
- package/resources/beta/task-run.d.mts.map +1 -1
- package/resources/beta/task-run.d.ts +77 -270
- package/resources/beta/task-run.d.ts.map +1 -1
- package/resources/beta/task-run.js +17 -2
- package/resources/beta/task-run.js.map +1 -1
- package/resources/beta/task-run.mjs +17 -2
- package/resources/beta/task-run.mjs.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/shared.d.mts +4 -2
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +4 -2
- package/resources/shared.d.ts.map +1 -1
- package/resources/task-run.d.mts +308 -30
- package/resources/task-run.d.mts.map +1 -1
- package/resources/task-run.d.ts +308 -30
- package/resources/task-run.d.ts.map +1 -1
- package/resources/task-run.js +67 -4
- package/resources/task-run.js.map +1 -1
- package/resources/task-run.mjs +67 -4
- package/resources/task-run.mjs.map +1 -1
- package/resources/top-level.d.mts +317 -0
- package/resources/top-level.d.mts.map +1 -0
- package/resources/top-level.d.ts +317 -0
- package/resources/top-level.d.ts.map +1 -0
- package/resources/top-level.js +4 -0
- package/resources/top-level.js.map +1 -0
- package/resources/top-level.mjs +3 -0
- package/resources/top-level.mjs.map +1 -0
- package/src/client.ts +86 -0
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/beta/api.md +12 -9
- package/src/resources/beta/beta.ts +55 -73
- package/src/resources/beta/findall.ts +187 -7
- package/src/resources/beta/index.ts +7 -4
- package/src/resources/beta/task-group.ts +54 -7
- package/src/resources/beta/task-run.ts +94 -305
- package/src/resources/index.ts +20 -0
- package/src/resources/shared.ts +4 -2
- package/src/resources/task-run.ts +391 -32
- package/src/resources/top-level.ts +385 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/task-run.mjs
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
3
4
|
import { path } from "../internal/utils/path.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* The Task API executes web research and extraction tasks. Clients submit a natural-language objective with an optional input schema; the service plans retrieval, fetches relevant URLs, and returns outputs that conform to a provided or inferred JSON schema. Supports deep research style queries and can return rich structured JSON outputs. Processors trade-off between cost, latency, and quality. Each processor supports calibrated confidences.
|
|
6
7
|
* - Output metadata: citations, excerpts, reasoning, and confidence per field
|
|
8
|
+
*
|
|
9
|
+
* Task Groups enable batch execution of many independent Task runs with group-level monitoring and failure handling.
|
|
10
|
+
* - Submit hundreds or thousands of Tasks as a single group
|
|
11
|
+
* - Observe group progress and receive results as they complete
|
|
12
|
+
* - Real-time updates via Server-Sent Events (SSE)
|
|
13
|
+
* - Add tasks to an existing group while it is running
|
|
14
|
+
* - Group-level retry and error aggregation
|
|
7
15
|
*/
|
|
8
16
|
export class TaskRun extends APIResource {
|
|
9
17
|
/**
|
|
@@ -12,23 +20,78 @@ export class TaskRun extends APIResource {
|
|
|
12
20
|
* Returns immediately with a run object in status 'queued'.
|
|
13
21
|
*
|
|
14
22
|
* Beta features can be enabled by setting the 'parallel-beta' header.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const taskRun = await client.taskRun.create({
|
|
27
|
+
* input: 'What was the GDP of France in 2023?',
|
|
28
|
+
* processor: 'base',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
15
31
|
*/
|
|
16
|
-
create(
|
|
17
|
-
|
|
32
|
+
create(params, options) {
|
|
33
|
+
const { betas, ...body } = params;
|
|
34
|
+
return this._client.post('/v1/tasks/runs', {
|
|
35
|
+
body,
|
|
36
|
+
...options,
|
|
37
|
+
headers: buildHeaders([
|
|
38
|
+
{ ...(betas?.toString() != null ? { 'parallel-beta': betas?.toString() } : undefined) },
|
|
39
|
+
options?.headers,
|
|
40
|
+
]),
|
|
41
|
+
});
|
|
18
42
|
}
|
|
19
43
|
/**
|
|
20
44
|
* Retrieves run status by run_id.
|
|
21
45
|
*
|
|
22
46
|
* The run result is available from the `/result` endpoint.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const taskRun = await client.taskRun.retrieve('run_id');
|
|
51
|
+
* ```
|
|
23
52
|
*/
|
|
24
53
|
retrieve(runID, options) {
|
|
25
54
|
return this._client.get(path `/v1/tasks/runs/${runID}`, options);
|
|
26
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Streams events for a task run.
|
|
58
|
+
*
|
|
59
|
+
* Returns a stream of events showing progress updates and state changes for the
|
|
60
|
+
* task run.
|
|
61
|
+
*
|
|
62
|
+
* For task runs that did not have enable_events set to true during creation, the
|
|
63
|
+
* frequency of events will be reduced.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const response = await client.taskRun.events('run_id');
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
events(runID, options) {
|
|
71
|
+
return this._client.get(path `/v1/tasks/runs/${runID}/events`, {
|
|
72
|
+
...options,
|
|
73
|
+
headers: buildHeaders([{ Accept: 'text/event-stream' }, options?.headers]),
|
|
74
|
+
stream: true,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
27
77
|
/**
|
|
28
78
|
* Retrieves a run result by run_id, blocking until the run is completed.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const taskRunResult = await client.taskRun.result('run_id');
|
|
83
|
+
* ```
|
|
29
84
|
*/
|
|
30
|
-
result(runID,
|
|
31
|
-
|
|
85
|
+
result(runID, params = {}, options) {
|
|
86
|
+
const { betas, ...query } = params ?? {};
|
|
87
|
+
return this._client.get(path `/v1/tasks/runs/${runID}/result`, {
|
|
88
|
+
query,
|
|
89
|
+
...options,
|
|
90
|
+
headers: buildHeaders([
|
|
91
|
+
{ ...(betas?.toString() != null ? { 'parallel-beta': betas?.toString() } : undefined) },
|
|
92
|
+
options?.headers,
|
|
93
|
+
]),
|
|
94
|
+
});
|
|
32
95
|
}
|
|
33
96
|
}
|
|
34
97
|
//# sourceMappingURL=task-run.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-run.mjs","sourceRoot":"","sources":["../src/resources/task-run.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"task-run.mjs","sourceRoot":"","sources":["../src/resources/task-run.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;;;;;;;;;GAUG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,MAA2B,EAAE,OAAwB;QAC1D,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACvF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAa,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,KAAK,SAAS,EAAE;YAC5D,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAC1E,MAAM,EAAE,IAAI;SACb,CAA8C,CAAC;IAClD,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,KAAa,EACb,SAAiD,EAAE,EACnD,OAAwB;QAExB,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,KAAK,SAAS,EAAE;YAC5D,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB,EAAE,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE;gBACvF,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import * as Shared from "./shared.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Advanced extract configuration.
|
|
4
|
+
*
|
|
5
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
6
|
+
* https://docs.parallel.ai/search/advanced-extract-settings for more info.
|
|
7
|
+
*/
|
|
8
|
+
export interface AdvancedExtractSettings {
|
|
9
|
+
/**
|
|
10
|
+
* Optional settings for returning relevant excerpts.
|
|
11
|
+
*/
|
|
12
|
+
excerpt_settings?: ExcerptSettings | null;
|
|
13
|
+
/**
|
|
14
|
+
* Policy for live fetching web results.
|
|
15
|
+
*/
|
|
16
|
+
fetch_policy?: FetchPolicy | null;
|
|
17
|
+
/**
|
|
18
|
+
* Controls full content extraction. Set to true to enable with defaults, false to
|
|
19
|
+
* disable, or provide FullContentSettings for fine-grained control.
|
|
20
|
+
*/
|
|
21
|
+
full_content?: AdvancedExtractSettings.FullContentSettings | boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace AdvancedExtractSettings {
|
|
24
|
+
/**
|
|
25
|
+
* Optional settings for returning full content.
|
|
26
|
+
*/
|
|
27
|
+
interface FullContentSettings {
|
|
28
|
+
/**
|
|
29
|
+
* Optional limit on the number of characters to include in the full content for
|
|
30
|
+
* each url. Full content always starts at the beginning of the page and is
|
|
31
|
+
* truncated at the limit if necessary.
|
|
32
|
+
*/
|
|
33
|
+
max_chars_per_result?: number | null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Advanced search configuration.
|
|
38
|
+
*
|
|
39
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
40
|
+
* https://docs.parallel.ai/search/advanced-search-settings for more info.
|
|
41
|
+
*/
|
|
42
|
+
export interface AdvancedSearchSettings {
|
|
43
|
+
/**
|
|
44
|
+
* Optional settings for returning relevant excerpts.
|
|
45
|
+
*/
|
|
46
|
+
excerpt_settings?: ExcerptSettings | null;
|
|
47
|
+
/**
|
|
48
|
+
* Policy for live fetching web results.
|
|
49
|
+
*/
|
|
50
|
+
fetch_policy?: FetchPolicy | null;
|
|
51
|
+
/**
|
|
52
|
+
* ISO 3166-1 alpha-2 country code for geo-targeted search results.
|
|
53
|
+
*/
|
|
54
|
+
location?: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Upper bound on the number of results to return. Defaults to 10 if not provided.
|
|
57
|
+
*/
|
|
58
|
+
max_results?: number | null;
|
|
59
|
+
/**
|
|
60
|
+
* Source policy for web search results.
|
|
61
|
+
*
|
|
62
|
+
* This policy governs which sources are allowed/disallowed in results.
|
|
63
|
+
*/
|
|
64
|
+
source_policy?: Shared.SourcePolicy | null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Optional settings for returning relevant excerpts.
|
|
68
|
+
*/
|
|
69
|
+
export interface ExcerptSettings {
|
|
70
|
+
/**
|
|
71
|
+
* Optional upper bound on the total number of characters to include per url.
|
|
72
|
+
* Excerpts may contain fewer characters than this limit to maximize relevance and
|
|
73
|
+
* token efficiency. Values below 1000 will be automatically set to 1000.
|
|
74
|
+
*/
|
|
75
|
+
max_chars_per_result?: number | null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Extract error details.
|
|
79
|
+
*/
|
|
80
|
+
export interface ExtractError {
|
|
81
|
+
/**
|
|
82
|
+
* Content returned for http client or server errors, if any.
|
|
83
|
+
*/
|
|
84
|
+
content: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* Error type.
|
|
87
|
+
*/
|
|
88
|
+
error_type: string;
|
|
89
|
+
/**
|
|
90
|
+
* HTTP status code, if available.
|
|
91
|
+
*/
|
|
92
|
+
http_status_code: number | null;
|
|
93
|
+
url: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Extract response.
|
|
97
|
+
*/
|
|
98
|
+
export interface ExtractResponse {
|
|
99
|
+
/**
|
|
100
|
+
* Extract errors: requested URLs not in the results.
|
|
101
|
+
*/
|
|
102
|
+
errors: Array<ExtractError>;
|
|
103
|
+
/**
|
|
104
|
+
* Extract request ID, e.g. `extract_cad0a6d2dec046bd95ae900527d880e7`
|
|
105
|
+
*/
|
|
106
|
+
extract_id: string;
|
|
107
|
+
/**
|
|
108
|
+
* Successful extract results.
|
|
109
|
+
*/
|
|
110
|
+
results: Array<ExtractResult>;
|
|
111
|
+
/**
|
|
112
|
+
* Session identifier. Echoed back from the request if provided, otherwise
|
|
113
|
+
* generated by the server. Should be passed to future search and extract calls
|
|
114
|
+
* made by the agent as part of the same larger task.
|
|
115
|
+
*/
|
|
116
|
+
session_id: string;
|
|
117
|
+
/**
|
|
118
|
+
* Usage metrics for the extract request.
|
|
119
|
+
*/
|
|
120
|
+
usage?: Array<UsageItem> | null;
|
|
121
|
+
/**
|
|
122
|
+
* Warnings for the extract request, if any.
|
|
123
|
+
*/
|
|
124
|
+
warnings?: Array<Shared.Warning> | null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Extract result for a single URL.
|
|
128
|
+
*/
|
|
129
|
+
export interface ExtractResult {
|
|
130
|
+
/**
|
|
131
|
+
* Relevant excerpted content from the URL, formatted as markdown.
|
|
132
|
+
*/
|
|
133
|
+
excerpts: Array<string>;
|
|
134
|
+
/**
|
|
135
|
+
* URL associated with the search result.
|
|
136
|
+
*/
|
|
137
|
+
url: string;
|
|
138
|
+
/**
|
|
139
|
+
* Full content from the URL formatted as markdown, if requested.
|
|
140
|
+
*/
|
|
141
|
+
full_content?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* Publish date of the webpage in YYYY-MM-DD format, if available.
|
|
144
|
+
*/
|
|
145
|
+
publish_date?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* Title of the webpage, if available.
|
|
148
|
+
*/
|
|
149
|
+
title?: string | null;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Policy for live fetching web results.
|
|
153
|
+
*/
|
|
154
|
+
export interface FetchPolicy {
|
|
155
|
+
/**
|
|
156
|
+
* If false, fallback to cached content older than max-age if live fetch fails or
|
|
157
|
+
* times out. If true, returns an error instead.
|
|
158
|
+
*/
|
|
159
|
+
disable_cache_fallback?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Maximum age of cached content in seconds to trigger a live fetch. Minimum value
|
|
162
|
+
* 600 seconds (10 minutes).
|
|
163
|
+
*/
|
|
164
|
+
max_age_seconds?: number | null;
|
|
165
|
+
/**
|
|
166
|
+
* Timeout in seconds for fetching live content if unavailable in cache.
|
|
167
|
+
*/
|
|
168
|
+
timeout_seconds?: number | null;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Search response.
|
|
172
|
+
*/
|
|
173
|
+
export interface SearchResult {
|
|
174
|
+
/**
|
|
175
|
+
* A list of search results, ordered by decreasing relevance.
|
|
176
|
+
*/
|
|
177
|
+
results: Array<WebSearchResult>;
|
|
178
|
+
/**
|
|
179
|
+
* Search ID. Example: `search_cad0a6d2dec046bd95ae900527d880e7`
|
|
180
|
+
*/
|
|
181
|
+
search_id: string;
|
|
182
|
+
/**
|
|
183
|
+
* Session identifier, echoed back from the request if provided, otherwise
|
|
184
|
+
* generated by the server. Should be passed to future search and extract calls
|
|
185
|
+
* made by the agent as part of the same larger task.
|
|
186
|
+
*/
|
|
187
|
+
session_id: string;
|
|
188
|
+
/**
|
|
189
|
+
* Usage metrics for the search request.
|
|
190
|
+
*/
|
|
191
|
+
usage?: Array<UsageItem> | null;
|
|
192
|
+
/**
|
|
193
|
+
* Warnings for the search request, if any.
|
|
194
|
+
*/
|
|
195
|
+
warnings?: Array<Shared.Warning> | null;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Usage item for a single operation.
|
|
199
|
+
*/
|
|
200
|
+
export interface UsageItem {
|
|
201
|
+
/**
|
|
202
|
+
* Count of the SKU.
|
|
203
|
+
*/
|
|
204
|
+
count: number;
|
|
205
|
+
/**
|
|
206
|
+
* Name of the SKU.
|
|
207
|
+
*/
|
|
208
|
+
name: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* A single search result from the web search API.
|
|
212
|
+
*/
|
|
213
|
+
export interface WebSearchResult {
|
|
214
|
+
/**
|
|
215
|
+
* Relevant excerpted content from the URL, formatted as markdown.
|
|
216
|
+
*/
|
|
217
|
+
excerpts: Array<string>;
|
|
218
|
+
/**
|
|
219
|
+
* URL associated with the search result.
|
|
220
|
+
*/
|
|
221
|
+
url: string;
|
|
222
|
+
/**
|
|
223
|
+
* Publish date of the webpage in YYYY-MM-DD format, if available.
|
|
224
|
+
*/
|
|
225
|
+
publish_date?: string | null;
|
|
226
|
+
/**
|
|
227
|
+
* Title of the webpage, if available.
|
|
228
|
+
*/
|
|
229
|
+
title?: string | null;
|
|
230
|
+
}
|
|
231
|
+
export interface ExtractParams {
|
|
232
|
+
/**
|
|
233
|
+
* URLs to extract content from. Up to 20 URLs.
|
|
234
|
+
*/
|
|
235
|
+
urls: Array<string>;
|
|
236
|
+
/**
|
|
237
|
+
* Advanced extract configuration.
|
|
238
|
+
*
|
|
239
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
240
|
+
* https://docs.parallel.ai/search/advanced-extract-settings for more info.
|
|
241
|
+
*/
|
|
242
|
+
advanced_settings?: AdvancedExtractSettings | null;
|
|
243
|
+
/**
|
|
244
|
+
* The model generating this request and consuming the results. Enables
|
|
245
|
+
* optimizations and tailors default settings for the model's capabilities.
|
|
246
|
+
*/
|
|
247
|
+
client_model?: string | null;
|
|
248
|
+
/**
|
|
249
|
+
* Upper bound on total characters across excerpts from all extracted results.
|
|
250
|
+
*/
|
|
251
|
+
max_chars_total?: number | null;
|
|
252
|
+
/**
|
|
253
|
+
* As in SearchRequest, a natural-language description of the underlying question
|
|
254
|
+
* or goal driving the request. Used together with search_queries to focus excerpts
|
|
255
|
+
* on the most relevant content.
|
|
256
|
+
*/
|
|
257
|
+
objective?: string | null;
|
|
258
|
+
/**
|
|
259
|
+
* Optional keyword search queries, as in SearchRequest. Used together with
|
|
260
|
+
* objective to focus excerpts on the most relevant content.
|
|
261
|
+
*/
|
|
262
|
+
search_queries?: Array<string> | null;
|
|
263
|
+
/**
|
|
264
|
+
* Session identifier to track calls across separate search and extract calls, to
|
|
265
|
+
* be used as part of a larger task. Specifying it may give better contextual
|
|
266
|
+
* results for subsequent API calls.
|
|
267
|
+
*/
|
|
268
|
+
session_id?: string | null;
|
|
269
|
+
}
|
|
270
|
+
export interface SearchParams {
|
|
271
|
+
/**
|
|
272
|
+
* Concise keyword search queries, 3-6 words each. At least one query is required,
|
|
273
|
+
* provide 2-3 for best results. Used together with objective to focus results on
|
|
274
|
+
* the most relevant content.
|
|
275
|
+
*/
|
|
276
|
+
search_queries: Array<string>;
|
|
277
|
+
/**
|
|
278
|
+
* Advanced search configuration.
|
|
279
|
+
*
|
|
280
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
281
|
+
* https://docs.parallel.ai/search/advanced-search-settings for more info.
|
|
282
|
+
*/
|
|
283
|
+
advanced_settings?: AdvancedSearchSettings | null;
|
|
284
|
+
/**
|
|
285
|
+
* The model generating this request and consuming the results. Enables
|
|
286
|
+
* optimizations and tailors default settings for the model's capabilities.
|
|
287
|
+
*/
|
|
288
|
+
client_model?: string | null;
|
|
289
|
+
/**
|
|
290
|
+
* Upper bound on total characters across excerpts from all results.
|
|
291
|
+
*/
|
|
292
|
+
max_chars_total?: number | null;
|
|
293
|
+
/**
|
|
294
|
+
* Search mode preset: supported values are `basic` and `advanced`. Basic mode
|
|
295
|
+
* offers the lowest latency and works best with 2-3 high-quality search_queries.
|
|
296
|
+
* Advanced mode provides higher quality with more advanced retrieval and
|
|
297
|
+
* compression. Defaults to `advanced` when omitted.
|
|
298
|
+
*/
|
|
299
|
+
mode?: 'basic' | 'advanced' | null;
|
|
300
|
+
/**
|
|
301
|
+
* Natural-language description of the underlying question or goal driving the
|
|
302
|
+
* search. Used together with search_queries to focus results on the most relevant
|
|
303
|
+
* content. Should be self-contained with enough context to understand the intent
|
|
304
|
+
* of the search.
|
|
305
|
+
*/
|
|
306
|
+
objective?: string | null;
|
|
307
|
+
/**
|
|
308
|
+
* Session identifier to track calls across separate search and extract calls, to
|
|
309
|
+
* be used as part of a larger task. Specifying it may give better contextual
|
|
310
|
+
* results for subsequent API calls.
|
|
311
|
+
*/
|
|
312
|
+
session_id?: string | null;
|
|
313
|
+
}
|
|
314
|
+
export declare namespace TopLevel {
|
|
315
|
+
export { type AdvancedExtractSettings as AdvancedExtractSettings, type AdvancedSearchSettings as AdvancedSearchSettings, type ExcerptSettings as ExcerptSettings, type ExtractError as ExtractError, type ExtractResponse as ExtractResponse, type ExtractResult as ExtractResult, type FetchPolicy as FetchPolicy, type SearchResult as SearchResult, type UsageItem as UsageItem, type WebSearchResult as WebSearchResult, type ExtractParams as ExtractParams, type SearchParams as SearchParams, };
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=top-level.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-level.d.mts","sourceRoot":"","sources":["../src/resources/top-level.ts"],"names":[],"mappings":"OAEO,KAAK,MAAM;AAElB;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,gBAAgB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAE1C;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAElC;;;OAGG;IACH,YAAY,CAAC,EAAE,uBAAuB,CAAC,mBAAmB,GAAG,OAAO,CAAC;CACtE;AAED,yBAAiB,uBAAuB,CAAC;IACvC;;OAEG;IACH,UAAiB,mBAAmB;QAClC;;;;WAIG;QACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACtC;CACF;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,gBAAgB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAE1C;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;CAC5C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,W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