exa-py 1.14.16__py3-none-any.whl → 1.14.17__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/websets/client.py
CHANGED
|
@@ -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
|
|
exa_py/websets/types.py
CHANGED
|
@@ -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):
|
|
@@ -7,7 +7,7 @@ exa_py/research/models.py,sha256=j7YgRoMRp2MLgnaij7775x_hJEeV5gksKpfLwmawqxY,370
|
|
|
7
7
|
exa_py/utils.py,sha256=eYnJRAFJonwKP_mCxzAB9TnLEqoF-88stg6wh-M-Ups,6424
|
|
8
8
|
exa_py/websets/__init__.py,sha256=x7Dc0MS8raRXA7Ud6alKgnsUmLi6X9GTqfB8kOwC9iQ,179
|
|
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=sKkji8QaPFnGM1-J5TB6yKJcGAEd6gk7lsnIebzXNQ8,5856
|
|
11
11
|
exa_py/websets/core/__init__.py,sha256=xOyrFaqtBocMUu321Jpbk7IzIQRNZufSIGJXrKoG-Bg,323
|
|
12
12
|
exa_py/websets/core/base.py,sha256=RldWYwBg2iVfkWmdPke7xjXdwb4JKeABIOgiZtqvz-4,4125
|
|
13
13
|
exa_py/websets/enrichments/__init__.py,sha256=5dJIEKKceUost3RnI6PpCSB3VjUCBzxseEsIXu-ZY-Y,83
|
|
@@ -24,9 +24,9 @@ exa_py/websets/monitors/runs/__init__.py,sha256=TmcETf3zdQouA_vAeLiosCNL1MYJnZ0y
|
|
|
24
24
|
exa_py/websets/monitors/runs/client.py,sha256=WnwcWCf7UKk68VCNUp8mRXBtlU8vglTSX-eoWVXzKIw,1229
|
|
25
25
|
exa_py/websets/searches/__init__.py,sha256=_0Zx8ES5fFTEL3T8mhLxq_xK2t0JONx6ad6AtbvClsE,77
|
|
26
26
|
exa_py/websets/searches/client.py,sha256=X3f7axWGfecmxf-2tBTX0Yf_--xToz1X8ZHbbudEzy0,1790
|
|
27
|
-
exa_py/websets/types.py,sha256=
|
|
27
|
+
exa_py/websets/types.py,sha256=KtBX_5yOu01R3sAZBFDv1Qaqan33rNdMF6AtdAmQHFc,45223
|
|
28
28
|
exa_py/websets/webhooks/__init__.py,sha256=iTPBCxFd73z4RifLQMX6iRECx_6pwlI5qscLNjMOUHE,77
|
|
29
29
|
exa_py/websets/webhooks/client.py,sha256=zS1eoWKliuiY4AIeFJdpAlPZeOINyphn7KEWANF-zaE,4384
|
|
30
|
-
exa_py-1.14.
|
|
31
|
-
exa_py-1.14.
|
|
32
|
-
exa_py-1.14.
|
|
30
|
+
exa_py-1.14.17.dist-info/METADATA,sha256=r8tMRxGsjX6R8QGh-gJxJ2VqBx5K7Sl0rij0UeLX950,3827
|
|
31
|
+
exa_py-1.14.17.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
32
|
+
exa_py-1.14.17.dist-info/RECORD,,
|
|
File without changes
|