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.
Files changed (95) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/client.d.mts +44 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +44 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +43 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +43 -0
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/env.js +2 -2
  11. package/internal/utils/env.js.map +1 -1
  12. package/internal/utils/env.mjs +2 -2
  13. package/internal/utils/env.mjs.map +1 -1
  14. package/package.json +12 -1
  15. package/resources/beta/beta.d.mts +42 -61
  16. package/resources/beta/beta.d.mts.map +1 -1
  17. package/resources/beta/beta.d.ts +42 -61
  18. package/resources/beta/beta.d.ts.map +1 -1
  19. package/resources/beta/beta.js +3 -2
  20. package/resources/beta/beta.js.map +1 -1
  21. package/resources/beta/beta.mjs +3 -2
  22. package/resources/beta/beta.mjs.map +1 -1
  23. package/resources/beta/findall.d.mts +167 -8
  24. package/resources/beta/findall.d.mts.map +1 -1
  25. package/resources/beta/findall.d.ts +167 -8
  26. package/resources/beta/findall.d.ts.map +1 -1
  27. package/resources/beta/findall.js +108 -0
  28. package/resources/beta/findall.js.map +1 -1
  29. package/resources/beta/findall.mjs +108 -0
  30. package/resources/beta/findall.mjs.map +1 -1
  31. package/resources/beta/index.d.mts +2 -2
  32. package/resources/beta/index.d.mts.map +1 -1
  33. package/resources/beta/index.d.ts +2 -2
  34. package/resources/beta/index.d.ts.map +1 -1
  35. package/resources/beta/index.js.map +1 -1
  36. package/resources/beta/index.mjs.map +1 -1
  37. package/resources/beta/task-group.d.mts +50 -5
  38. package/resources/beta/task-group.d.mts.map +1 -1
  39. package/resources/beta/task-group.d.ts +50 -5
  40. package/resources/beta/task-group.d.ts.map +1 -1
  41. package/resources/beta/task-group.js +45 -3
  42. package/resources/beta/task-group.js.map +1 -1
  43. package/resources/beta/task-group.mjs +45 -3
  44. package/resources/beta/task-group.mjs.map +1 -1
  45. package/resources/beta/task-run.d.mts +77 -270
  46. package/resources/beta/task-run.d.mts.map +1 -1
  47. package/resources/beta/task-run.d.ts +77 -270
  48. package/resources/beta/task-run.d.ts.map +1 -1
  49. package/resources/beta/task-run.js +17 -2
  50. package/resources/beta/task-run.js.map +1 -1
  51. package/resources/beta/task-run.mjs +17 -2
  52. package/resources/beta/task-run.mjs.map +1 -1
  53. package/resources/index.d.mts +2 -1
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +2 -1
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js.map +1 -1
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/shared.d.mts +4 -2
  60. package/resources/shared.d.mts.map +1 -1
  61. package/resources/shared.d.ts +4 -2
  62. package/resources/shared.d.ts.map +1 -1
  63. package/resources/task-run.d.mts +308 -30
  64. package/resources/task-run.d.mts.map +1 -1
  65. package/resources/task-run.d.ts +308 -30
  66. package/resources/task-run.d.ts.map +1 -1
  67. package/resources/task-run.js +67 -4
  68. package/resources/task-run.js.map +1 -1
  69. package/resources/task-run.mjs +67 -4
  70. package/resources/task-run.mjs.map +1 -1
  71. package/resources/top-level.d.mts +317 -0
  72. package/resources/top-level.d.mts.map +1 -0
  73. package/resources/top-level.d.ts +317 -0
  74. package/resources/top-level.d.ts.map +1 -0
  75. package/resources/top-level.js +4 -0
  76. package/resources/top-level.js.map +1 -0
  77. package/resources/top-level.mjs +3 -0
  78. package/resources/top-level.mjs.map +1 -0
  79. package/src/client.ts +90 -0
  80. package/src/internal/utils/env.ts +2 -2
  81. package/src/resources/beta/api.md +12 -9
  82. package/src/resources/beta/beta.ts +59 -73
  83. package/src/resources/beta/findall.ts +187 -7
  84. package/src/resources/beta/index.ts +7 -4
  85. package/src/resources/beta/task-group.ts +54 -7
  86. package/src/resources/beta/task-run.ts +94 -305
  87. package/src/resources/index.ts +20 -0
  88. package/src/resources/shared.ts +4 -2
  89. package/src/resources/task-run.ts +391 -32
  90. package/src/resources/top-level.ts +385 -0
  91. package/src/version.ts +1 -1
  92. package/version.d.mts +1 -1
  93. package/version.d.ts +1 -1
  94. package/version.js +1 -1
  95. 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.3.2'; // x-release-please-version
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.3.2";
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.3.2";
1
+ export declare const VERSION = "0.4.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.3.2'; // x-release-please-version
4
+ exports.VERSION = '0.4.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.3.2'; // x-release-please-version
1
+ export const VERSION = '0.4.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map