parallel-web 0.3.2 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/client.d.mts +44 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +44 -2
- package/client.d.ts.map +1 -1
- package/client.js +43 -0
- package/client.js.map +1 -1
- package/client.mjs +43 -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 +42 -61
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +42 -61
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +3 -2
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +3 -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 +90 -0
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/beta/api.md +12 -9
- package/src/resources/beta/beta.ts +59 -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
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import * as Shared from './shared';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Advanced extract configuration.
|
|
7
|
+
*
|
|
8
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
9
|
+
* https://docs.parallel.ai/search/advanced-extract-settings for more info.
|
|
10
|
+
*/
|
|
11
|
+
export interface AdvancedExtractSettings {
|
|
12
|
+
/**
|
|
13
|
+
* Optional settings for returning relevant excerpts.
|
|
14
|
+
*/
|
|
15
|
+
excerpt_settings?: ExcerptSettings | null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Policy for live fetching web results.
|
|
19
|
+
*/
|
|
20
|
+
fetch_policy?: FetchPolicy | null;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Controls full content extraction. Set to true to enable with defaults, false to
|
|
24
|
+
* disable, or provide FullContentSettings for fine-grained control.
|
|
25
|
+
*/
|
|
26
|
+
full_content?: AdvancedExtractSettings.FullContentSettings | boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export namespace AdvancedExtractSettings {
|
|
30
|
+
/**
|
|
31
|
+
* Optional settings for returning full content.
|
|
32
|
+
*/
|
|
33
|
+
export interface FullContentSettings {
|
|
34
|
+
/**
|
|
35
|
+
* Optional limit on the number of characters to include in the full content for
|
|
36
|
+
* each url. Full content always starts at the beginning of the page and is
|
|
37
|
+
* truncated at the limit if necessary.
|
|
38
|
+
*/
|
|
39
|
+
max_chars_per_result?: number | null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Advanced search configuration.
|
|
45
|
+
*
|
|
46
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
47
|
+
* https://docs.parallel.ai/search/advanced-search-settings for more info.
|
|
48
|
+
*/
|
|
49
|
+
export interface AdvancedSearchSettings {
|
|
50
|
+
/**
|
|
51
|
+
* Optional settings for returning relevant excerpts.
|
|
52
|
+
*/
|
|
53
|
+
excerpt_settings?: ExcerptSettings | null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Policy for live fetching web results.
|
|
57
|
+
*/
|
|
58
|
+
fetch_policy?: FetchPolicy | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* ISO 3166-1 alpha-2 country code for geo-targeted search results.
|
|
62
|
+
*/
|
|
63
|
+
location?: string | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Upper bound on the number of results to return. Defaults to 10 if not provided.
|
|
67
|
+
*/
|
|
68
|
+
max_results?: number | null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Source policy for web search results.
|
|
72
|
+
*
|
|
73
|
+
* This policy governs which sources are allowed/disallowed in results.
|
|
74
|
+
*/
|
|
75
|
+
source_policy?: Shared.SourcePolicy | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Optional settings for returning relevant excerpts.
|
|
80
|
+
*/
|
|
81
|
+
export interface ExcerptSettings {
|
|
82
|
+
/**
|
|
83
|
+
* Optional upper bound on the total number of characters to include per url.
|
|
84
|
+
* Excerpts may contain fewer characters than this limit to maximize relevance and
|
|
85
|
+
* token efficiency. Values below 1000 will be automatically set to 1000.
|
|
86
|
+
*/
|
|
87
|
+
max_chars_per_result?: number | null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Extract error details.
|
|
92
|
+
*/
|
|
93
|
+
export interface ExtractError {
|
|
94
|
+
/**
|
|
95
|
+
* Content returned for http client or server errors, if any.
|
|
96
|
+
*/
|
|
97
|
+
content: string | null;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Error type.
|
|
101
|
+
*/
|
|
102
|
+
error_type: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* HTTP status code, if available.
|
|
106
|
+
*/
|
|
107
|
+
http_status_code: number | null;
|
|
108
|
+
|
|
109
|
+
url: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Extract response.
|
|
114
|
+
*/
|
|
115
|
+
export interface ExtractResponse {
|
|
116
|
+
/**
|
|
117
|
+
* Extract errors: requested URLs not in the results.
|
|
118
|
+
*/
|
|
119
|
+
errors: Array<ExtractError>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Extract request ID, e.g. `extract_cad0a6d2dec046bd95ae900527d880e7`
|
|
123
|
+
*/
|
|
124
|
+
extract_id: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Successful extract results.
|
|
128
|
+
*/
|
|
129
|
+
results: Array<ExtractResult>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Session identifier. Echoed back from the request if provided, otherwise
|
|
133
|
+
* generated by the server. Should be passed to future search and extract calls
|
|
134
|
+
* made by the agent as part of the same larger task.
|
|
135
|
+
*/
|
|
136
|
+
session_id: string;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Usage metrics for the extract request.
|
|
140
|
+
*/
|
|
141
|
+
usage?: Array<UsageItem> | null;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Warnings for the extract request, if any.
|
|
145
|
+
*/
|
|
146
|
+
warnings?: Array<Shared.Warning> | null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Extract result for a single URL.
|
|
151
|
+
*/
|
|
152
|
+
export interface ExtractResult {
|
|
153
|
+
/**
|
|
154
|
+
* Relevant excerpted content from the URL, formatted as markdown.
|
|
155
|
+
*/
|
|
156
|
+
excerpts: Array<string>;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* URL associated with the search result.
|
|
160
|
+
*/
|
|
161
|
+
url: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Full content from the URL formatted as markdown, if requested.
|
|
165
|
+
*/
|
|
166
|
+
full_content?: string | null;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Publish date of the webpage in YYYY-MM-DD format, if available.
|
|
170
|
+
*/
|
|
171
|
+
publish_date?: string | null;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Title of the webpage, if available.
|
|
175
|
+
*/
|
|
176
|
+
title?: string | null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Policy for live fetching web results.
|
|
181
|
+
*/
|
|
182
|
+
export interface FetchPolicy {
|
|
183
|
+
/**
|
|
184
|
+
* If false, fallback to cached content older than max-age if live fetch fails or
|
|
185
|
+
* times out. If true, returns an error instead.
|
|
186
|
+
*/
|
|
187
|
+
disable_cache_fallback?: boolean;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Maximum age of cached content in seconds to trigger a live fetch. Minimum value
|
|
191
|
+
* 600 seconds (10 minutes).
|
|
192
|
+
*/
|
|
193
|
+
max_age_seconds?: number | null;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Timeout in seconds for fetching live content if unavailable in cache.
|
|
197
|
+
*/
|
|
198
|
+
timeout_seconds?: number | null;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Search response.
|
|
203
|
+
*/
|
|
204
|
+
export interface SearchResult {
|
|
205
|
+
/**
|
|
206
|
+
* A list of search results, ordered by decreasing relevance.
|
|
207
|
+
*/
|
|
208
|
+
results: Array<WebSearchResult>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Search ID. Example: `search_cad0a6d2dec046bd95ae900527d880e7`
|
|
212
|
+
*/
|
|
213
|
+
search_id: string;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Session identifier, echoed back from the request if provided, otherwise
|
|
217
|
+
* generated by the server. Should be passed to future search and extract calls
|
|
218
|
+
* made by the agent as part of the same larger task.
|
|
219
|
+
*/
|
|
220
|
+
session_id: string;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Usage metrics for the search request.
|
|
224
|
+
*/
|
|
225
|
+
usage?: Array<UsageItem> | null;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Warnings for the search request, if any.
|
|
229
|
+
*/
|
|
230
|
+
warnings?: Array<Shared.Warning> | null;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Usage item for a single operation.
|
|
235
|
+
*/
|
|
236
|
+
export interface UsageItem {
|
|
237
|
+
/**
|
|
238
|
+
* Count of the SKU.
|
|
239
|
+
*/
|
|
240
|
+
count: number;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Name of the SKU.
|
|
244
|
+
*/
|
|
245
|
+
name: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* A single search result from the web search API.
|
|
250
|
+
*/
|
|
251
|
+
export interface WebSearchResult {
|
|
252
|
+
/**
|
|
253
|
+
* Relevant excerpted content from the URL, formatted as markdown.
|
|
254
|
+
*/
|
|
255
|
+
excerpts: Array<string>;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* URL associated with the search result.
|
|
259
|
+
*/
|
|
260
|
+
url: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Publish date of the webpage in YYYY-MM-DD format, if available.
|
|
264
|
+
*/
|
|
265
|
+
publish_date?: string | null;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Title of the webpage, if available.
|
|
269
|
+
*/
|
|
270
|
+
title?: string | null;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface ExtractParams {
|
|
274
|
+
/**
|
|
275
|
+
* URLs to extract content from. Up to 20 URLs.
|
|
276
|
+
*/
|
|
277
|
+
urls: Array<string>;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Advanced extract configuration.
|
|
281
|
+
*
|
|
282
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
283
|
+
* https://docs.parallel.ai/search/advanced-extract-settings for more info.
|
|
284
|
+
*/
|
|
285
|
+
advanced_settings?: AdvancedExtractSettings | null;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The model generating this request and consuming the results. Enables
|
|
289
|
+
* optimizations and tailors default settings for the model's capabilities.
|
|
290
|
+
*/
|
|
291
|
+
client_model?: string | null;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Upper bound on total characters across excerpts from all extracted results.
|
|
295
|
+
*/
|
|
296
|
+
max_chars_total?: number | null;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* As in SearchRequest, a natural-language description of the underlying question
|
|
300
|
+
* or goal driving the request. Used together with search_queries to focus excerpts
|
|
301
|
+
* on the most relevant content.
|
|
302
|
+
*/
|
|
303
|
+
objective?: string | null;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Optional keyword search queries, as in SearchRequest. Used together with
|
|
307
|
+
* objective to focus excerpts on the most relevant content.
|
|
308
|
+
*/
|
|
309
|
+
search_queries?: Array<string> | null;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Session identifier to track calls across separate search and extract calls, to
|
|
313
|
+
* be used as part of a larger task. Specifying it may give better contextual
|
|
314
|
+
* results for subsequent API calls.
|
|
315
|
+
*/
|
|
316
|
+
session_id?: string | null;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface SearchParams {
|
|
320
|
+
/**
|
|
321
|
+
* Concise keyword search queries, 3-6 words each. At least one query is required,
|
|
322
|
+
* provide 2-3 for best results. Used together with objective to focus results on
|
|
323
|
+
* the most relevant content.
|
|
324
|
+
*/
|
|
325
|
+
search_queries: Array<string>;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Advanced search configuration.
|
|
329
|
+
*
|
|
330
|
+
* These settings may impact result quality and latency unless used carefully. See
|
|
331
|
+
* https://docs.parallel.ai/search/advanced-search-settings for more info.
|
|
332
|
+
*/
|
|
333
|
+
advanced_settings?: AdvancedSearchSettings | null;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* The model generating this request and consuming the results. Enables
|
|
337
|
+
* optimizations and tailors default settings for the model's capabilities.
|
|
338
|
+
*/
|
|
339
|
+
client_model?: string | null;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Upper bound on total characters across excerpts from all results.
|
|
343
|
+
*/
|
|
344
|
+
max_chars_total?: number | null;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Search mode preset: supported values are `basic` and `advanced`. Basic mode
|
|
348
|
+
* offers the lowest latency and works best with 2-3 high-quality search_queries.
|
|
349
|
+
* Advanced mode provides higher quality with more advanced retrieval and
|
|
350
|
+
* compression. Defaults to `advanced` when omitted.
|
|
351
|
+
*/
|
|
352
|
+
mode?: 'basic' | 'advanced' | null;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Natural-language description of the underlying question or goal driving the
|
|
356
|
+
* search. Used together with search_queries to focus results on the most relevant
|
|
357
|
+
* content. Should be self-contained with enough context to understand the intent
|
|
358
|
+
* of the search.
|
|
359
|
+
*/
|
|
360
|
+
objective?: string | null;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Session identifier to track calls across separate search and extract calls, to
|
|
364
|
+
* be used as part of a larger task. Specifying it may give better contextual
|
|
365
|
+
* results for subsequent API calls.
|
|
366
|
+
*/
|
|
367
|
+
session_id?: string | null;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export declare namespace TopLevel {
|
|
371
|
+
export {
|
|
372
|
+
type AdvancedExtractSettings as AdvancedExtractSettings,
|
|
373
|
+
type AdvancedSearchSettings as AdvancedSearchSettings,
|
|
374
|
+
type ExcerptSettings as ExcerptSettings,
|
|
375
|
+
type ExtractError as ExtractError,
|
|
376
|
+
type ExtractResponse as ExtractResponse,
|
|
377
|
+
type ExtractResult as ExtractResult,
|
|
378
|
+
type FetchPolicy as FetchPolicy,
|
|
379
|
+
type SearchResult as SearchResult,
|
|
380
|
+
type UsageItem as UsageItem,
|
|
381
|
+
type WebSearchResult as WebSearchResult,
|
|
382
|
+
type ExtractParams as ExtractParams,
|
|
383
|
+
type SearchParams as SearchParams,
|
|
384
|
+
};
|
|
385
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.4.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.4.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|