exa-py 1.14.15__tar.gz → 1.14.17__tar.gz

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.

Files changed (32) hide show
  1. {exa_py-1.14.15 → exa_py-1.14.17}/PKG-INFO +1 -1
  2. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/client.py +19 -0
  3. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/items/client.py +6 -4
  4. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/types.py +124 -0
  5. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/webhooks/client.py +5 -2
  6. {exa_py-1.14.15 → exa_py-1.14.17}/pyproject.toml +1 -1
  7. {exa_py-1.14.15 → exa_py-1.14.17}/README.md +0 -0
  8. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/__init__.py +0 -0
  9. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/api.py +0 -0
  10. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/py.typed +0 -0
  11. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/research/__init__.py +0 -0
  12. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/research/client.py +0 -0
  13. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/research/models.py +0 -0
  14. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/utils.py +0 -0
  15. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/__init__.py +0 -0
  16. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/_generator/pydantic/BaseModel.jinja2 +0 -0
  17. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/core/__init__.py +0 -0
  18. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/core/base.py +0 -0
  19. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/enrichments/__init__.py +0 -0
  20. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/enrichments/client.py +0 -0
  21. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/events/__init__.py +0 -0
  22. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/events/client.py +0 -0
  23. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/imports/__init__.py +0 -0
  24. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/imports/client.py +0 -0
  25. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/items/__init__.py +0 -0
  26. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/monitors/__init__.py +0 -0
  27. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/monitors/client.py +0 -0
  28. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/monitors/runs/__init__.py +0 -0
  29. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/monitors/runs/client.py +0 -0
  30. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/searches/__init__.py +0 -0
  31. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/searches/client.py +0 -0
  32. {exa_py-1.14.15 → exa_py-1.14.17}/exa_py/websets/webhooks/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: exa-py
3
- Version: 1.14.15
3
+ Version: 1.14.17
4
4
  Summary: Python SDK for Exa API.
5
5
  License: MIT
6
6
  Author: Exa AI
@@ -10,6 +10,8 @@ from .types import (
10
10
  UpdateWebsetRequest,
11
11
  WebsetStatus,
12
12
  CreateWebsetParameters,
13
+ PreviewWebsetParameters,
14
+ PreviewWebsetResponse,
13
15
  )
14
16
  from .core.base import WebsetsBaseClient
15
17
  from .items import WebsetItemsClient
@@ -45,6 +47,23 @@ class WebsetsClient(WebsetsBaseClient):
45
47
  response = self.request("/v0/websets", data=params)
46
48
  return Webset.model_validate(response)
47
49
 
50
+ def preview(self, params: Union[Dict[str, Any], PreviewWebsetParameters]) -> PreviewWebsetResponse:
51
+ """Preview a webset query.
52
+
53
+ Preview how a search query will be decomposed before creating a webset.
54
+ This endpoint performs the same query analysis that happens during webset creation,
55
+ allowing you to see the detected entity type, generated search criteria, and
56
+ available enrichment columns in advance.
57
+
58
+ Args:
59
+ params (PreviewWebsetParameters): The parameters for previewing a webset.
60
+
61
+ Returns:
62
+ PreviewWebsetResponse: The preview response showing how the query will be decomposed.
63
+ """
64
+ response = self.request("/v0/websets/preview", data=params)
65
+ return PreviewWebsetResponse.model_validate(response)
66
+
48
67
  def get(self, id: str, *, expand: Optional[List[Literal["items"]]] = None) -> GetWebsetResponse:
49
68
  """Get a Webset by ID.
50
69
 
@@ -15,34 +15,36 @@ class WebsetItemsClient(WebsetsBaseClient):
15
15
  super().__init__(client)
16
16
 
17
17
  def list(self, webset_id: str, *, cursor: Optional[str] = None,
18
- limit: Optional[int] = None) -> ListWebsetItemResponse:
18
+ limit: Optional[int] = None, source_id: Optional[str] = None) -> ListWebsetItemResponse:
19
19
  """List all Items for a Webset.
20
20
 
21
21
  Args:
22
22
  webset_id (str): The id or externalId of the Webset.
23
23
  cursor (str, optional): The cursor to paginate through the results.
24
24
  limit (int, optional): The number of results to return (max 200).
25
+ source_id (str, optional): Filter items by source ID.
25
26
 
26
27
  Returns:
27
28
  ListWebsetItemResponse: List of webset items.
28
29
  """
29
- params = {k: v for k, v in {"cursor": cursor, "limit": limit}.items() if v is not None}
30
+ params = {k: v for k, v in {"cursor": cursor, "limit": limit, "sourceId": source_id}.items() if v is not None}
30
31
  response = self.request(f"/v0/websets/{webset_id}/items", params=params, method="GET")
31
32
  return ListWebsetItemResponse.model_validate(response)
32
33
 
33
- def list_all(self, webset_id: str, *, limit: Optional[int] = None) -> Iterator[WebsetItem]:
34
+ def list_all(self, webset_id: str, *, limit: Optional[int] = None, source_id: Optional[str] = None) -> Iterator[WebsetItem]:
34
35
  """Iterate through all Items in a Webset, handling pagination automatically.
35
36
 
36
37
  Args:
37
38
  webset_id (str): The id or externalId of the Webset.
38
39
  limit (int, optional): The number of results to return per page (max 200).
40
+ source_id (str, optional): Filter items by source ID.
39
41
 
40
42
  Yields:
41
43
  WebsetItem: Each item in the webset.
42
44
  """
43
45
  cursor = None
44
46
  while True:
45
- response = self.list(webset_id, cursor=cursor, limit=limit)
47
+ response = self.list(webset_id, cursor=cursor, limit=limit, source_id=source_id)
46
48
  for item in response.data:
47
49
  yield item
48
50
 
@@ -171,6 +171,10 @@ class CreateWebsetSearchParameters(ExaBaseModel):
171
171
  """
172
172
  Sources (existing imports or websets) to exclude from search results. Any results found within these sources will be omitted to prevent finding them during search.
173
173
  """
174
+ scope: Optional[List[ScopeItem]] = None
175
+ """
176
+ Limit the search to specific sources (existing imports). Any results found within these sources matching the search criteria will be included in the Webset.
177
+ """
174
178
  behavior: Optional[WebsetSearchBehavior] = WebsetSearchBehavior.override
175
179
  """
176
180
  The behavior of the Search when it is added to a Webset.
@@ -296,6 +300,25 @@ class ImportSource(Enum):
296
300
  webset = 'webset'
297
301
 
298
302
 
303
+ class ScopeSourceType(Enum):
304
+ """
305
+ The source type for scope filtering.
306
+ """
307
+ import_ = 'import'
308
+
309
+
310
+ class PreviewWebsetResponseEnrichmentsFormat(Enum):
311
+ """
312
+ Format of the enrichment in preview response.
313
+ """
314
+ text = 'text'
315
+ date = 'date'
316
+ number = 'number'
317
+ options = 'options'
318
+ email = 'email'
319
+ phone = 'phone'
320
+
321
+
299
322
  class ListEventsResponse(ExaBaseModel):
300
323
  data: List[Annotated[
301
324
  Union[
@@ -443,6 +466,103 @@ class ExcludeItem(ExaBaseModel):
443
466
  """
444
467
 
445
468
 
469
+ class ScopeItem(ExaBaseModel):
470
+ """
471
+ Represents a source to limit search scope to.
472
+ """
473
+ source: ScopeSourceType
474
+ """
475
+ The type of source (import)
476
+ """
477
+ id: str
478
+ """
479
+ The ID of the source to search within
480
+ """
481
+
482
+
483
+ class PreviewWebsetParameters(ExaBaseModel):
484
+ """
485
+ Parameters for previewing a webset query.
486
+ """
487
+ query: str
488
+ """
489
+ Natural language search query describing what you are looking for.
490
+ """
491
+ entity: Optional[Union[
492
+ WebsetCompanyEntity,
493
+ WebsetPersonEntity,
494
+ WebsetArticleEntity,
495
+ WebsetResearchPaperEntity,
496
+ WebsetCustomEntity,
497
+ ]] = None
498
+ """
499
+ Entity used to inform the decomposition. Not required - we automatically detect
500
+ the entity from the query. Only use when you need more fine control.
501
+ """
502
+
503
+
504
+ class PreviewWebsetResponseEnrichment(ExaBaseModel):
505
+ """
506
+ Detected enrichment in preview response.
507
+ """
508
+ description: str
509
+ """
510
+ Description of the enrichment.
511
+ """
512
+ format: PreviewWebsetResponseEnrichmentsFormat
513
+ """
514
+ Format of the enrichment.
515
+ """
516
+ options: Optional[List[Option]] = None
517
+ """
518
+ When format is options, the options detected from the query.
519
+ """
520
+
521
+
522
+ class PreviewWebsetResponseSearchCriterion(ExaBaseModel):
523
+ """
524
+ Detected search criterion in preview response.
525
+ """
526
+ description: str
527
+ """
528
+ Description of the criterion.
529
+ """
530
+
531
+
532
+ class PreviewWebsetResponseSearch(ExaBaseModel):
533
+ """
534
+ Search information in preview response.
535
+ """
536
+ entity: Union[
537
+ WebsetCompanyEntity,
538
+ WebsetPersonEntity,
539
+ WebsetArticleEntity,
540
+ WebsetResearchPaperEntity,
541
+ WebsetCustomEntity,
542
+ ]
543
+ """
544
+ Detected entity from the query.
545
+ """
546
+ criteria: List[PreviewWebsetResponseSearchCriterion]
547
+ """
548
+ Detected criteria from the query.
549
+ """
550
+
551
+
552
+ class PreviewWebsetResponse(ExaBaseModel):
553
+ """
554
+ Response from previewing a webset query.
555
+ """
556
+ search: PreviewWebsetResponseSearch
557
+ """
558
+ Search analysis from the query.
559
+ """
560
+ enrichments: List[PreviewWebsetResponseEnrichment]
561
+ """
562
+ Detected enrichments from the query.
563
+ """
564
+
565
+
446
566
  class CsvImportConfig(ExaBaseModel):
447
567
  """
448
568
  Configuration for CSV imports.
@@ -758,6 +878,10 @@ class CreateWebsetParametersSearch(ExaBaseModel):
758
878
  """
759
879
  Sources (existing imports or websets) to exclude from search results. Any results found within these sources will be omitted to prevent finding them during search.
760
880
  """
881
+ scope: Optional[List[ScopeItem]] = None
882
+ """
883
+ Limit the search to specific sources (existing imports or websets). Any results found within these sources matching the search criteria will be included in the Webset.
884
+ """
761
885
 
762
886
 
763
887
  class Source(Enum):
@@ -19,7 +19,8 @@ class WebhookAttemptsClient(WebsetsBaseClient):
19
19
  super().__init__(client)
20
20
 
21
21
  def list(self, webhook_id: str, *, cursor: Optional[str] = None,
22
- limit: Optional[int] = None, event_type: Optional[Union[EventType, str]] = None) -> ListWebhookAttemptsResponse:
22
+ limit: Optional[int] = None, event_type: Optional[Union[EventType, str]] = None,
23
+ successful: Optional[bool] = None) -> ListWebhookAttemptsResponse:
23
24
  """List all attempts made by a Webhook ordered in descending order.
24
25
 
25
26
  Args:
@@ -27,6 +28,7 @@ class WebhookAttemptsClient(WebsetsBaseClient):
27
28
  cursor (str, optional): The cursor to paginate through the results.
28
29
  limit (int, optional): The number of results to return (max 200).
29
30
  event_type (Union[EventType, str], optional): The type of event to filter by.
31
+ successful (bool, optional): Filter attempts by success status.
30
32
 
31
33
  Returns:
32
34
  ListWebhookAttemptsResponse: List of webhook attempts.
@@ -41,7 +43,8 @@ class WebhookAttemptsClient(WebsetsBaseClient):
41
43
  params = {k: v for k, v in {
42
44
  "cursor": cursor,
43
45
  "limit": limit,
44
- "eventType": event_type_value
46
+ "eventType": event_type_value,
47
+ "successful": successful
45
48
  }.items() if v is not None}
46
49
 
47
50
  response = self.request(f"/v0/webhooks/{webhook_id}/attempts", params=params, method="GET")
@@ -25,7 +25,7 @@ in-project = true
25
25
 
26
26
  [project]
27
27
  name = "exa-py"
28
- version = "1.14.15"
28
+ version = "1.14.17"
29
29
  description = "Python SDK for Exa API."
30
30
  readme = "README.md"
31
31
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes
File without changes