parallel-web 0.2.2__py3-none-any.whl → 0.3.0__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 +179 -5
- parallel/types/beta/__init__.py +5 -0
- parallel/types/beta/beta_extract_params.py +85 -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_web-0.2.2.dist-info → parallel_web-0.3.0.dist-info}/METADATA +2 -2
- {parallel_web-0.2.2.dist-info → parallel_web-0.3.0.dist-info}/RECORD +13 -8
- {parallel_web-0.2.2.dist-info → parallel_web-0.3.0.dist-info}/WHEEL +0 -0
- {parallel_web-0.2.2.dist-info → parallel_web-0.3.0.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,11 @@ 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.parallel_beta_param import ParallelBetaParam
|
|
39
41
|
from ...types.shared_params.source_policy import SourcePolicy
|
|
40
42
|
|
|
41
43
|
__all__ = ["BetaResource", "AsyncBetaResource"]
|
|
@@ -69,15 +71,89 @@ class BetaResource(SyncAPIResource):
|
|
|
69
71
|
"""
|
|
70
72
|
return BetaResourceWithStreamingResponse(self)
|
|
71
73
|
|
|
74
|
+
def extract(
|
|
75
|
+
self,
|
|
76
|
+
*,
|
|
77
|
+
urls: SequenceNotStr[str],
|
|
78
|
+
excerpts: beta_extract_params.Excerpts | Omit = omit,
|
|
79
|
+
fetch_policy: Optional[beta_extract_params.FetchPolicy] | Omit = omit,
|
|
80
|
+
full_content: beta_extract_params.FullContent | Omit = omit,
|
|
81
|
+
objective: Optional[str] | Omit = omit,
|
|
82
|
+
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
83
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
84
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
85
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
86
|
+
extra_headers: Headers | None = None,
|
|
87
|
+
extra_query: Query | None = None,
|
|
88
|
+
extra_body: Body | None = None,
|
|
89
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
90
|
+
) -> ExtractResponse:
|
|
91
|
+
"""
|
|
92
|
+
Extracts relevant content from specific web URLs.
|
|
93
|
+
|
|
94
|
+
To access this endpoint, pass the `parallel-beta` header with the value
|
|
95
|
+
`search-extract-2025-10-10`.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
excerpts: Include excerpts from each URL relevant to the search objective and queries.
|
|
99
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
100
|
+
redundant with full content.
|
|
101
|
+
|
|
102
|
+
fetch_policy: Fetch policy.
|
|
103
|
+
|
|
104
|
+
Determines when to return content from the cache (faster) vs fetching live
|
|
105
|
+
content (fresher).
|
|
106
|
+
|
|
107
|
+
full_content: Include full content from each URL. Note that if neither objective nor
|
|
108
|
+
search_queries is provided, excerpts are redundant with full content.
|
|
109
|
+
|
|
110
|
+
objective: If provided, focuses extracted content on the specified search objective.
|
|
111
|
+
|
|
112
|
+
search_queries: If provided, focuses extracted content on the specified keyword search queries.
|
|
113
|
+
|
|
114
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
115
|
+
|
|
116
|
+
extra_headers: Send extra headers
|
|
117
|
+
|
|
118
|
+
extra_query: Add additional query parameters to the request
|
|
119
|
+
|
|
120
|
+
extra_body: Add additional JSON properties to the request
|
|
121
|
+
|
|
122
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
123
|
+
"""
|
|
124
|
+
extra_headers = {
|
|
125
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
126
|
+
**(extra_headers or {}),
|
|
127
|
+
}
|
|
128
|
+
return self._post(
|
|
129
|
+
"/v1beta/extract",
|
|
130
|
+
body=maybe_transform(
|
|
131
|
+
{
|
|
132
|
+
"urls": urls,
|
|
133
|
+
"excerpts": excerpts,
|
|
134
|
+
"fetch_policy": fetch_policy,
|
|
135
|
+
"full_content": full_content,
|
|
136
|
+
"objective": objective,
|
|
137
|
+
"search_queries": search_queries,
|
|
138
|
+
},
|
|
139
|
+
beta_extract_params.BetaExtractParams,
|
|
140
|
+
),
|
|
141
|
+
options=make_request_options(
|
|
142
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
143
|
+
),
|
|
144
|
+
cast_to=ExtractResponse,
|
|
145
|
+
)
|
|
146
|
+
|
|
72
147
|
def search(
|
|
73
148
|
self,
|
|
74
149
|
*,
|
|
75
150
|
max_chars_per_result: Optional[int] | Omit = omit,
|
|
76
151
|
max_results: Optional[int] | Omit = omit,
|
|
77
152
|
objective: Optional[str] | Omit = omit,
|
|
78
|
-
processor: Literal["base", "pro"] | Omit = omit,
|
|
153
|
+
processor: Optional[Literal["base", "pro"]] | Omit = omit,
|
|
79
154
|
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
80
155
|
source_policy: Optional[SourcePolicy] | Omit = omit,
|
|
156
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
81
157
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
82
158
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
83
159
|
extra_headers: Headers | None = None,
|
|
@@ -109,6 +185,8 @@ class BetaResource(SyncAPIResource):
|
|
|
109
185
|
|
|
110
186
|
This policy governs which sources are allowed/disallowed in results.
|
|
111
187
|
|
|
188
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
189
|
+
|
|
112
190
|
extra_headers: Send extra headers
|
|
113
191
|
|
|
114
192
|
extra_query: Add additional query parameters to the request
|
|
@@ -117,6 +195,10 @@ class BetaResource(SyncAPIResource):
|
|
|
117
195
|
|
|
118
196
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
119
197
|
"""
|
|
198
|
+
extra_headers = {
|
|
199
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
200
|
+
**(extra_headers or {}),
|
|
201
|
+
}
|
|
120
202
|
return self._post(
|
|
121
203
|
"/v1beta/search",
|
|
122
204
|
body=maybe_transform(
|
|
@@ -165,15 +247,89 @@ class AsyncBetaResource(AsyncAPIResource):
|
|
|
165
247
|
"""
|
|
166
248
|
return AsyncBetaResourceWithStreamingResponse(self)
|
|
167
249
|
|
|
250
|
+
async def extract(
|
|
251
|
+
self,
|
|
252
|
+
*,
|
|
253
|
+
urls: SequenceNotStr[str],
|
|
254
|
+
excerpts: beta_extract_params.Excerpts | Omit = omit,
|
|
255
|
+
fetch_policy: Optional[beta_extract_params.FetchPolicy] | Omit = omit,
|
|
256
|
+
full_content: beta_extract_params.FullContent | Omit = omit,
|
|
257
|
+
objective: Optional[str] | Omit = omit,
|
|
258
|
+
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
259
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
260
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
261
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
262
|
+
extra_headers: Headers | None = None,
|
|
263
|
+
extra_query: Query | None = None,
|
|
264
|
+
extra_body: Body | None = None,
|
|
265
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
266
|
+
) -> ExtractResponse:
|
|
267
|
+
"""
|
|
268
|
+
Extracts relevant content from specific web URLs.
|
|
269
|
+
|
|
270
|
+
To access this endpoint, pass the `parallel-beta` header with the value
|
|
271
|
+
`search-extract-2025-10-10`.
|
|
272
|
+
|
|
273
|
+
Args:
|
|
274
|
+
excerpts: Include excerpts from each URL relevant to the search objective and queries.
|
|
275
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
276
|
+
redundant with full content.
|
|
277
|
+
|
|
278
|
+
fetch_policy: Fetch policy.
|
|
279
|
+
|
|
280
|
+
Determines when to return content from the cache (faster) vs fetching live
|
|
281
|
+
content (fresher).
|
|
282
|
+
|
|
283
|
+
full_content: Include full content from each URL. Note that if neither objective nor
|
|
284
|
+
search_queries is provided, excerpts are redundant with full content.
|
|
285
|
+
|
|
286
|
+
objective: If provided, focuses extracted content on the specified search objective.
|
|
287
|
+
|
|
288
|
+
search_queries: If provided, focuses extracted content on the specified keyword search queries.
|
|
289
|
+
|
|
290
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
291
|
+
|
|
292
|
+
extra_headers: Send extra headers
|
|
293
|
+
|
|
294
|
+
extra_query: Add additional query parameters to the request
|
|
295
|
+
|
|
296
|
+
extra_body: Add additional JSON properties to the request
|
|
297
|
+
|
|
298
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
299
|
+
"""
|
|
300
|
+
extra_headers = {
|
|
301
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
302
|
+
**(extra_headers or {}),
|
|
303
|
+
}
|
|
304
|
+
return await self._post(
|
|
305
|
+
"/v1beta/extract",
|
|
306
|
+
body=await async_maybe_transform(
|
|
307
|
+
{
|
|
308
|
+
"urls": urls,
|
|
309
|
+
"excerpts": excerpts,
|
|
310
|
+
"fetch_policy": fetch_policy,
|
|
311
|
+
"full_content": full_content,
|
|
312
|
+
"objective": objective,
|
|
313
|
+
"search_queries": search_queries,
|
|
314
|
+
},
|
|
315
|
+
beta_extract_params.BetaExtractParams,
|
|
316
|
+
),
|
|
317
|
+
options=make_request_options(
|
|
318
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
319
|
+
),
|
|
320
|
+
cast_to=ExtractResponse,
|
|
321
|
+
)
|
|
322
|
+
|
|
168
323
|
async def search(
|
|
169
324
|
self,
|
|
170
325
|
*,
|
|
171
326
|
max_chars_per_result: Optional[int] | Omit = omit,
|
|
172
327
|
max_results: Optional[int] | Omit = omit,
|
|
173
328
|
objective: Optional[str] | Omit = omit,
|
|
174
|
-
processor: Literal["base", "pro"] | Omit = omit,
|
|
329
|
+
processor: Optional[Literal["base", "pro"]] | Omit = omit,
|
|
175
330
|
search_queries: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
176
331
|
source_policy: Optional[SourcePolicy] | Omit = omit,
|
|
332
|
+
betas: List[ParallelBetaParam] | Omit = omit,
|
|
177
333
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
178
334
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
179
335
|
extra_headers: Headers | None = None,
|
|
@@ -205,6 +361,8 @@ class AsyncBetaResource(AsyncAPIResource):
|
|
|
205
361
|
|
|
206
362
|
This policy governs which sources are allowed/disallowed in results.
|
|
207
363
|
|
|
364
|
+
betas: Optional header to specify the beta version(s) to enable.
|
|
365
|
+
|
|
208
366
|
extra_headers: Send extra headers
|
|
209
367
|
|
|
210
368
|
extra_query: Add additional query parameters to the request
|
|
@@ -213,6 +371,10 @@ class AsyncBetaResource(AsyncAPIResource):
|
|
|
213
371
|
|
|
214
372
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
215
373
|
"""
|
|
374
|
+
extra_headers = {
|
|
375
|
+
**strip_not_given({"parallel-beta": ",".join(str(e) for e in betas) if is_given(betas) else not_given}),
|
|
376
|
+
**(extra_headers or {}),
|
|
377
|
+
}
|
|
216
378
|
return await self._post(
|
|
217
379
|
"/v1beta/search",
|
|
218
380
|
body=await async_maybe_transform(
|
|
@@ -237,6 +399,9 @@ class BetaResourceWithRawResponse:
|
|
|
237
399
|
def __init__(self, beta: BetaResource) -> None:
|
|
238
400
|
self._beta = beta
|
|
239
401
|
|
|
402
|
+
self.extract = to_raw_response_wrapper(
|
|
403
|
+
beta.extract,
|
|
404
|
+
)
|
|
240
405
|
self.search = to_raw_response_wrapper(
|
|
241
406
|
beta.search,
|
|
242
407
|
)
|
|
@@ -254,6 +419,9 @@ class AsyncBetaResourceWithRawResponse:
|
|
|
254
419
|
def __init__(self, beta: AsyncBetaResource) -> None:
|
|
255
420
|
self._beta = beta
|
|
256
421
|
|
|
422
|
+
self.extract = async_to_raw_response_wrapper(
|
|
423
|
+
beta.extract,
|
|
424
|
+
)
|
|
257
425
|
self.search = async_to_raw_response_wrapper(
|
|
258
426
|
beta.search,
|
|
259
427
|
)
|
|
@@ -271,6 +439,9 @@ class BetaResourceWithStreamingResponse:
|
|
|
271
439
|
def __init__(self, beta: BetaResource) -> None:
|
|
272
440
|
self._beta = beta
|
|
273
441
|
|
|
442
|
+
self.extract = to_streamed_response_wrapper(
|
|
443
|
+
beta.extract,
|
|
444
|
+
)
|
|
274
445
|
self.search = to_streamed_response_wrapper(
|
|
275
446
|
beta.search,
|
|
276
447
|
)
|
|
@@ -288,6 +459,9 @@ class AsyncBetaResourceWithStreamingResponse:
|
|
|
288
459
|
def __init__(self, beta: AsyncBetaResource) -> None:
|
|
289
460
|
self._beta = beta
|
|
290
461
|
|
|
462
|
+
self.extract = async_to_streamed_response_wrapper(
|
|
463
|
+
beta.extract,
|
|
464
|
+
)
|
|
291
465
|
self.search = async_to_streamed_response_wrapper(
|
|
292
466
|
beta.search,
|
|
293
467
|
)
|
parallel/types/beta/__init__.py
CHANGED
|
@@ -6,18 +6,23 @@ 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 .beta_extract_params import BetaExtractParams as BetaExtractParams
|
|
18
22
|
from .parallel_beta_param import ParallelBetaParam as ParallelBetaParam
|
|
19
23
|
from .beta_run_input_param import BetaRunInputParam as BetaRunInputParam
|
|
20
24
|
from .beta_task_run_result import BetaTaskRunResult as BetaTaskRunResult
|
|
25
|
+
from .excerpt_settings_param import ExcerptSettingsParam as ExcerptSettingsParam
|
|
21
26
|
from .task_run_create_params import TaskRunCreateParams as TaskRunCreateParams
|
|
22
27
|
from .task_run_result_params import TaskRunResultParams as TaskRunResultParams
|
|
23
28
|
from .task_group_run_response import TaskGroupRunResponse as TaskGroupRunResponse
|
|
@@ -0,0 +1,85 @@
|
|
|
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 .parallel_beta_param import ParallelBetaParam
|
|
11
|
+
from .excerpt_settings_param import ExcerptSettingsParam
|
|
12
|
+
|
|
13
|
+
__all__ = ["BetaExtractParams", "Excerpts", "FetchPolicy", "FullContent", "FullContentFullContentSettings"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BetaExtractParams(TypedDict, total=False):
|
|
17
|
+
urls: Required[SequenceNotStr[str]]
|
|
18
|
+
|
|
19
|
+
excerpts: Excerpts
|
|
20
|
+
"""Include excerpts from each URL relevant to the search objective and queries.
|
|
21
|
+
|
|
22
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
23
|
+
redundant with full content.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
fetch_policy: Optional[FetchPolicy]
|
|
27
|
+
"""Fetch policy.
|
|
28
|
+
|
|
29
|
+
Determines when to return content from the cache (faster) vs fetching live
|
|
30
|
+
content (fresher).
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
full_content: FullContent
|
|
34
|
+
"""Include full content from each URL.
|
|
35
|
+
|
|
36
|
+
Note that if neither objective nor search_queries is provided, excerpts are
|
|
37
|
+
redundant with full content.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
objective: Optional[str]
|
|
41
|
+
"""If provided, focuses extracted content on the specified search objective."""
|
|
42
|
+
|
|
43
|
+
search_queries: Optional[SequenceNotStr[str]]
|
|
44
|
+
"""If provided, focuses extracted content on the specified keyword search queries."""
|
|
45
|
+
|
|
46
|
+
betas: Annotated[List[ParallelBetaParam], PropertyInfo(alias="parallel-beta")]
|
|
47
|
+
"""Optional header to specify the beta version(s) to enable."""
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
Excerpts: TypeAlias = Union[bool, ExcerptSettingsParam]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class FetchPolicy(TypedDict, total=False):
|
|
54
|
+
disable_cache_fallback: bool
|
|
55
|
+
"""
|
|
56
|
+
If false, fallback to cached content older than max-age if live fetch fails or
|
|
57
|
+
times out. If true, returns an error instead.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
max_age_seconds: Optional[int]
|
|
61
|
+
"""Maximum age of cached content in seconds to trigger a live fetch.
|
|
62
|
+
|
|
63
|
+
Minimum value 600 seconds (10 minutes). If not provided, a dynamic age policy
|
|
64
|
+
will be used based on the search objective and url.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
timeout_seconds: Optional[float]
|
|
68
|
+
"""Timeout in seconds for fetching live content if unavailable in cache.
|
|
69
|
+
|
|
70
|
+
If unspecified a dynamic timeout will be used based on the url, generally 15
|
|
71
|
+
seconds for simple pages and up to 60 seconds for complex pages requiring
|
|
72
|
+
javascript or PDF rendering.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class FullContentFullContentSettings(TypedDict, total=False):
|
|
77
|
+
max_chars_per_result: Optional[int]
|
|
78
|
+
"""
|
|
79
|
+
Optional limit on the number of characters to include in the full content for
|
|
80
|
+
each url. Full content always starts at the beginning of the page and is
|
|
81
|
+
truncated at the limit if necessary.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: parallel-web
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
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=iv1j6vu_rXYatHaC_spPxh4KfLvcwN2u6fOnjpPmIF0,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=dyfztp9SBSgqkz-Tjco4OrIQHGbTxmm_PqTdPbpQfEA,18915
|
|
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,17 @@ 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=ifzxkWDIQx1TfSiNrjZngm4O-tGSDSzY-ws7Vwezg_0,2261
|
|
60
|
+
parallel/types/beta/beta_extract_params.py,sha256=LEV9stilZxEt_cMwt7OEYyXLXy958Utonb0Ddv4xfZI,2871
|
|
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
|
|
65
70
|
parallel/types/beta/mcp_server.py,sha256=BHmXfmV0odaB8xveYHMTbAEE_SVff9l-ObQxxjsImCI,636
|
|
66
71
|
parallel/types/beta/mcp_server_param.py,sha256=x7LAisuTkYT034yVGNmz73I0SUQPyLHjXodsAZfR0v8,713
|
|
67
72
|
parallel/types/beta/mcp_tool_call.py,sha256=yx8Er1bfGahyxfZhhkrHFO5ymdjl2qf4zDnCjg2P4y0,632
|
|
@@ -90,7 +95,7 @@ parallel/types/shared/source_policy.py,sha256=0E_avIRbTe_frkfVpaiuwACdp3LQ2EviAq
|
|
|
90
95
|
parallel/types/shared/warning.py,sha256=QeJ5lJ-ZwkjbVmcc1wusx67O2amMXtm8Y9KxFM0USp0,594
|
|
91
96
|
parallel/types/shared_params/__init__.py,sha256=nleCwf-4RjZtFXe7BaN5aFrrFnUmqZMMs9oeDajqn3g,143
|
|
92
97
|
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.
|
|
98
|
+
parallel_web-0.3.0.dist-info/METADATA,sha256=Nxn2K6fCaqPMiMjlW1eGMP4vTvizXdNlMeiuhjIlt-E,16173
|
|
99
|
+
parallel_web-0.3.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
100
|
+
parallel_web-0.3.0.dist-info/licenses/LICENSE,sha256=1rFsV0HhxaZBP55JM8Cu2w0Bw-uxTFtyTja_DE94oEM,1048
|
|
101
|
+
parallel_web-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|