parallel-web 0.2.2__py3-none-any.whl → 0.3.1__py3-none-any.whl
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.
Potentially problematic release.
This version of parallel-web might be problematic. Click here for more details.
- parallel/_version.py +1 -1
- parallel/resources/beta/beta.py +180 -5
- parallel/types/beta/__init__.py +6 -0
- parallel/types/beta/beta_extract_params.py +63 -0
- parallel/types/beta/beta_search_params.py +8 -3
- parallel/types/beta/excerpt_settings_param.py +17 -0
- parallel/types/beta/extract_error.py +20 -0
- parallel/types/beta/extract_response.py +20 -0
- parallel/types/beta/extract_result.py +23 -0
- parallel/types/beta/fetch_policy_param.py +31 -0
- {parallel_web-0.2.2.dist-info → parallel_web-0.3.1.dist-info}/METADATA +2 -2
- {parallel_web-0.2.2.dist-info → parallel_web-0.3.1.dist-info}/RECORD +14 -8
- {parallel_web-0.2.2.dist-info → parallel_web-0.3.1.dist-info}/WHEEL +0 -0
- {parallel_web-0.2.2.dist-info → parallel_web-0.3.1.dist-info}/licenses/LICENSE +0 -0
parallel/_version.py
CHANGED
parallel/resources/beta/beta.py
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Optional
|
|
5
|
+
from typing import List, Optional
|
|
6
6
|
from typing_extensions import Literal
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
11
|
-
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._utils import is_given, maybe_transform, strip_not_given, async_maybe_transform
|
|
12
12
|
from .task_run import (
|
|
13
13
|
TaskRunResource,
|
|
14
14
|
AsyncTaskRunResource,
|
|
@@ -33,9 +33,12 @@ from ..._response import (
|
|
|
33
33
|
async_to_raw_response_wrapper,
|
|
34
34
|
async_to_streamed_response_wrapper,
|
|
35
35
|
)
|
|
36
|
-
from ...types.beta import beta_search_params
|
|
36
|
+
from ...types.beta import beta_search_params, beta_extract_params
|
|
37
37
|
from ..._base_client import make_request_options
|
|
38
38
|
from ...types.beta.search_result import SearchResult
|
|
39
|
+
from ...types.beta.extract_response import ExtractResponse
|
|
40
|
+
from ...types.beta.fetch_policy_param import FetchPolicyParam
|
|
41
|
+
from ...types.beta.parallel_beta_param import ParallelBetaParam
|
|
39
42
|
from ...types.shared_params.source_policy import SourcePolicy
|
|
40
43
|
|
|
41
44
|
__all__ = ["BetaResource", "AsyncBetaResource"]
|
|
@@ -69,15 +72,89 @@ class BetaResource(SyncAPIResource):
|
|
|
69
72
|
"""
|
|
70
73
|
return BetaResourceWithStreamingResponse(self)
|
|
71
74
|
|
|
75
|
+
def extract(
|
|
76
|
+
self,
|
|
77
|
+
*,
|
|
78
|
+
urls: SequenceNotStr[str],
|
|
79
|
+
excerpts: beta_extract_params.Excerpts | Omit = omit,
|
|
80
|
+
fetch_policy: Optional[FetchPolicyParam] | Omit = omit,
|
|
81
|
+
full_content: beta_extract_params.FullContent | Omit = omit,
|
|
82
|
+
objective: Optional[str] | Omit = omit,
|
|
83
|
+
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
84
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
85
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
86
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
87
|
+
extra_headers: Headers | None = None,
|
|
88
|
+
extra_query: Query | None = None,
|
|
89
|
+
extra_body: Body | None = None,
|
|
90
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
91
|
+
) -> ExtractResponse:
|
|
92
|
+
"""
|
|
93
|
+
Extracts relevant content from specific web URLs.
|
|
94
|
+
|
|
95
|
+
To access this endpoint, pass the `parallel-beta` header with the value
|
|
96
|
+
`search-extract-2025-10-10`.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
excerpts: Include excerpts from each URL relevant to the search objective and queries.
|
|
100
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
101
|
+
redundant with full content.
|
|
102
|
+
|
|
103
|
+
fetch_policy: Fetch policy.
|
|
104
|
+
|
|
105
|
+
Determines when to return content from the cache (faster) vs fetching live
|
|
106
|
+
content (fresher).
|
|
107
|
+
|
|
108
|
+
full_content: Include full content from each URL. Note that if neither objective nor
|
|
109
|
+
search_queries is provided, excerpts are redundant with full content.
|
|
110
|
+
|
|
111
|
+
objective: If provided, focuses extracted content on the specified search objective.
|
|
112
|
+
|
|
113
|
+
search_queries: If provided, focuses extracted content on the specified keyword search queries.
|
|
114
|
+
|
|
115
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
116
|
+
|
|
117
|
+
extra_headers: Send extra headers
|
|
118
|
+
|
|
119
|
+
extra_query: Add additional query parameters to the request
|
|
120
|
+
|
|
121
|
+
extra_body: Add additional JSON properties to the request
|
|
122
|
+
|
|
123
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
124
|
+
"""
|
|
125
|
+
extra_headers = {
|
|
126
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
127
|
+
**(extra_headers or {}),
|
|
128
|
+
}
|
|
129
|
+
return self._post(
|
|
130
|
+
"/v1beta/extract",
|
|
131
|
+
body=maybe_transform(
|
|
132
|
+
{
|
|
133
|
+
"urls": urls,
|
|
134
|
+
"excerpts": excerpts,
|
|
135
|
+
"fetch_policy": fetch_policy,
|
|
136
|
+
"full_content": full_content,
|
|
137
|
+
"objective": objective,
|
|
138
|
+
"search_queries": search_queries,
|
|
139
|
+
},
|
|
140
|
+
beta_extract_params.BetaExtractParams,
|
|
141
|
+
),
|
|
142
|
+
options=make_request_options(
|
|
143
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
144
|
+
),
|
|
145
|
+
cast_to=ExtractResponse,
|
|
146
|
+
)
|
|
147
|
+
|
|
72
148
|
def search(
|
|
73
149
|
self,
|
|
74
150
|
*,
|
|
75
151
|
max_chars_per_result: Optional[int] | Omit = omit,
|
|
76
152
|
max_results: Optional[int] | Omit = omit,
|
|
77
153
|
objective: Optional[str] | Omit = omit,
|
|
78
|
-
processor: Literal["base", "pro"] | Omit = omit,
|
|
154
|
+
processor: Optional[Literal["base", "pro"]] | Omit = omit,
|
|
79
155
|
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
80
156
|
source_policy: Optional[SourcePolicy] | Omit = omit,
|
|
157
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
81
158
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
82
159
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
83
160
|
extra_headers: Headers | None = None,
|
|
@@ -109,6 +186,8 @@ class BetaResource(SyncAPIResource):
|
|
|
109
186
|
|
|
110
187
|
This policy governs which sources are allowed/disallowed in results.
|
|
111
188
|
|
|
189
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
190
|
+
|
|
112
191
|
extra_headers: Send extra headers
|
|
113
192
|
|
|
114
193
|
extra_query: Add additional query parameters to the request
|
|
@@ -117,6 +196,10 @@ class BetaResource(SyncAPIResource):
|
|
|
117
196
|
|
|
118
197
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
119
198
|
"""
|
|
199
|
+
extra_headers = {
|
|
200
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
201
|
+
**(extra_headers or {}),
|
|
202
|
+
}
|
|
120
203
|
return self._post(
|
|
121
204
|
"/v1beta/search",
|
|
122
205
|
body=maybe_transform(
|
|
@@ -165,15 +248,89 @@ class AsyncBetaResource(AsyncAPIResource):
|
|
|
165
248
|
"""
|
|
166
249
|
return AsyncBetaResourceWithStreamingResponse(self)
|
|
167
250
|
|
|
251
|
+
async def extract(
|
|
252
|
+
self,
|
|
253
|
+
*,
|
|
254
|
+
urls: SequenceNotStr[str],
|
|
255
|
+
excerpts: beta_extract_params.Excerpts | Omit = omit,
|
|
256
|
+
fetch_policy: Optional[FetchPolicyParam] | Omit = omit,
|
|
257
|
+
full_content: beta_extract_params.FullContent | Omit = omit,
|
|
258
|
+
objective: Optional[str] | Omit = omit,
|
|
259
|
+
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
260
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
261
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
262
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
263
|
+
extra_headers: Headers | None = None,
|
|
264
|
+
extra_query: Query | None = None,
|
|
265
|
+
extra_body: Body | None = None,
|
|
266
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
267
|
+
) -> ExtractResponse:
|
|
268
|
+
"""
|
|
269
|
+
Extracts relevant content from specific web URLs.
|
|
270
|
+
|
|
271
|
+
To access this endpoint, pass the `parallel-beta` header with the value
|
|
272
|
+
`search-extract-2025-10-10`.
|
|
273
|
+
|
|
274
|
+
Args:
|
|
275
|
+
excerpts: Include excerpts from each URL relevant to the search objective and queries.
|
|
276
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
277
|
+
redundant with full content.
|
|
278
|
+
|
|
279
|
+
fetch_policy: Fetch policy.
|
|
280
|
+
|
|
281
|
+
Determines when to return content from the cache (faster) vs fetching live
|
|
282
|
+
content (fresher).
|
|
283
|
+
|
|
284
|
+
full_content: Include full content from each URL. Note that if neither objective nor
|
|
285
|
+
search_queries is provided, excerpts are redundant with full content.
|
|
286
|
+
|
|
287
|
+
objective: If provided, focuses extracted content on the specified search objective.
|
|
288
|
+
|
|
289
|
+
search_queries: If provided, focuses extracted content on the specified keyword search queries.
|
|
290
|
+
|
|
291
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
292
|
+
|
|
293
|
+
extra_headers: Send extra headers
|
|
294
|
+
|
|
295
|
+
extra_query: Add additional query parameters to the request
|
|
296
|
+
|
|
297
|
+
extra_body: Add additional JSON properties to the request
|
|
298
|
+
|
|
299
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
300
|
+
"""
|
|
301
|
+
extra_headers = {
|
|
302
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
303
|
+
**(extra_headers or {}),
|
|
304
|
+
}
|
|
305
|
+
return await self._post(
|
|
306
|
+
"/v1beta/extract",
|
|
307
|
+
body=await async_maybe_transform(
|
|
308
|
+
{
|
|
309
|
+
"urls": urls,
|
|
310
|
+
"excerpts": excerpts,
|
|
311
|
+
"fetch_policy": fetch_policy,
|
|
312
|
+
"full_content": full_content,
|
|
313
|
+
"objective": objective,
|
|
314
|
+
"search_queries": search_queries,
|
|
315
|
+
},
|
|
316
|
+
beta_extract_params.BetaExtractParams,
|
|
317
|
+
),
|
|
318
|
+
options=make_request_options(
|
|
319
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
320
|
+
),
|
|
321
|
+
cast_to=ExtractResponse,
|
|
322
|
+
)
|
|
323
|
+
|
|
168
324
|
async def search(
|
|
169
325
|
self,
|
|
170
326
|
*,
|
|
171
327
|
max_chars_per_result: Optional[int] | Omit = omit,
|
|
172
328
|
max_results: Optional[int] | Omit = omit,
|
|
173
329
|
objective: Optional[str] | Omit = omit,
|
|
174
|
-
processor: Literal["base", "pro"] | Omit = omit,
|
|
330
|
+
processor: Optional[Literal["base", "pro"]] | Omit = omit,
|
|
175
331
|
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
176
332
|
source_policy: Optional[SourcePolicy] | Omit = omit,
|
|
333
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
177
334
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
178
335
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
179
336
|
extra_headers: Headers | None = None,
|
|
@@ -205,6 +362,8 @@ class AsyncBetaResource(AsyncAPIResource):
|
|
|
205
362
|
|
|
206
363
|
This policy governs which sources are allowed/disallowed in results.
|
|
207
364
|
|
|
365
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
366
|
+
|
|
208
367
|
extra_headers: Send extra headers
|
|
209
368
|
|
|
210
369
|
extra_query: Add additional query parameters to the request
|
|
@@ -213,6 +372,10 @@ class AsyncBetaResource(AsyncAPIResource):
|
|
|
213
372
|
|
|
214
373
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
215
374
|
"""
|
|
375
|
+
extra_headers = {
|
|
376
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
377
|
+
**(extra_headers or {}),
|
|
378
|
+
}
|
|
216
379
|
return await self._post(
|
|
217
380
|
"/v1beta/search",
|
|
218
381
|
body=await async_maybe_transform(
|
|
@@ -237,6 +400,9 @@ class BetaResourceWithRawResponse:
|
|
|
237
400
|
def __init__(self, beta: BetaResource) -> None:
|
|
238
401
|
self._beta = beta
|
|
239
402
|
|
|
403
|
+
self.extract = to_raw_response_wrapper(
|
|
404
|
+
beta.extract,
|
|
405
|
+
)
|
|
240
406
|
self.search = to_raw_response_wrapper(
|
|
241
407
|
beta.search,
|
|
242
408
|
)
|
|
@@ -254,6 +420,9 @@ class AsyncBetaResourceWithRawResponse:
|
|
|
254
420
|
def __init__(self, beta: AsyncBetaResource) -> None:
|
|
255
421
|
self._beta = beta
|
|
256
422
|
|
|
423
|
+
self.extract = async_to_raw_response_wrapper(
|
|
424
|
+
beta.extract,
|
|
425
|
+
)
|
|
257
426
|
self.search = async_to_raw_response_wrapper(
|
|
258
427
|
beta.search,
|
|
259
428
|
)
|
|
@@ -271,6 +440,9 @@ class BetaResourceWithStreamingResponse:
|
|
|
271
440
|
def __init__(self, beta: BetaResource) -> None:
|
|
272
441
|
self._beta = beta
|
|
273
442
|
|
|
443
|
+
self.extract = to_streamed_response_wrapper(
|
|
444
|
+
beta.extract,
|
|
445
|
+
)
|
|
274
446
|
self.search = to_streamed_response_wrapper(
|
|
275
447
|
beta.search,
|
|
276
448
|
)
|
|
@@ -288,6 +460,9 @@ class AsyncBetaResourceWithStreamingResponse:
|
|
|
288
460
|
def __init__(self, beta: AsyncBetaResource) -> None:
|
|
289
461
|
self._beta = beta
|
|
290
462
|
|
|
463
|
+
self.extract = async_to_streamed_response_wrapper(
|
|
464
|
+
beta.extract,
|
|
465
|
+
)
|
|
291
466
|
self.search = async_to_streamed_response_wrapper(
|
|
292
467
|
beta.search,
|
|
293
468
|
)
|
parallel/types/beta/__init__.py
CHANGED
|
@@ -6,18 +6,24 @@ from .webhook import Webhook as Webhook
|
|
|
6
6
|
from .mcp_server import McpServer as McpServer
|
|
7
7
|
from .task_group import TaskGroup as TaskGroup
|
|
8
8
|
from .error_event import ErrorEvent as ErrorEvent
|
|
9
|
+
from .extract_error import ExtractError as ExtractError
|
|
9
10
|
from .mcp_tool_call import McpToolCall as McpToolCall
|
|
10
11
|
from .search_result import SearchResult as SearchResult
|
|
11
12
|
from .webhook_param import WebhookParam as WebhookParam
|
|
12
13
|
from .beta_run_input import BetaRunInput as BetaRunInput
|
|
14
|
+
from .extract_result import ExtractResult as ExtractResult
|
|
13
15
|
from .task_run_event import TaskRunEvent as TaskRunEvent
|
|
16
|
+
from .extract_response import ExtractResponse as ExtractResponse
|
|
14
17
|
from .mcp_server_param import McpServerParam as McpServerParam
|
|
15
18
|
from .task_group_status import TaskGroupStatus as TaskGroupStatus
|
|
16
19
|
from .web_search_result import WebSearchResult as WebSearchResult
|
|
17
20
|
from .beta_search_params import BetaSearchParams as BetaSearchParams
|
|
21
|
+
from .fetch_policy_param import FetchPolicyParam as FetchPolicyParam
|
|
22
|
+
from .beta_extract_params import BetaExtractParams as BetaExtractParams
|
|
18
23
|
from .parallel_beta_param import ParallelBetaParam as ParallelBetaParam
|
|
19
24
|
from .beta_run_input_param import BetaRunInputParam as BetaRunInputParam
|
|
20
25
|
from .beta_task_run_result import BetaTaskRunResult as BetaTaskRunResult
|
|
26
|
+
from .excerpt_settings_param import ExcerptSettingsParam as ExcerptSettingsParam
|
|
21
27
|
from .task_run_create_params import TaskRunCreateParams as TaskRunCreateParams
|
|
22
28
|
from .task_run_result_params import TaskRunResultParams as TaskRunResultParams
|
|
23
29
|
from .task_group_run_response import TaskGroupRunResponse as TaskGroupRunResponse
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List, Union, Optional
|
|
6
|
+
from typing_extensions import Required, Annotated, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
from ..._types import SequenceNotStr
|
|
9
|
+
from ..._utils import PropertyInfo
|
|
10
|
+
from .fetch_policy_param import FetchPolicyParam
|
|
11
|
+
from .parallel_beta_param import ParallelBetaParam
|
|
12
|
+
from .excerpt_settings_param import ExcerptSettingsParam
|
|
13
|
+
|
|
14
|
+
__all__ = ["BetaExtractParams", "Excerpts", "FullContent", "FullContentFullContentSettings"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class BetaExtractParams(TypedDict, total=False):
|
|
18
|
+
urls: Required[SequenceNotStr[str]]
|
|
19
|
+
|
|
20
|
+
excerpts: Excerpts
|
|
21
|
+
"""Include excerpts from each URL relevant to the search objective and queries.
|
|
22
|
+
|
|
23
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
24
|
+
redundant with full content.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
fetch_policy: Optional[FetchPolicyParam]
|
|
28
|
+
"""Fetch policy.
|
|
29
|
+
|
|
30
|
+
Determines when to return content from the cache (faster) vs fetching live
|
|
31
|
+
content (fresher).
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
full_content: FullContent
|
|
35
|
+
"""Include full content from each URL.
|
|
36
|
+
|
|
37
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
38
|
+
redundant with full content.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
objective: Optional[str]
|
|
42
|
+
"""If provided, focuses extracted content on the specified search objective."""
|
|
43
|
+
|
|
44
|
+
search_queries: Optional[SequenceNotStr[str]]
|
|
45
|
+
"""If provided, focuses extracted content on the specified keyword search queries."""
|
|
46
|
+
|
|
47
|
+
betas: Annotated[List[ParallelBetaParam], PropertyInfo(alias="parallel-beta")]
|
|
48
|
+
"""Optional header to specify the beta version(s) to enable."""
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Excerpts: TypeAlias = Union[bool, ExcerptSettingsParam]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class FullContentFullContentSettings(TypedDict, total=False):
|
|
55
|
+
max_chars_per_result: Optional[int]
|
|
56
|
+
"""
|
|
57
|
+
Optional limit on the number of characters to include in the full content for
|
|
58
|
+
each url. Full content always starts at the beginning of the page and is
|
|
59
|
+
truncated at the limit if necessary.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
FullContent: TypeAlias = Union[bool, FullContentFullContentSettings]
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import Optional
|
|
6
|
-
from typing_extensions import Literal, TypedDict
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
from typing_extensions import Literal, Annotated, TypedDict
|
|
7
7
|
|
|
8
8
|
from ..._types import SequenceNotStr
|
|
9
|
+
from ..._utils import PropertyInfo
|
|
10
|
+
from .parallel_beta_param import ParallelBetaParam
|
|
9
11
|
from ..shared_params.source_policy import SourcePolicy
|
|
10
12
|
|
|
11
13
|
__all__ = ["BetaSearchParams"]
|
|
@@ -31,7 +33,7 @@ class BetaSearchParams(TypedDict, total=False):
|
|
|
31
33
|
objective or search_queries must be provided.
|
|
32
34
|
"""
|
|
33
35
|
|
|
34
|
-
processor: Literal["base", "pro"]
|
|
36
|
+
processor: Optional[Literal["base", "pro"]]
|
|
35
37
|
"""Search processor."""
|
|
36
38
|
|
|
37
39
|
search_queries: Optional[SequenceNotStr[str]]
|
|
@@ -46,3 +48,6 @@ class BetaSearchParams(TypedDict, total=False):
|
|
|
46
48
|
|
|
47
49
|
This policy governs which sources are allowed/disallowed in results.
|
|
48
50
|
"""
|
|
51
|
+
|
|
52
|
+
betas: Annotated[List[ParallelBetaParam], PropertyInfo(alias="parallel-beta")]
|
|
53
|
+
"""Optional header to specify the beta version(s) to enable."""
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["ExcerptSettingsParam"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ExcerptSettingsParam(TypedDict, total=False):
|
|
12
|
+
max_chars_per_result: Optional[int]
|
|
13
|
+
"""
|
|
14
|
+
Optional upper bound on the total number of characters to include across all
|
|
15
|
+
excerpts for each url. Excerpts may contain fewer characters than this limit to
|
|
16
|
+
maximize relevance and token efficiency.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ExtractError"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ExtractError(BaseModel):
|
|
11
|
+
content: Optional[str] = None
|
|
12
|
+
"""Content returned for http client or server errors, if any."""
|
|
13
|
+
|
|
14
|
+
error_type: str
|
|
15
|
+
"""Error type."""
|
|
16
|
+
|
|
17
|
+
http_status_code: Optional[int] = None
|
|
18
|
+
"""HTTP status code, if available."""
|
|
19
|
+
|
|
20
|
+
url: str
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
from .extract_error import ExtractError
|
|
7
|
+
from .extract_result import ExtractResult
|
|
8
|
+
|
|
9
|
+
__all__ = ["ExtractResponse"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ExtractResponse(BaseModel):
|
|
13
|
+
errors: List[ExtractError]
|
|
14
|
+
"""Extract errors: requested URLs not in the results."""
|
|
15
|
+
|
|
16
|
+
extract_id: str
|
|
17
|
+
"""Extract request ID, e.g. `extract_cad0a6d2dec046bd95ae900527d880e7`"""
|
|
18
|
+
|
|
19
|
+
results: List[ExtractResult]
|
|
20
|
+
"""Successful extract results."""
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from ..._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ExtractResult"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ExtractResult(BaseModel):
|
|
11
|
+
excerpts: Optional[List[str]] = None
|
|
12
|
+
"""Relevant excerpted content from the URL, formatted as markdown."""
|
|
13
|
+
|
|
14
|
+
full_content: Optional[str] = None
|
|
15
|
+
"""Full content from the URL formatted as markdown, if requested."""
|
|
16
|
+
|
|
17
|
+
publish_date: Optional[str] = None
|
|
18
|
+
"""Publish date of the webpage, if available."""
|
|
19
|
+
|
|
20
|
+
title: Optional[str] = None
|
|
21
|
+
"""Title of the webpage, if available."""
|
|
22
|
+
|
|
23
|
+
url: str
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
from typing_extensions import TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["FetchPolicyParam"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class FetchPolicyParam(TypedDict, total=False):
|
|
12
|
+
disable_cache_fallback: bool
|
|
13
|
+
"""
|
|
14
|
+
If false, fallback to cached content older than max-age if live fetch fails or
|
|
15
|
+
times out. If true, returns an error instead.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
max_age_seconds: Optional[int]
|
|
19
|
+
"""Maximum age of cached content in seconds to trigger a live fetch.
|
|
20
|
+
|
|
21
|
+
Minimum value 600 seconds (10 minutes). If not provided, a dynamic age policy
|
|
22
|
+
will be used based on the search objective and url.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
timeout_seconds: Optional[float]
|
|
26
|
+
"""Timeout in seconds for fetching live content if unavailable in cache.
|
|
27
|
+
|
|
28
|
+
If unspecified a dynamic timeout will be used based on the url, generally 15
|
|
29
|
+
seconds for simple pages and up to 60 seconds for complex pages requiring
|
|
30
|
+
javascript or PDF rendering.
|
|
31
|
+
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: parallel-web
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: The official Python library for the Parallel API
|
|
5
5
|
Project-URL: Homepage, https://github.com/parallel-web/parallel-sdk-python
|
|
6
6
|
Project-URL: Repository, https://github.com/parallel-web/parallel-sdk-python
|
|
@@ -30,7 +30,7 @@ Requires-Dist: sniffio
|
|
|
30
30
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
31
|
Provides-Extra: aiohttp
|
|
32
32
|
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
33
|
-
Requires-Dist: httpx-aiohttp>=0.1.
|
|
33
|
+
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
|
|
36
36
|
# Parallel Python API library
|
|
@@ -11,7 +11,7 @@ parallel/_resource.py,sha256=QvY8l_r03hNBsFTTn3g7Pkx8OrDwIwROHaSEViWcYLA,1112
|
|
|
11
11
|
parallel/_response.py,sha256=zJKnQ9YzrMZCTPWis4CdyGCAH0kzT4m1OHE74jiF0jA,28800
|
|
12
12
|
parallel/_streaming.py,sha256=vH45vK3-83ruFalbvSgpE70zfwy8fjW9UwrO1TwjIfE,10108
|
|
13
13
|
parallel/_types.py,sha256=ohdaBqcsvcZ14iBOJ8Tuv752Fzq-0lFSwCfTSgI-aIw,7238
|
|
14
|
-
parallel/_version.py,sha256=
|
|
14
|
+
parallel/_version.py,sha256=xYX02JmdjutuoQ6gHAdHV4B-KgE_nEjs_OeLxVZv5sY,160
|
|
15
15
|
parallel/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
parallel/_utils/__init__.py,sha256=hQbbbshrJaj0DuLIvbvdLvCujBMzJ827P_CXVR1VosY,2327
|
|
17
17
|
parallel/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -35,7 +35,7 @@ parallel/lib/_parsing/_task_spec.py,sha256=-yiyR88IqZJwuGtLwlLFikrB-w8pLc0wAysp4
|
|
|
35
35
|
parallel/resources/__init__.py,sha256=PAnsvK_p1MHcu1XIBtyktNzkS60ata-K4YFXcVZ43ps,990
|
|
36
36
|
parallel/resources/task_run.py,sha256=K600WuHJ5AesKtb3EG17FOi49GEDGzlHRuwBm2sL7Bs,26504
|
|
37
37
|
parallel/resources/beta/__init__.py,sha256=7vguQhQFwL7SfwgJKziGU_cmz6qyh7IRucNpw6-GTz8,1480
|
|
38
|
-
parallel/resources/beta/beta.py,sha256=
|
|
38
|
+
parallel/resources/beta/beta.py,sha256=8yrSIUfK9_FNiLMRcnNoNLlvPGyXtFNbdQwrfOwZZgY,18947
|
|
39
39
|
parallel/resources/beta/task_group.py,sha256=YekGyy06oAS2KkrOLcQXkN4GRMNdBwL8qMFN1Eh5VLA,26404
|
|
40
40
|
parallel/resources/beta/task_run.py,sha256=UHw1HReVKGcsMqYprcFarNMZdMvXFDRJoUKyDvoMypo,20726
|
|
41
41
|
parallel/types/__init__.py,sha256=VmaNWhKOnMNn-p9RvktHNEB9nKL_w3QSoQQx1z_ORIc,1302
|
|
@@ -56,12 +56,18 @@ parallel/types/task_spec.py,sha256=ZMV1G3G9Ap70MxrqqClq2XmvPmhw5DLHJQ7rFKv1SdI,1
|
|
|
56
56
|
parallel/types/task_spec_param.py,sha256=fmz30Re2VvtDp_O14o3jQZtI_Yl7l1mzObi_AK-iDbU,1243
|
|
57
57
|
parallel/types/text_schema.py,sha256=QLOILH4KqVTVpFkilnFQxjUHWSd2F4glbeJC0GMEseU,450
|
|
58
58
|
parallel/types/text_schema_param.py,sha256=N1YQnxEbgjMZJF-3SPZdTDouDmN06aektgC6NfP9BPk,463
|
|
59
|
-
parallel/types/beta/__init__.py,sha256=
|
|
59
|
+
parallel/types/beta/__init__.py,sha256=txIrZWzp-elxn1oKzhlLq2Ek47vnxvWKB14gzbZFZek,2330
|
|
60
|
+
parallel/types/beta/beta_extract_params.py,sha256=yN4hUoN-FC-XQmm_3tRSTBxWYBHsd3qG-yTUK_tZeX0,2111
|
|
60
61
|
parallel/types/beta/beta_run_input.py,sha256=-Bq2ksQiuRsEGrMvbIyNza-6qKEeu3fhZfo7Uam6pi8,2281
|
|
61
62
|
parallel/types/beta/beta_run_input_param.py,sha256=6vyv9FHUJ8q_hp6Icghzm2smP2kl-YkVSpF97r9m7ec,2398
|
|
62
|
-
parallel/types/beta/beta_search_params.py,sha256=
|
|
63
|
+
parallel/types/beta/beta_search_params.py,sha256=fSYhWsAPuh_ZH4RYZZn2dDn2j74XxdLBwjUE67qAd7c,1679
|
|
63
64
|
parallel/types/beta/beta_task_run_result.py,sha256=F-I86i3O2B_6pxT8YxnfPg0yRvHqAGEbwWrDZk9BjDY,2007
|
|
64
65
|
parallel/types/beta/error_event.py,sha256=qtBTtkqWp6mhvHJPw-Z7qkENaH8XZOZUzHOqivRKZ5A,379
|
|
66
|
+
parallel/types/beta/excerpt_settings_param.py,sha256=qc6A_g-egZVI0loX7sUtsZIR05WbrCsrXgVCT_IsO1Y,547
|
|
67
|
+
parallel/types/beta/extract_error.py,sha256=19XCPu2POp9CWAF5HkceCjXR0RmEyKFZxlsfjmgOeJw,456
|
|
68
|
+
parallel/types/beta/extract_response.py,sha256=jZ5b91iFaHhcpXG-EdzJl3NGv1ARSBp3zQu4y9Vdrvo,557
|
|
69
|
+
parallel/types/beta/extract_result.py,sha256=7l13HHXZKEr4EPc2cRD0mtsT6CB7-hqMQf4lgAnF7DY,632
|
|
70
|
+
parallel/types/beta/fetch_policy_param.py,sha256=DRMDjPEesNEe-TG5eo68jSzSldxcZjj9g9e7tVov8mo,1027
|
|
65
71
|
parallel/types/beta/mcp_server.py,sha256=BHmXfmV0odaB8xveYHMTbAEE_SVff9l-ObQxxjsImCI,636
|
|
66
72
|
parallel/types/beta/mcp_server_param.py,sha256=x7LAisuTkYT034yVGNmz73I0SUQPyLHjXodsAZfR0v8,713
|
|
67
73
|
parallel/types/beta/mcp_tool_call.py,sha256=yx8Er1bfGahyxfZhhkrHFO5ymdjl2qf4zDnCjg2P4y0,632
|
|
@@ -90,7 +96,7 @@ parallel/types/shared/source_policy.py,sha256=0E_avIRbTe_frkfVpaiuwACdp3LQ2EviAq
|
|
|
90
96
|
parallel/types/shared/warning.py,sha256=QeJ5lJ-ZwkjbVmcc1wusx67O2amMXtm8Y9KxFM0USp0,594
|
|
91
97
|
parallel/types/shared_params/__init__.py,sha256=nleCwf-4RjZtFXe7BaN5aFrrFnUmqZMMs9oeDajqn3g,143
|
|
92
98
|
parallel/types/shared_params/source_policy.py,sha256=sz9YMyjgK5meQ-GZakajIrR1UrLKA7qOHmhGdq393h0,606
|
|
93
|
-
parallel_web-0.
|
|
94
|
-
parallel_web-0.
|
|
95
|
-
parallel_web-0.
|
|
96
|
-
parallel_web-0.
|
|
99
|
+
parallel_web-0.3.1.dist-info/METADATA,sha256=wbIzajhxn5LLGpALsS2CdiVeDv8IPbPJBlbvSw9LT0w,16173
|
|
100
|
+
parallel_web-0.3.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
101
|
+
parallel_web-0.3.1.dist-info/licenses/LICENSE,sha256=1rFsV0HhxaZBP55JM8Cu2w0Bw-uxTFtyTja_DE94oEM,1048
|
|
102
|
+
parallel_web-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|