exa-py 1.14.0__py3-none-any.whl → 1.14.2__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 exa-py might be problematic. Click here for more details.
- exa_py/research/client.py +15 -12
- exa_py/websets/client.py +2 -2
- exa_py/websets/monitors/__init__.py +4 -0
- exa_py/websets/monitors/client.py +96 -0
- exa_py/websets/monitors/runs/__init__.py +3 -0
- exa_py/websets/monitors/runs/client.py +38 -0
- exa_py/websets/types.py +101 -87
- {exa_py-1.14.0.dist-info → exa_py-1.14.2.dist-info}/METADATA +1 -1
- {exa_py-1.14.0.dist-info → exa_py-1.14.2.dist-info}/RECORD +10 -10
- exa_py/websets/streams/__init__.py +0 -4
- exa_py/websets/streams/client.py +0 -96
- exa_py/websets/streams/runs/__init__.py +0 -3
- exa_py/websets/streams/runs/client.py +0 -38
- {exa_py-1.14.0.dist-info → exa_py-1.14.2.dist-info}/WHEEL +0 -0
exa_py/research/client.py
CHANGED
|
@@ -9,7 +9,7 @@ block, but at runtime we only pay the cost if/when a helper is actually used.
|
|
|
9
9
|
|
|
10
10
|
from __future__ import annotations
|
|
11
11
|
|
|
12
|
-
from typing import TYPE_CHECKING, Any, Dict, Optional
|
|
12
|
+
from typing import TYPE_CHECKING, Any, Dict, Optional, Literal
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING: # pragma: no cover – only for static analysers
|
|
15
15
|
# Import with full type info when static type-checking. `_Result` still
|
|
@@ -39,15 +39,20 @@ class ResearchClient:
|
|
|
39
39
|
self,
|
|
40
40
|
*,
|
|
41
41
|
instructions: str,
|
|
42
|
-
model:
|
|
43
|
-
|
|
42
|
+
model: Literal["exa-research", "exa-research-pro"] = "exa-research",
|
|
43
|
+
output_infer_schema: bool = None,
|
|
44
|
+
output_schema: Dict[str, Any] = None,
|
|
44
45
|
) -> "ResearchTaskId":
|
|
45
46
|
"""Submit a research request and return the *task identifier*."""
|
|
46
|
-
payload = {
|
|
47
|
-
|
|
48
|
-
"model"
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
payload = {"instructions": instructions}
|
|
48
|
+
if model is not None:
|
|
49
|
+
payload["model"] = model
|
|
50
|
+
if output_schema is not None or output_infer_schema is not None:
|
|
51
|
+
payload["output"] = {}
|
|
52
|
+
if output_schema is not None:
|
|
53
|
+
payload["output"]["schema"] = output_schema
|
|
54
|
+
if output_infer_schema is not None:
|
|
55
|
+
payload["output"]["inferSchema"] = output_infer_schema
|
|
51
56
|
|
|
52
57
|
raw_response: Dict[str, Any] = self._client.request(
|
|
53
58
|
"/research/v0/tasks", payload
|
|
@@ -64,9 +69,7 @@ class ResearchClient:
|
|
|
64
69
|
|
|
65
70
|
return ResearchTaskId(id=raw_response["id"])
|
|
66
71
|
|
|
67
|
-
def get_task(
|
|
68
|
-
self, id: str
|
|
69
|
-
) -> "ResearchTask": # noqa: D401 – imperative mood is fine
|
|
72
|
+
def get_task(self, id: str) -> "ResearchTask": # noqa: D401 – imperative mood is fine
|
|
70
73
|
"""Fetch the current status / result for a research task."""
|
|
71
74
|
endpoint = f"/research/v0/tasks/{id}"
|
|
72
75
|
|
|
@@ -175,7 +178,7 @@ class AsyncResearchClient:
|
|
|
175
178
|
self,
|
|
176
179
|
*,
|
|
177
180
|
instructions: str,
|
|
178
|
-
model:
|
|
181
|
+
model: Literal["exa-research", "exa-research-pro"] = "exa-research",
|
|
179
182
|
output_schema: Dict[str, Any],
|
|
180
183
|
) -> "ResearchTaskId":
|
|
181
184
|
"""Submit a research request and return the *task identifier* (async)."""
|
exa_py/websets/client.py
CHANGED
|
@@ -16,7 +16,7 @@ from .items import WebsetItemsClient
|
|
|
16
16
|
from .searches import WebsetSearchesClient
|
|
17
17
|
from .enrichments import WebsetEnrichmentsClient
|
|
18
18
|
from .webhooks import WebsetWebhooksClient
|
|
19
|
-
from .
|
|
19
|
+
from .monitors import MonitorsClient
|
|
20
20
|
|
|
21
21
|
class WebsetsClient(WebsetsBaseClient):
|
|
22
22
|
"""Client for managing Websets."""
|
|
@@ -27,7 +27,7 @@ class WebsetsClient(WebsetsBaseClient):
|
|
|
27
27
|
self.searches = WebsetSearchesClient(client)
|
|
28
28
|
self.enrichments = WebsetEnrichmentsClient(client)
|
|
29
29
|
self.webhooks = WebsetWebhooksClient(client)
|
|
30
|
-
self.
|
|
30
|
+
self.monitors = MonitorsClient(client)
|
|
31
31
|
|
|
32
32
|
def create(self, params: Union[Dict[str, Any], CreateWebsetParameters]) -> Webset:
|
|
33
33
|
"""Create a new Webset.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Dict, Any, Union, Optional
|
|
4
|
+
|
|
5
|
+
from ..types import (
|
|
6
|
+
Monitor,
|
|
7
|
+
CreateMonitorParameters,
|
|
8
|
+
UpdateMonitor,
|
|
9
|
+
ListMonitorsResponse,
|
|
10
|
+
)
|
|
11
|
+
from ..core.base import WebsetsBaseClient
|
|
12
|
+
from .runs import MonitorRunsClient
|
|
13
|
+
|
|
14
|
+
class MonitorsClient(WebsetsBaseClient):
|
|
15
|
+
"""Client for managing Monitors."""
|
|
16
|
+
|
|
17
|
+
def __init__(self, client):
|
|
18
|
+
super().__init__(client)
|
|
19
|
+
self.runs = MonitorRunsClient(client)
|
|
20
|
+
|
|
21
|
+
def create(self, params: Union[Dict[str, Any], CreateMonitorParameters]) -> Monitor:
|
|
22
|
+
"""Create a new Monitor to continuously keep your Websets updated with fresh data.
|
|
23
|
+
|
|
24
|
+
Monitors automatically run on your defined schedule to ensure your Websets stay current without manual intervention:
|
|
25
|
+
- Find new content: Execute search operations to discover fresh items matching your criteria
|
|
26
|
+
- Update existing content: Run refresh operations to update items contents and enrichments
|
|
27
|
+
- Automated scheduling: Configure frequency, timezone, and execution times
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
params (CreateMonitorParameters): The parameters for creating a monitor.
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
Monitor: The created monitor.
|
|
34
|
+
"""
|
|
35
|
+
response = self.request("/v0/monitors", data=params)
|
|
36
|
+
return Monitor.model_validate(response)
|
|
37
|
+
|
|
38
|
+
def get(self, monitor_id: str) -> Monitor:
|
|
39
|
+
"""Get a specific monitor.
|
|
40
|
+
|
|
41
|
+
Args:
|
|
42
|
+
monitor_id (str): The id of the Monitor.
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
Monitor: The retrieved monitor.
|
|
46
|
+
"""
|
|
47
|
+
response = self.request(f"/v0/monitors/{monitor_id}", method="GET")
|
|
48
|
+
return Monitor.model_validate(response)
|
|
49
|
+
|
|
50
|
+
def list(self, *, cursor: Optional[str] = None, limit: Optional[int] = None, webset_id: Optional[str] = None) -> ListMonitorsResponse:
|
|
51
|
+
"""List all monitors.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
cursor (str, optional): The cursor to paginate through the results.
|
|
55
|
+
limit (int, optional): The number of results to return (1-200, default 25).
|
|
56
|
+
webset_id (str, optional): The id of the Webset to list monitors for.
|
|
57
|
+
|
|
58
|
+
Returns:
|
|
59
|
+
ListMonitorsResponse: List of monitors with pagination info.
|
|
60
|
+
"""
|
|
61
|
+
params = {
|
|
62
|
+
k: v
|
|
63
|
+
for k, v in {
|
|
64
|
+
"cursor": cursor,
|
|
65
|
+
"limit": limit,
|
|
66
|
+
"websetId": webset_id
|
|
67
|
+
}.items()
|
|
68
|
+
if v is not None
|
|
69
|
+
}
|
|
70
|
+
response = self.request("/v0/monitors", params=params, method="GET")
|
|
71
|
+
return ListMonitorsResponse.model_validate(response)
|
|
72
|
+
|
|
73
|
+
def update(self, monitor_id: str, params: Union[Dict[str, Any], UpdateMonitor]) -> Monitor:
|
|
74
|
+
"""Update a monitor configuration.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
monitor_id (str): The id of the Monitor.
|
|
78
|
+
params (UpdateMonitor): The parameters for updating a monitor.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
Monitor: The updated monitor.
|
|
82
|
+
"""
|
|
83
|
+
response = self.request(f"/v0/monitors/{monitor_id}", data=params, method="PATCH")
|
|
84
|
+
return Monitor.model_validate(response)
|
|
85
|
+
|
|
86
|
+
def delete(self, monitor_id: str) -> Monitor:
|
|
87
|
+
"""Delete a monitor.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
monitor_id (str): The id of the Monitor.
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Monitor: The deleted monitor.
|
|
94
|
+
"""
|
|
95
|
+
response = self.request(f"/v0/monitors/{monitor_id}", method="DELETE")
|
|
96
|
+
return Monitor.model_validate(response)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from ...types import (
|
|
4
|
+
MonitorRun,
|
|
5
|
+
ListMonitorRunsResponse,
|
|
6
|
+
)
|
|
7
|
+
from ...core.base import WebsetsBaseClient
|
|
8
|
+
|
|
9
|
+
class MonitorRunsClient(WebsetsBaseClient):
|
|
10
|
+
"""Client for managing Monitor Runs."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, client):
|
|
13
|
+
super().__init__(client)
|
|
14
|
+
|
|
15
|
+
def list(self, monitor_id: str) -> ListMonitorRunsResponse:
|
|
16
|
+
"""List all runs for the Monitor.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
monitor_id (str): The id of the Monitor to list runs for.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
ListMonitorRunsResponse: List of monitor runs.
|
|
23
|
+
"""
|
|
24
|
+
response = self.request(f"/v0/monitors/{monitor_id}/runs", method="GET")
|
|
25
|
+
return ListMonitorRunsResponse.model_validate(response)
|
|
26
|
+
|
|
27
|
+
def get(self, monitor_id: str, run_id: str) -> MonitorRun:
|
|
28
|
+
"""Get a specific monitor run.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
monitor_id (str): The id of the Monitor to get the run for.
|
|
32
|
+
run_id (str): The id of the monitor run.
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
MonitorRun: The monitor run details.
|
|
36
|
+
"""
|
|
37
|
+
response = self.request(f"/v0/monitors/{monitor_id}/runs/{run_id}", method="GET")
|
|
38
|
+
return MonitorRun.model_validate(response)
|
exa_py/websets/types.py
CHANGED
|
@@ -11,7 +11,7 @@ from typing import Any, Dict, List, Literal, Optional, Union
|
|
|
11
11
|
from pydantic import AnyUrl, Field, PositiveInt, confloat, constr
|
|
12
12
|
from .core.base import ExaBaseModel
|
|
13
13
|
|
|
14
|
-
class
|
|
14
|
+
class MonitorBehaviorSearchConfig(ExaBaseModel):
|
|
15
15
|
query: constr(min_length=2, max_length=10000)
|
|
16
16
|
criteria: List[SearchCriterion] = Field(..., max_items=5)
|
|
17
17
|
entity: Union[
|
|
@@ -59,20 +59,20 @@ class CreateEnrichmentParameters(ExaBaseModel):
|
|
|
59
59
|
"""
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
class
|
|
62
|
+
class CreateMonitorParameters(ExaBaseModel):
|
|
63
63
|
webset_id: str = Field(..., alias='websetId')
|
|
64
64
|
"""
|
|
65
65
|
The id of the Webset
|
|
66
66
|
"""
|
|
67
|
-
cadence:
|
|
67
|
+
cadence: MonitorCadence
|
|
68
68
|
"""
|
|
69
|
-
How often the
|
|
69
|
+
How often the monitor will run
|
|
70
70
|
"""
|
|
71
|
-
behavior: Union[
|
|
71
|
+
behavior: Union[MonitorBehaviorSearch, MonitorBehaviorRefresh] = Field(
|
|
72
72
|
..., discriminator='type'
|
|
73
73
|
)
|
|
74
74
|
"""
|
|
75
|
-
Behavior to perform when
|
|
75
|
+
Behavior to perform when monitor runs
|
|
76
76
|
"""
|
|
77
77
|
metadata: Optional[Dict[str, Any]] = None
|
|
78
78
|
|
|
@@ -198,11 +198,11 @@ class EnrichmentResult(ExaBaseModel):
|
|
|
198
198
|
"""
|
|
199
199
|
enrichment_id: str = Field(..., alias='enrichmentId')
|
|
200
200
|
"""
|
|
201
|
-
The
|
|
201
|
+
The unique identifier for the enrichment
|
|
202
202
|
"""
|
|
203
203
|
|
|
204
204
|
|
|
205
|
-
class
|
|
205
|
+
class MonitorRefreshBehaviorEnrichmentsConfigEnrichments(ExaBaseModel):
|
|
206
206
|
"""
|
|
207
207
|
Only refresh specific enrichments
|
|
208
208
|
"""
|
|
@@ -224,6 +224,7 @@ class EventType(Enum):
|
|
|
224
224
|
webset_item_created = 'webset.item.created'
|
|
225
225
|
webset_item_enriched = 'webset.item.enriched'
|
|
226
226
|
|
|
227
|
+
|
|
227
228
|
class Format(Enum):
|
|
228
229
|
"""
|
|
229
230
|
Format of the enrichment response.
|
|
@@ -263,14 +264,14 @@ class ListEventsResponse(ExaBaseModel):
|
|
|
263
264
|
"""
|
|
264
265
|
next_cursor: Optional[str] = Field(None, alias='nextCursor')
|
|
265
266
|
"""
|
|
266
|
-
The cursor to
|
|
267
|
+
The cursor to use for the next page of results
|
|
267
268
|
"""
|
|
268
269
|
|
|
269
270
|
|
|
270
|
-
class
|
|
271
|
-
data: List[
|
|
271
|
+
class ListMonitorRunsResponse(ExaBaseModel):
|
|
272
|
+
data: List[MonitorRun]
|
|
272
273
|
"""
|
|
273
|
-
The list of
|
|
274
|
+
The list of monitor runs
|
|
274
275
|
"""
|
|
275
276
|
has_more: bool = Field(..., alias='hasMore')
|
|
276
277
|
"""
|
|
@@ -278,14 +279,14 @@ class ListStreamRunsResponse(ExaBaseModel):
|
|
|
278
279
|
"""
|
|
279
280
|
next_cursor: Optional[str] = Field(None, alias='nextCursor')
|
|
280
281
|
"""
|
|
281
|
-
The cursor to
|
|
282
|
+
The cursor to use for the next page of results
|
|
282
283
|
"""
|
|
283
284
|
|
|
284
285
|
|
|
285
|
-
class
|
|
286
|
-
data: List[
|
|
286
|
+
class ListMonitorsResponse(ExaBaseModel):
|
|
287
|
+
data: List[Monitor]
|
|
287
288
|
"""
|
|
288
|
-
The list of
|
|
289
|
+
The list of monitors
|
|
289
290
|
"""
|
|
290
291
|
has_more: bool = Field(..., alias='hasMore')
|
|
291
292
|
"""
|
|
@@ -293,7 +294,7 @@ class ListStreamsResponse(ExaBaseModel):
|
|
|
293
294
|
"""
|
|
294
295
|
next_cursor: Optional[str] = Field(None, alias='nextCursor')
|
|
295
296
|
"""
|
|
296
|
-
The cursor to
|
|
297
|
+
The cursor to use for the next page of results
|
|
297
298
|
"""
|
|
298
299
|
|
|
299
300
|
|
|
@@ -308,7 +309,7 @@ class ListWebhookAttemptsResponse(ExaBaseModel):
|
|
|
308
309
|
"""
|
|
309
310
|
next_cursor: Optional[str] = Field(None, alias='nextCursor')
|
|
310
311
|
"""
|
|
311
|
-
The cursor to
|
|
312
|
+
The cursor to use for the next page of results
|
|
312
313
|
"""
|
|
313
314
|
|
|
314
315
|
|
|
@@ -323,7 +324,7 @@ class ListWebhooksResponse(ExaBaseModel):
|
|
|
323
324
|
"""
|
|
324
325
|
next_cursor: Optional[str] = Field(None, alias='nextCursor')
|
|
325
326
|
"""
|
|
326
|
-
The cursor to
|
|
327
|
+
The cursor to use for the next page of results
|
|
327
328
|
"""
|
|
328
329
|
|
|
329
330
|
|
|
@@ -338,7 +339,7 @@ class ListWebsetItemResponse(ExaBaseModel):
|
|
|
338
339
|
"""
|
|
339
340
|
next_cursor: Optional[str] = Field(None, alias='nextCursor')
|
|
340
341
|
"""
|
|
341
|
-
The cursor to
|
|
342
|
+
The cursor to use for the next page of results
|
|
342
343
|
"""
|
|
343
344
|
|
|
344
345
|
|
|
@@ -353,15 +354,17 @@ class ListWebsetsResponse(ExaBaseModel):
|
|
|
353
354
|
"""
|
|
354
355
|
next_cursor: Optional[str] = Field(None, alias='nextCursor')
|
|
355
356
|
"""
|
|
356
|
-
The cursor to
|
|
357
|
+
The cursor to use for the next page of results
|
|
357
358
|
"""
|
|
358
359
|
|
|
360
|
+
|
|
359
361
|
class Option(ExaBaseModel):
|
|
360
362
|
label: str
|
|
361
363
|
"""
|
|
362
364
|
The label of the option
|
|
363
365
|
"""
|
|
364
366
|
|
|
367
|
+
|
|
365
368
|
class Progress(ExaBaseModel):
|
|
366
369
|
"""
|
|
367
370
|
The progress of the search
|
|
@@ -446,7 +449,7 @@ class CreateWebsetParametersSearch(ExaBaseModel):
|
|
|
446
449
|
"""
|
|
447
450
|
Criteria every item is evaluated against.
|
|
448
451
|
|
|
449
|
-
It's not required to provide your own criteria, we automatically detect the criteria from all the information provided in the query.
|
|
452
|
+
It's not required to provide your own criteria, we automatically detect the criteria from all the information provided in the query.
|
|
450
453
|
"""
|
|
451
454
|
|
|
452
455
|
|
|
@@ -459,9 +462,9 @@ class Source(Enum):
|
|
|
459
462
|
import_ = 'import'
|
|
460
463
|
|
|
461
464
|
|
|
462
|
-
class
|
|
465
|
+
class MonitorRunStatus(Enum):
|
|
463
466
|
"""
|
|
464
|
-
The status of the
|
|
467
|
+
The status of the Monitor Run
|
|
465
468
|
"""
|
|
466
469
|
|
|
467
470
|
created = 'created'
|
|
@@ -470,45 +473,45 @@ class StreamRunStatus(Enum):
|
|
|
470
473
|
canceled = 'canceled'
|
|
471
474
|
|
|
472
475
|
|
|
473
|
-
class
|
|
476
|
+
class MonitorStatus(Enum):
|
|
474
477
|
"""
|
|
475
|
-
The status of the
|
|
478
|
+
The status of the Monitor
|
|
476
479
|
"""
|
|
477
480
|
|
|
478
|
-
|
|
479
|
-
|
|
481
|
+
enabled = 'enabled'
|
|
482
|
+
disabled = 'disabled'
|
|
480
483
|
|
|
481
484
|
|
|
482
|
-
class
|
|
485
|
+
class Monitor(ExaBaseModel):
|
|
483
486
|
id: str
|
|
484
487
|
"""
|
|
485
|
-
The unique identifier for the
|
|
488
|
+
The unique identifier for the Monitor
|
|
486
489
|
"""
|
|
487
|
-
object: str = '
|
|
490
|
+
object: str = 'monitor'
|
|
488
491
|
"""
|
|
489
492
|
The type of object
|
|
490
493
|
"""
|
|
491
|
-
status:
|
|
494
|
+
status: MonitorStatus
|
|
492
495
|
"""
|
|
493
|
-
The status of the
|
|
496
|
+
The status of the Monitor
|
|
494
497
|
"""
|
|
495
498
|
webset_id: str = Field(..., alias='websetId')
|
|
496
499
|
"""
|
|
497
|
-
The id of the Webset the
|
|
500
|
+
The id of the Webset the Monitor belongs to
|
|
498
501
|
"""
|
|
499
|
-
cadence:
|
|
502
|
+
cadence: MonitorCadence
|
|
500
503
|
"""
|
|
501
|
-
How often the
|
|
504
|
+
How often the monitor will run
|
|
502
505
|
"""
|
|
503
|
-
behavior: Union[
|
|
506
|
+
behavior: Union[MonitorBehaviorSearch, MonitorBehaviorRefresh] = Field(
|
|
504
507
|
..., discriminator='type'
|
|
505
508
|
)
|
|
506
509
|
"""
|
|
507
|
-
Behavior to perform when
|
|
510
|
+
Behavior to perform when monitor runs
|
|
508
511
|
"""
|
|
509
|
-
last_run: Optional[
|
|
512
|
+
last_run: Optional[MonitorRun] = Field(None, alias='lastRun', title='MonitorRun')
|
|
510
513
|
"""
|
|
511
|
-
The last run of the
|
|
514
|
+
The last run of the monitor
|
|
512
515
|
"""
|
|
513
516
|
next_run_at: Optional[datetime] = Field(None, alias='nextRunAt')
|
|
514
517
|
"""
|
|
@@ -520,72 +523,66 @@ class Stream(ExaBaseModel):
|
|
|
520
523
|
"""
|
|
521
524
|
created_at: datetime = Field(..., alias='createdAt')
|
|
522
525
|
"""
|
|
523
|
-
When the
|
|
526
|
+
When the monitor was created
|
|
524
527
|
"""
|
|
525
528
|
updated_at: datetime = Field(..., alias='updatedAt')
|
|
526
529
|
"""
|
|
527
|
-
When the
|
|
530
|
+
When the monitor was last updated
|
|
528
531
|
"""
|
|
529
532
|
|
|
530
533
|
|
|
531
|
-
class
|
|
534
|
+
class MonitorBehaviorRefresh(ExaBaseModel):
|
|
532
535
|
type: Literal['refresh']
|
|
533
536
|
config: Union[
|
|
534
|
-
|
|
537
|
+
MonitorRefreshBehaviorEnrichmentsConfig, MonitorRefreshBehaviorContentsConfig
|
|
535
538
|
] = Field(..., discriminator='target')
|
|
536
|
-
"""
|
|
537
|
-
Specify the target of the refresh
|
|
538
|
-
"""
|
|
539
539
|
|
|
540
540
|
|
|
541
|
-
class
|
|
541
|
+
class MonitorBehaviorSearch(ExaBaseModel):
|
|
542
542
|
type: Literal['search']
|
|
543
|
-
config:
|
|
543
|
+
config: MonitorBehaviorSearchConfig
|
|
544
544
|
|
|
545
545
|
|
|
546
|
-
class
|
|
546
|
+
class MonitorCadence(ExaBaseModel):
|
|
547
547
|
cron: str
|
|
548
548
|
"""
|
|
549
|
-
Cron expression for
|
|
549
|
+
Cron expression for monitor cadence (must be a valid Unix cron with 5 fields). The schedule must trigger at most once per day.
|
|
550
550
|
"""
|
|
551
551
|
timezone: Optional[str] = 'Etc/UTC'
|
|
552
552
|
"""
|
|
553
|
-
|
|
553
|
+
Timezone for the cron expression
|
|
554
554
|
"""
|
|
555
555
|
|
|
556
556
|
|
|
557
|
-
class
|
|
557
|
+
class MonitorRefreshBehaviorContentsConfig(ExaBaseModel):
|
|
558
558
|
target: Literal['contents']
|
|
559
559
|
|
|
560
560
|
|
|
561
|
-
class
|
|
561
|
+
class MonitorRefreshBehaviorEnrichmentsConfig(ExaBaseModel):
|
|
562
562
|
target: Literal['enrichments']
|
|
563
|
-
enrichments: Optional[
|
|
564
|
-
"""
|
|
565
|
-
Only refresh specific enrichments
|
|
566
|
-
"""
|
|
563
|
+
enrichments: Optional[MonitorRefreshBehaviorEnrichmentsConfigEnrichments] = None
|
|
567
564
|
|
|
568
565
|
|
|
569
|
-
class
|
|
566
|
+
class MonitorRun(ExaBaseModel):
|
|
570
567
|
id: str
|
|
571
568
|
"""
|
|
572
|
-
The unique identifier for the
|
|
569
|
+
The unique identifier for the Monitor Run
|
|
573
570
|
"""
|
|
574
|
-
object: str = '
|
|
571
|
+
object: str = 'monitor_run'
|
|
575
572
|
"""
|
|
576
573
|
The type of object
|
|
577
574
|
"""
|
|
578
|
-
status:
|
|
575
|
+
status: MonitorRunStatus
|
|
579
576
|
"""
|
|
580
|
-
The status of the
|
|
577
|
+
The status of the Monitor Run
|
|
581
578
|
"""
|
|
582
|
-
|
|
579
|
+
monitor_id: str = Field(..., alias='monitorId')
|
|
583
580
|
"""
|
|
584
|
-
The
|
|
581
|
+
The monitor that the run is associated with
|
|
585
582
|
"""
|
|
586
583
|
type: Type
|
|
587
584
|
"""
|
|
588
|
-
The type of the
|
|
585
|
+
The type of the Monitor Run
|
|
589
586
|
"""
|
|
590
587
|
completed_at: Optional[datetime] = Field(None, alias='completedAt')
|
|
591
588
|
"""
|
|
@@ -611,19 +608,22 @@ class StreamRun(ExaBaseModel):
|
|
|
611
608
|
|
|
612
609
|
class Type(Enum):
|
|
613
610
|
"""
|
|
614
|
-
The type of the
|
|
611
|
+
The type of the Monitor Run
|
|
615
612
|
"""
|
|
616
613
|
|
|
617
614
|
search = 'search'
|
|
618
615
|
refresh = 'refresh'
|
|
619
616
|
|
|
620
617
|
|
|
621
|
-
class
|
|
622
|
-
status: Optional[
|
|
618
|
+
class UpdateMonitor(ExaBaseModel):
|
|
619
|
+
status: Optional[MonitorStatus] = None
|
|
623
620
|
"""
|
|
624
|
-
The status of the
|
|
621
|
+
The status of the monitor.
|
|
625
622
|
"""
|
|
626
623
|
metadata: Optional[Dict[str, str]] = None
|
|
624
|
+
"""
|
|
625
|
+
Set of key-value pairs you want to associate with this object.
|
|
626
|
+
"""
|
|
627
627
|
|
|
628
628
|
|
|
629
629
|
class UpdateWebhookParameters(ExaBaseModel):
|
|
@@ -728,7 +728,7 @@ class WebhookAttempt(ExaBaseModel):
|
|
|
728
728
|
"""
|
|
729
729
|
attempted_at: datetime = Field(..., alias='attemptedAt')
|
|
730
730
|
"""
|
|
731
|
-
The date and time the
|
|
731
|
+
The date and time the attempt was made
|
|
732
732
|
"""
|
|
733
733
|
|
|
734
734
|
|
|
@@ -763,9 +763,9 @@ class Webset(ExaBaseModel):
|
|
|
763
763
|
"""
|
|
764
764
|
The Enrichments to apply to the Webset Items.
|
|
765
765
|
"""
|
|
766
|
-
|
|
766
|
+
monitors: List[Monitor]
|
|
767
767
|
"""
|
|
768
|
-
The
|
|
768
|
+
The Monitors for the Webset.
|
|
769
769
|
"""
|
|
770
770
|
metadata: Optional[Dict[str, Any]] = {}
|
|
771
771
|
"""
|
|
@@ -777,7 +777,7 @@ class Webset(ExaBaseModel):
|
|
|
777
777
|
"""
|
|
778
778
|
updated_at: datetime = Field(..., alias='updatedAt')
|
|
779
779
|
"""
|
|
780
|
-
The date and time the webset was updated
|
|
780
|
+
The date and time the webset was last updated
|
|
781
781
|
"""
|
|
782
782
|
|
|
783
783
|
|
|
@@ -807,9 +807,7 @@ class WebsetCustomEntity(ExaBaseModel):
|
|
|
807
807
|
type: Literal['custom']
|
|
808
808
|
description: constr(min_length=2)
|
|
809
809
|
"""
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
The entity represents what type of results the Webset will return. For example, if you want results to be Job Postings, you might use "Job Postings" as the entity description.
|
|
810
|
+
The description of the custom entity
|
|
813
811
|
"""
|
|
814
812
|
|
|
815
813
|
|
|
@@ -877,7 +875,7 @@ class WebsetEnrichment(ExaBaseModel):
|
|
|
877
875
|
"""
|
|
878
876
|
updated_at: datetime = Field(..., alias='updatedAt')
|
|
879
877
|
"""
|
|
880
|
-
The date and time the enrichment was updated
|
|
878
|
+
The date and time the enrichment was last updated
|
|
881
879
|
"""
|
|
882
880
|
|
|
883
881
|
|
|
@@ -981,6 +979,9 @@ class WebsetItemArticleProperties(ExaBaseModel):
|
|
|
981
979
|
article: WebsetItemArticlePropertiesFields = Field(
|
|
982
980
|
..., title='WebsetItemArticlePropertiesFields'
|
|
983
981
|
)
|
|
982
|
+
"""
|
|
983
|
+
The article fields
|
|
984
|
+
"""
|
|
984
985
|
|
|
985
986
|
|
|
986
987
|
class WebsetItemArticlePropertiesFields(ExaBaseModel):
|
|
@@ -990,7 +991,7 @@ class WebsetItemArticlePropertiesFields(ExaBaseModel):
|
|
|
990
991
|
"""
|
|
991
992
|
published_at: Optional[str] = Field(None, alias='publishedAt')
|
|
992
993
|
"""
|
|
993
|
-
The date
|
|
994
|
+
The date the article was published
|
|
994
995
|
"""
|
|
995
996
|
|
|
996
997
|
|
|
@@ -1011,6 +1012,9 @@ class WebsetItemCompanyProperties(ExaBaseModel):
|
|
|
1011
1012
|
company: WebsetItemCompanyPropertiesFields = Field(
|
|
1012
1013
|
..., title='WebsetItemCompanyPropertiesFields'
|
|
1013
1014
|
)
|
|
1015
|
+
"""
|
|
1016
|
+
The company fields
|
|
1017
|
+
"""
|
|
1014
1018
|
|
|
1015
1019
|
|
|
1016
1020
|
class WebsetItemCompanyPropertiesFields(ExaBaseModel):
|
|
@@ -1036,7 +1040,7 @@ class WebsetItemCompanyPropertiesFields(ExaBaseModel):
|
|
|
1036
1040
|
"""
|
|
1037
1041
|
logo_url: Optional[AnyUrl] = Field(None, alias='logoUrl')
|
|
1038
1042
|
"""
|
|
1039
|
-
The
|
|
1043
|
+
The URL of the company logo
|
|
1040
1044
|
"""
|
|
1041
1045
|
|
|
1042
1046
|
|
|
@@ -1071,6 +1075,9 @@ class WebsetItemCustomProperties(ExaBaseModel):
|
|
|
1071
1075
|
custom: WebsetItemCustomPropertiesFields = Field(
|
|
1072
1076
|
..., title='WebsetItemCustomPropertiesFields'
|
|
1073
1077
|
)
|
|
1078
|
+
"""
|
|
1079
|
+
The custom fields
|
|
1080
|
+
"""
|
|
1074
1081
|
|
|
1075
1082
|
|
|
1076
1083
|
class WebsetItemCustomPropertiesFields(ExaBaseModel):
|
|
@@ -1080,9 +1087,10 @@ class WebsetItemCustomPropertiesFields(ExaBaseModel):
|
|
|
1080
1087
|
"""
|
|
1081
1088
|
published_at: Optional[str] = Field(None, alias='publishedAt')
|
|
1082
1089
|
"""
|
|
1083
|
-
The date
|
|
1090
|
+
The date the content was published
|
|
1084
1091
|
"""
|
|
1085
1092
|
|
|
1093
|
+
|
|
1086
1094
|
class WebsetItemEnrichedEvent(ExaBaseModel):
|
|
1087
1095
|
id: str
|
|
1088
1096
|
"""
|
|
@@ -1112,7 +1120,7 @@ class WebsetItemEvaluation(ExaBaseModel):
|
|
|
1112
1120
|
"""
|
|
1113
1121
|
references: Optional[List[Reference]] = []
|
|
1114
1122
|
"""
|
|
1115
|
-
The references used to
|
|
1123
|
+
The references used to evaluate the criterion
|
|
1116
1124
|
"""
|
|
1117
1125
|
|
|
1118
1126
|
|
|
@@ -1129,6 +1137,9 @@ class WebsetItemPersonProperties(ExaBaseModel):
|
|
|
1129
1137
|
person: WebsetItemPersonPropertiesFields = Field(
|
|
1130
1138
|
..., title='WebsetItemPersonPropertiesFields'
|
|
1131
1139
|
)
|
|
1140
|
+
"""
|
|
1141
|
+
The person fields
|
|
1142
|
+
"""
|
|
1132
1143
|
|
|
1133
1144
|
|
|
1134
1145
|
class WebsetItemPersonPropertiesFields(ExaBaseModel):
|
|
@@ -1146,7 +1157,7 @@ class WebsetItemPersonPropertiesFields(ExaBaseModel):
|
|
|
1146
1157
|
"""
|
|
1147
1158
|
picture_url: Optional[AnyUrl] = Field(None, alias='pictureUrl')
|
|
1148
1159
|
"""
|
|
1149
|
-
The
|
|
1160
|
+
The URL of the person's picture
|
|
1150
1161
|
"""
|
|
1151
1162
|
|
|
1152
1163
|
|
|
@@ -1165,8 +1176,11 @@ class WebsetItemResearchPaperProperties(ExaBaseModel):
|
|
|
1165
1176
|
The text content of the research paper
|
|
1166
1177
|
"""
|
|
1167
1178
|
research_paper: WebsetItemResearchPaperPropertiesFields = Field(
|
|
1168
|
-
...,
|
|
1179
|
+
..., title='WebsetItemResearchPaperPropertiesFields'
|
|
1169
1180
|
)
|
|
1181
|
+
"""
|
|
1182
|
+
The research paper fields
|
|
1183
|
+
"""
|
|
1170
1184
|
|
|
1171
1185
|
|
|
1172
1186
|
class WebsetItemResearchPaperPropertiesFields(ExaBaseModel):
|
|
@@ -1176,7 +1190,7 @@ class WebsetItemResearchPaperPropertiesFields(ExaBaseModel):
|
|
|
1176
1190
|
"""
|
|
1177
1191
|
published_at: Optional[str] = Field(None, alias='publishedAt')
|
|
1178
1192
|
"""
|
|
1179
|
-
The date
|
|
1193
|
+
The date the research paper was published
|
|
1180
1194
|
"""
|
|
1181
1195
|
|
|
1182
1196
|
|
|
@@ -1265,7 +1279,7 @@ class WebsetSearch(ExaBaseModel):
|
|
|
1265
1279
|
"""
|
|
1266
1280
|
updated_at: datetime = Field(..., alias='updatedAt')
|
|
1267
1281
|
"""
|
|
1268
|
-
The date and time the search was updated
|
|
1282
|
+
The date and time the search was last updated
|
|
1269
1283
|
"""
|
|
1270
1284
|
|
|
1271
1285
|
|
|
@@ -1365,5 +1379,5 @@ class WebsetStatus(Enum):
|
|
|
1365
1379
|
class GetWebsetResponse(Webset):
|
|
1366
1380
|
items: Optional[List[WebsetItem]] = None
|
|
1367
1381
|
"""
|
|
1368
|
-
|
|
1382
|
+
The items in the webset
|
|
1369
1383
|
"""
|
|
@@ -2,27 +2,27 @@ exa_py/__init__.py,sha256=M2GC9oSdoV6m2msboW0vMWWl8wrth4o6gmEV4MYLGG8,66
|
|
|
2
2
|
exa_py/api.py,sha256=zwTEiIkWa6Gynx5NW9VMMY4Nws63gVDRSmzKdT4v2aY,84903
|
|
3
3
|
exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
exa_py/research/__init__.py,sha256=QeY-j6bP4QP5tF9ytX0IeQhJvd0Wn4cJCD69U8pP7kA,271
|
|
5
|
-
exa_py/research/client.py,sha256=
|
|
5
|
+
exa_py/research/client.py,sha256=C2ukFq_dE1xUfhMlHwpD9cY5rDClgn8N92pH4_FEVpE,11901
|
|
6
6
|
exa_py/research/models.py,sha256=j7YgRoMRp2MLgnaij7775x_hJEeV5gksKpfLwmawqxY,3704
|
|
7
7
|
exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
|
|
8
8
|
exa_py/websets/__init__.py,sha256=uOBAb9VrIHrPKoddGOp2ai2KgWlyUVCLMZqfbGOlboA,70
|
|
9
9
|
exa_py/websets/_generator/pydantic/BaseModel.jinja2,sha256=RUDCmPZVamoVx1WudylscYFfDhGoNNtRYlpTvKjAiuA,1276
|
|
10
|
-
exa_py/websets/client.py,sha256=
|
|
10
|
+
exa_py/websets/client.py,sha256=G3liUYP5DIlaVSoUIK7r1Jh_TgqHvpahy_oZ5OI9z0g,4811
|
|
11
11
|
exa_py/websets/core/__init__.py,sha256=xOyrFaqtBocMUu321Jpbk7IzIQRNZufSIGJXrKoG-Bg,323
|
|
12
12
|
exa_py/websets/core/base.py,sha256=thVIeRtlabbvueP0dAni5Nwtl9AWYv1I1Mmyc_jlYO0,4086
|
|
13
13
|
exa_py/websets/enrichments/__init__.py,sha256=5dJIEKKceUost3RnI6PpCSB3VjUCBzxseEsIXu-ZY-Y,83
|
|
14
14
|
exa_py/websets/enrichments/client.py,sha256=obUjn4vH6tKBMtHEBVdMzlN8in0Fx3sCP-bXx-Le1zM,2338
|
|
15
15
|
exa_py/websets/items/__init__.py,sha256=DCWZJVtRmUjnMEkKdb5gW1LT9cHcb-J8lENMnyyBeKU,71
|
|
16
16
|
exa_py/websets/items/client.py,sha256=oZoYr52WrE76Ox6GyoS9rMn7bTrIpno0FKgIWFtb57U,2796
|
|
17
|
+
exa_py/websets/monitors/__init__.py,sha256=jfr-gq8eKVa_gNe_DEqX9XCZPbJjpOe7QpH_D4RCFJQ,122
|
|
18
|
+
exa_py/websets/monitors/client.py,sha256=fFxCSngkUPXqf9ilUMl8DaO2ihYveD-WfSoqARwf1eQ,3526
|
|
19
|
+
exa_py/websets/monitors/runs/__init__.py,sha256=TmcETf3zdQouA_vAeLiosCNL1MYJnZ0yW2sbOAjTmm8,71
|
|
20
|
+
exa_py/websets/monitors/runs/client.py,sha256=WnwcWCf7UKk68VCNUp8mRXBtlU8vglTSX-eoWVXzKIw,1229
|
|
17
21
|
exa_py/websets/searches/__init__.py,sha256=_0Zx8ES5fFTEL3T8mhLxq_xK2t0JONx6ad6AtbvClsE,77
|
|
18
22
|
exa_py/websets/searches/client.py,sha256=X3f7axWGfecmxf-2tBTX0Yf_--xToz1X8ZHbbudEzy0,1790
|
|
19
|
-
exa_py/websets/
|
|
20
|
-
exa_py/websets/streams/client.py,sha256=eoGmIjV1rIZvENh2OYu1KmG660aWTUXDM7dNlxvdTxg,3468
|
|
21
|
-
exa_py/websets/streams/runs/__init__.py,sha256=o5A7mgl9KtrqVFN_uCHPxTcKTVI3fmURZPM6_Uowg1g,69
|
|
22
|
-
exa_py/websets/streams/runs/client.py,sha256=ja63-G0Y74YDgsWq30aoa0llIx8I9mIwbCbtACz7zXQ,1204
|
|
23
|
-
exa_py/websets/types.py,sha256=-KmC6N9LMh5fPhhXZslmUyQcSmBqIdPF-qQ27qS4GEw,34756
|
|
23
|
+
exa_py/websets/types.py,sha256=5iD5QHtCbHAkIjeLoLf_D70t5Q59AeyCnN9PN1Z6pZ4,34562
|
|
24
24
|
exa_py/websets/webhooks/__init__.py,sha256=iTPBCxFd73z4RifLQMX6iRECx_6pwlI5qscLNjMOUHE,77
|
|
25
25
|
exa_py/websets/webhooks/client.py,sha256=zsIRMTeJU65yj-zo7Zz-gG02Prtzgcx6utGFSoY4HQQ,4222
|
|
26
|
-
exa_py-1.14.
|
|
27
|
-
exa_py-1.14.
|
|
28
|
-
exa_py-1.14.
|
|
26
|
+
exa_py-1.14.2.dist-info/METADATA,sha256=fkHu-6md_rBhdxa7IgROf-p8nuiMT8SHAAVIPdL1_94,4120
|
|
27
|
+
exa_py-1.14.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
28
|
+
exa_py-1.14.2.dist-info/RECORD,,
|
exa_py/websets/streams/client.py
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Dict, Any, Union, Optional
|
|
4
|
-
|
|
5
|
-
from ..types import (
|
|
6
|
-
Stream,
|
|
7
|
-
CreateStreamParameters,
|
|
8
|
-
UpdateStream,
|
|
9
|
-
ListStreamsResponse,
|
|
10
|
-
)
|
|
11
|
-
from ..core.base import WebsetsBaseClient
|
|
12
|
-
from .runs import StreamRunsClient
|
|
13
|
-
|
|
14
|
-
class StreamsClient(WebsetsBaseClient):
|
|
15
|
-
"""Client for managing Streams."""
|
|
16
|
-
|
|
17
|
-
def __init__(self, client):
|
|
18
|
-
super().__init__(client)
|
|
19
|
-
self.runs = StreamRunsClient(client)
|
|
20
|
-
|
|
21
|
-
def create(self, params: Union[Dict[str, Any], CreateStreamParameters]) -> Stream:
|
|
22
|
-
"""Create a new Stream to continuously keep your Websets updated with fresh data.
|
|
23
|
-
|
|
24
|
-
Streams automatically run on your defined schedule to ensure your Websets stay current without manual intervention:
|
|
25
|
-
- Find new content: Execute search operations to discover fresh items matching your criteria
|
|
26
|
-
- Update existing content: Run refresh operations to update items contents and enrichments
|
|
27
|
-
- Automated scheduling: Configure frequency, timezone, and execution times
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
params (CreateStreamParameters): The parameters for creating a stream.
|
|
31
|
-
|
|
32
|
-
Returns:
|
|
33
|
-
Stream: The created stream.
|
|
34
|
-
"""
|
|
35
|
-
response = self.request("/v0/streams", data=params)
|
|
36
|
-
return Stream.model_validate(response)
|
|
37
|
-
|
|
38
|
-
def get(self, stream_id: str) -> Stream:
|
|
39
|
-
"""Get a specific stream.
|
|
40
|
-
|
|
41
|
-
Args:
|
|
42
|
-
stream_id (str): The id of the Stream.
|
|
43
|
-
|
|
44
|
-
Returns:
|
|
45
|
-
Stream: The retrieved stream.
|
|
46
|
-
"""
|
|
47
|
-
response = self.request(f"/v0/streams/{stream_id}", method="GET")
|
|
48
|
-
return Stream.model_validate(response)
|
|
49
|
-
|
|
50
|
-
def list(self, *, cursor: Optional[str] = None, limit: Optional[int] = None, webset_id: Optional[str] = None) -> ListStreamsResponse:
|
|
51
|
-
"""List all streams.
|
|
52
|
-
|
|
53
|
-
Args:
|
|
54
|
-
cursor (str, optional): The cursor to paginate through the results.
|
|
55
|
-
limit (int, optional): The number of results to return (1-200, default 25).
|
|
56
|
-
webset_id (str, optional): The id of the Webset to list streams for.
|
|
57
|
-
|
|
58
|
-
Returns:
|
|
59
|
-
ListStreamsResponse: List of streams with pagination info.
|
|
60
|
-
"""
|
|
61
|
-
params = {
|
|
62
|
-
k: v
|
|
63
|
-
for k, v in {
|
|
64
|
-
"cursor": cursor,
|
|
65
|
-
"limit": limit,
|
|
66
|
-
"websetId": webset_id
|
|
67
|
-
}.items()
|
|
68
|
-
if v is not None
|
|
69
|
-
}
|
|
70
|
-
response = self.request("/v0/streams", params=params, method="GET")
|
|
71
|
-
return ListStreamsResponse.model_validate(response)
|
|
72
|
-
|
|
73
|
-
def update(self, stream_id: str, params: Union[Dict[str, Any], UpdateStream]) -> Stream:
|
|
74
|
-
"""Update a stream configuration.
|
|
75
|
-
|
|
76
|
-
Args:
|
|
77
|
-
stream_id (str): The id of the Stream.
|
|
78
|
-
params (UpdateStream): The parameters for updating a stream.
|
|
79
|
-
|
|
80
|
-
Returns:
|
|
81
|
-
Stream: The updated stream.
|
|
82
|
-
"""
|
|
83
|
-
response = self.request(f"/v0/streams/{stream_id}", data=params, method="PATCH")
|
|
84
|
-
return Stream.model_validate(response)
|
|
85
|
-
|
|
86
|
-
def delete(self, stream_id: str) -> Stream:
|
|
87
|
-
"""Delete a stream.
|
|
88
|
-
|
|
89
|
-
Args:
|
|
90
|
-
stream_id (str): The id of the Stream.
|
|
91
|
-
|
|
92
|
-
Returns:
|
|
93
|
-
Stream: The deleted stream.
|
|
94
|
-
"""
|
|
95
|
-
response = self.request(f"/v0/streams/{stream_id}", method="DELETE")
|
|
96
|
-
return Stream.model_validate(response)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from ...types import (
|
|
4
|
-
StreamRun,
|
|
5
|
-
ListStreamRunsResponse,
|
|
6
|
-
)
|
|
7
|
-
from ...core.base import WebsetsBaseClient
|
|
8
|
-
|
|
9
|
-
class StreamRunsClient(WebsetsBaseClient):
|
|
10
|
-
"""Client for managing Stream Runs."""
|
|
11
|
-
|
|
12
|
-
def __init__(self, client):
|
|
13
|
-
super().__init__(client)
|
|
14
|
-
|
|
15
|
-
def list(self, stream_id: str) -> ListStreamRunsResponse:
|
|
16
|
-
"""List all runs for the Stream.
|
|
17
|
-
|
|
18
|
-
Args:
|
|
19
|
-
stream_id (str): The id of the Stream to list runs for.
|
|
20
|
-
|
|
21
|
-
Returns:
|
|
22
|
-
ListStreamRunsResponse: List of stream runs.
|
|
23
|
-
"""
|
|
24
|
-
response = self.request(f"/v0/streams/{stream_id}/runs", method="GET")
|
|
25
|
-
return ListStreamRunsResponse.model_validate(response)
|
|
26
|
-
|
|
27
|
-
def get(self, stream_id: str, run_id: str) -> StreamRun:
|
|
28
|
-
"""Get a specific stream run.
|
|
29
|
-
|
|
30
|
-
Args:
|
|
31
|
-
stream_id (str): The id of the Stream to get the run for.
|
|
32
|
-
run_id (str): The id of the stream run.
|
|
33
|
-
|
|
34
|
-
Returns:
|
|
35
|
-
StreamRun: The stream run details.
|
|
36
|
-
"""
|
|
37
|
-
response = self.request(f"/v0/streams/{stream_id}/runs/{run_id}", method="GET")
|
|
38
|
-
return StreamRun.model_validate(response)
|
|
File without changes
|