exa-py 1.15.0__py3-none-any.whl → 1.15.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/websets/types.py CHANGED
@@ -24,15 +24,24 @@ class WebsetSearchBehavior(Enum):
24
24
 
25
25
 
26
26
  class MonitorBehaviorSearchConfig(ExaBaseModel):
27
- query: str
28
- criteria: List[SearchCriterion]
29
- entity: Union[
27
+ query: Optional[str] = None
28
+ """
29
+ The query to search for. By default, the query from the last search is used.
30
+ """
31
+ criteria: Optional[List[SearchCriterion]] = None
32
+ """
33
+ The criteria to search for. By default, the criteria from the last search is used.
34
+ """
35
+ entity: Optional[Union[
30
36
  WebsetCompanyEntity,
31
37
  WebsetPersonEntity,
32
38
  WebsetArticleEntity,
33
39
  WebsetResearchPaperEntity,
34
40
  WebsetCustomEntity,
35
- ] = Field(..., title='WebsetEntity')
41
+ ]] = Field(None, title='WebsetEntity')
42
+ """
43
+ The entity to search for. By default, the entity from the last search/import is used.
44
+ """
36
45
  count: int
37
46
  """
38
47
  The maximum number of results to find
@@ -243,11 +252,15 @@ class EventType(Enum):
243
252
  webset_search_updated = 'webset.search.updated'
244
253
  import_created = 'import.created'
245
254
  import_completed = 'import.completed'
246
- import_processing = 'import.processing'
247
- webset_export_created = 'webset.export.created'
248
- webset_export_completed = 'webset.export.completed'
249
255
  webset_item_created = 'webset.item.created'
250
256
  webset_item_enriched = 'webset.item.enriched'
257
+ monitor_created = 'monitor.created'
258
+ monitor_updated = 'monitor.updated'
259
+ monitor_deleted = 'monitor.deleted'
260
+ monitor_run_created = 'monitor.run.created'
261
+ monitor_run_completed = 'monitor.run.completed'
262
+ webset_export_created = 'webset.export.created'
263
+ webset_export_completed = 'webset.export.completed'
251
264
 
252
265
 
253
266
  class Format(Enum):
@@ -263,6 +276,7 @@ class Format(Enum):
263
276
  options = 'options'
264
277
  email = 'email'
265
278
  phone = 'phone'
279
+ url = 'url'
266
280
 
267
281
 
268
282
  class ImportFormat(Enum):
@@ -333,6 +347,13 @@ class ListEventsResponse(ExaBaseModel):
333
347
  WebsetSearchUpdatedEvent,
334
348
  WebsetSearchCanceledEvent,
335
349
  WebsetSearchCompletedEvent,
350
+ ImportCreatedEvent,
351
+ ImportCompletedEvent,
352
+ MonitorCreatedEvent,
353
+ MonitorUpdatedEvent,
354
+ MonitorDeletedEvent,
355
+ MonitorRunCreatedEvent,
356
+ MonitorRunCompletedEvent,
336
357
  ],
337
358
  Field(discriminator='type')
338
359
  ]]
@@ -802,6 +823,30 @@ class UpdateImport(ExaBaseModel):
802
823
  """
803
824
 
804
825
 
826
+ class UpdateEnrichmentParameters(ExaBaseModel):
827
+ """
828
+ Parameters for updating an enrichment.
829
+ """
830
+ description: Optional[str] = None
831
+ """
832
+ Provide a description of the enrichment task you want to perform to each Webset Item.
833
+ """
834
+ format: Optional[Format] = None
835
+ """
836
+ Format of the enrichment response.
837
+
838
+ We automatically select the best format based on the description. If you want to explicitly specify the format, you can do so here.
839
+ """
840
+ options: Optional[List[Option]] = None
841
+ """
842
+ When the format is options, the different options for the enrichment agent to choose from.
843
+ """
844
+ metadata: Optional[Dict[str, Any]] = None
845
+ """
846
+ Set of key-value pairs you want to associate with this object.
847
+ """
848
+
849
+
805
850
  class Option(ExaBaseModel):
806
851
  label: str
807
852
  """
@@ -1336,6 +1381,7 @@ class WebsetEnrichmentFormat(Enum):
1336
1381
  options = 'options'
1337
1382
  email = 'email'
1338
1383
  phone = 'phone'
1384
+ url = 'url'
1339
1385
 
1340
1386
 
1341
1387
  class WebsetEnrichmentOption(Option):
@@ -1873,6 +1919,104 @@ class WebsetSearchUpdatedEvent(ExaBaseModel):
1873
1919
  """
1874
1920
 
1875
1921
 
1922
+ class ImportCreatedEvent(ExaBaseModel):
1923
+ id: str
1924
+ """
1925
+ The unique identifier for the event
1926
+ """
1927
+ object: Literal['event']
1928
+ type: Literal['import.created']
1929
+ data: Import
1930
+ created_at: datetime = Field(..., alias='createdAt')
1931
+ """
1932
+ The date and time the event was created
1933
+ """
1934
+
1935
+
1936
+ class ImportCompletedEvent(ExaBaseModel):
1937
+ id: str
1938
+ """
1939
+ The unique identifier for the event
1940
+ """
1941
+ object: Literal['event']
1942
+ type: Literal['import.completed']
1943
+ data: Import
1944
+ created_at: datetime = Field(..., alias='createdAt')
1945
+ """
1946
+ The date and time the event was created
1947
+ """
1948
+
1949
+
1950
+ class MonitorCreatedEvent(ExaBaseModel):
1951
+ id: str
1952
+ """
1953
+ The unique identifier for the event
1954
+ """
1955
+ object: Literal['event']
1956
+ type: Literal['monitor.created']
1957
+ data: Monitor
1958
+ created_at: datetime = Field(..., alias='createdAt')
1959
+ """
1960
+ The date and time the event was created
1961
+ """
1962
+
1963
+
1964
+ class MonitorUpdatedEvent(ExaBaseModel):
1965
+ id: str
1966
+ """
1967
+ The unique identifier for the event
1968
+ """
1969
+ object: Literal['event']
1970
+ type: Literal['monitor.updated']
1971
+ data: Monitor
1972
+ created_at: datetime = Field(..., alias='createdAt')
1973
+ """
1974
+ The date and time the event was created
1975
+ """
1976
+
1977
+
1978
+ class MonitorDeletedEvent(ExaBaseModel):
1979
+ id: str
1980
+ """
1981
+ The unique identifier for the event
1982
+ """
1983
+ object: Literal['event']
1984
+ type: Literal['monitor.deleted']
1985
+ data: Monitor
1986
+ created_at: datetime = Field(..., alias='createdAt')
1987
+ """
1988
+ The date and time the event was created
1989
+ """
1990
+
1991
+
1992
+ class MonitorRunCreatedEvent(ExaBaseModel):
1993
+ id: str
1994
+ """
1995
+ The unique identifier for the event
1996
+ """
1997
+ object: Literal['event']
1998
+ type: Literal['monitor.run.created']
1999
+ data: MonitorRun
2000
+ created_at: datetime = Field(..., alias='createdAt')
2001
+ """
2002
+ The date and time the event was created
2003
+ """
2004
+
2005
+
2006
+ class MonitorRunCompletedEvent(ExaBaseModel):
2007
+ id: str
2008
+ """
2009
+ The unique identifier for the event
2010
+ """
2011
+ object: Literal['event']
2012
+ type: Literal['monitor.run.completed']
2013
+ data: MonitorRun
2014
+ created_at: datetime = Field(..., alias='createdAt')
2015
+ """
2016
+ The date and time the event was created
2017
+ """
2018
+
2019
+
1876
2020
  class WebsetStatus(Enum):
1877
2021
  """
1878
2022
  The status of the webset
@@ -1,3 +1,3 @@
1
- from .client import WebsetWebhooksClient
1
+ from .client import WebsetWebhooksClient, AsyncWebsetWebhooksClient, AsyncWebhookAttemptsClient
2
2
 
3
- __all__ = ["WebsetWebhooksClient"]
3
+ __all__ = ["WebsetWebhooksClient", "AsyncWebsetWebhooksClient", "AsyncWebhookAttemptsClient"]
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import Optional, Dict, Any, Union, Literal
3
+ from typing import Optional, Dict, Any, Union
4
4
 
5
5
  from ..types import (
6
6
  CreateWebhookParameters,
@@ -11,6 +11,7 @@ from ..types import (
11
11
  EventType,
12
12
  )
13
13
  from ..core.base import WebsetsBaseClient
14
+ from ..core.async_base import WebsetsAsyncBaseClient
14
15
 
15
16
  class WebhookAttemptsClient(WebsetsBaseClient):
16
17
  """Client for managing Webhook Attempts."""
@@ -118,4 +119,65 @@ class WebsetWebhooksClient(WebsetsBaseClient):
118
119
  Webhook: The deleted webhook.
119
120
  """
120
121
  response = self.request(f"/v0/webhooks/{id}", method="DELETE")
122
+ return Webhook.model_validate(response)
123
+
124
+
125
+ class AsyncWebhookAttemptsClient(WebsetsAsyncBaseClient):
126
+ """Async client for managing Webhook Attempts."""
127
+
128
+ def __init__(self, client):
129
+ super().__init__(client)
130
+
131
+ async def list(self, webhook_id: str, *, cursor: Optional[str] = None,
132
+ limit: Optional[int] = None, event_type: Optional[Union[EventType, str]] = None,
133
+ successful: Optional[bool] = None) -> ListWebhookAttemptsResponse:
134
+ """List all attempts made by a Webhook ordered in descending order."""
135
+ event_type_value = None
136
+ if event_type is not None:
137
+ if isinstance(event_type, EventType):
138
+ event_type_value = event_type.value
139
+ else:
140
+ event_type_value = event_type
141
+
142
+ params = {k: v for k, v in {
143
+ "cursor": cursor,
144
+ "limit": limit,
145
+ "eventType": event_type_value,
146
+ "successful": successful
147
+ }.items() if v is not None}
148
+
149
+ response = await self.request(f"/v0/webhooks/{webhook_id}/attempts", params=params, method="GET")
150
+ return ListWebhookAttemptsResponse.model_validate(response)
151
+
152
+ class AsyncWebsetWebhooksClient(WebsetsAsyncBaseClient):
153
+ """Async client for managing Webset Webhooks."""
154
+
155
+ def __init__(self, client):
156
+ super().__init__(client)
157
+ self.attempts = AsyncWebhookAttemptsClient(client)
158
+
159
+ async def create(self, params: Union[Dict[str, Any], CreateWebhookParameters]) -> Webhook:
160
+ """Create a Webhook."""
161
+ response = await self.request("/v0/webhooks", data=params)
162
+ return Webhook.model_validate(response)
163
+
164
+ async def get(self, id: str) -> Webhook:
165
+ """Get a Webhook by ID."""
166
+ response = await self.request(f"/v0/webhooks/{id}", method="GET")
167
+ return Webhook.model_validate(response)
168
+
169
+ async def list(self, *, cursor: Optional[str] = None, limit: Optional[int] = None) -> ListWebhooksResponse:
170
+ """List all Webhooks."""
171
+ params = {k: v for k, v in {"cursor": cursor, "limit": limit}.items() if v is not None}
172
+ response = await self.request("/v0/webhooks", params=params, method="GET")
173
+ return ListWebhooksResponse.model_validate(response)
174
+
175
+ async def update(self, id: str, params: Union[Dict[str, Any], UpdateWebhookParameters]) -> Webhook:
176
+ """Update a Webhook."""
177
+ response = await self.request(f"/v0/webhooks/{id}", data=params, method="PATCH")
178
+ return Webhook.model_validate(response)
179
+
180
+ async def delete(self, id: str) -> Webhook:
181
+ """Delete a Webhook."""
182
+ response = await self.request(f"/v0/webhooks/{id}", method="DELETE")
121
183
  return Webhook.model_validate(response)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: exa-py
3
- Version: 1.15.0
3
+ Version: 1.15.2
4
4
  Summary: Python SDK for Exa API.
5
5
  License: MIT
6
6
  Author: Exa AI
@@ -0,0 +1,37 @@
1
+ exa_py/__init__.py,sha256=M2GC9oSdoV6m2msboW0vMWWl8wrth4o6gmEV4MYLGG8,66
2
+ exa_py/api.py,sha256=ftJRM7qnF-Ki4agnG4PLtCn7YcrBV1JlC_TmhH5bbG4,109112
3
+ exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ exa_py/research/__init__.py,sha256=qbWY5c3LYBM7L4yGVtiMs9nUg_kMcAVhMhT0DvN6EI4,1014
5
+ exa_py/research/async_client.py,sha256=jP6BF8nc29Mt4iU2ZEQGAC5dGM-Z9I4k3pzpPcCKJIs,9436
6
+ exa_py/research/base.py,sha256=0C52XGUMRwRox1JSVBrbiHZxqPI6Cgif7EFNqYxpc40,5451
7
+ exa_py/research/models.py,sha256=2gu4jckbLYHlTmln8BhDzovuqg1fejTCncqi4r0oDow,9822
8
+ exa_py/research/sync_client.py,sha256=LHMkgqUZgKCQWgLP41Fj6EWLbt_YfX4aAgvWGjNgbXM,9155
9
+ exa_py/research/utils.py,sha256=YR61UkReyK-LrvOTaX_aG_neS1DsmCkv7B6YODpwHvU,5965
10
+ exa_py/utils.py,sha256=1jwKwcJwHSbrzwgMkprXSEZ-xssCtXxwf-GTRgaFmz8,6395
11
+ exa_py/websets/__init__.py,sha256=8ZWndRgeTKceZ3Wcm5xCh_dykrKkoCYdZdKcK7C3aSw,226
12
+ exa_py/websets/_generator/pydantic/BaseModel.jinja2,sha256=RUDCmPZVamoVx1WudylscYFfDhGoNNtRYlpTvKjAiuA,1276
13
+ exa_py/websets/async_client.py,sha256=fewb7T64Ip5R67sZ2fceHv-Lv0gJPqQrsXq-v6ZuZPY,5823
14
+ exa_py/websets/client.py,sha256=mdzZSfzgajfPQKWmjvwhUqjJSrtm3aErKcv4zcp7tWI,11137
15
+ exa_py/websets/core/__init__.py,sha256=L8dLhlle-Y7yoo0p0s60S07UyknyrcEn64W9JxkvCjM,458
16
+ exa_py/websets/core/async_base.py,sha256=RlJEaNR7OfZFzSy4sCk5aiPNT3cztuFZIyfP5vXMGtI,3121
17
+ exa_py/websets/core/base.py,sha256=RldWYwBg2iVfkWmdPke7xjXdwb4JKeABIOgiZtqvz-4,4125
18
+ exa_py/websets/enrichments/__init__.py,sha256=DA57V8s3169lfMnnLcFIOMQxhFIZ9I0uwXPYZMJzs9A,145
19
+ exa_py/websets/enrichments/client.py,sha256=EStsgPgAggEa0FiYrIG9HNZ30akuUrXtKY27f-Fa3sI,5903
20
+ exa_py/websets/events/__init__.py,sha256=VfJzObC3rSstdqz6q2ePnOIRW50GKJoSSH3-mpmDG0w,100
21
+ exa_py/websets/events/client.py,sha256=_jLGUlf27W5XYa7AeUVVvJ9hffwbPZ7981Qz-Fi6U1c,7691
22
+ exa_py/websets/imports/__init__.py,sha256=5fxYvRQdJQsVngvuq278Yw5W0Ckw17I_aPRrrtPcJ1w,105
23
+ exa_py/websets/imports/client.py,sha256=Zr_qWO1rhYTXm62Jz5bR7orfvzDhcb7pHVfeO8uvVmQ,13700
24
+ exa_py/websets/items/__init__.py,sha256=aJZto81Zp9eK1Dou2cFrRXgv3ZBuEvCHqb2G4KuKoao,121
25
+ exa_py/websets/items/client.py,sha256=74vRjMrEoy6cVA8679dFtD43IU2jKDH8Zlw4hLIRs8I,6027
26
+ exa_py/websets/monitors/__init__.py,sha256=cTRxTrsUuQmmmVEN3ewKsOq26xxiBJKTy7v0UjdOooc,216
27
+ exa_py/websets/monitors/client.py,sha256=PmIkizecQSLnicKpIPEBJafId9rx_iJlP-LD_ApuAik,5333
28
+ exa_py/websets/monitors/runs/__init__.py,sha256=rfE6PmQds4uPAd0fN3u992pG7INwbx1QvdyH8M-t8rs,121
29
+ exa_py/websets/monitors/runs/client.py,sha256=_fMPqxzF0gy5g76wU6N8i7XrKTtq5vaOrrIzXkM1ZcA,1985
30
+ exa_py/websets/searches/__init__.py,sha256=w6fJnCTKwl07GWgRVKQbYkPcoAct975YyOZog37C2q8,133
31
+ exa_py/websets/searches/client.py,sha256=_mCuQtdLvKus5ofgs2a9MtY56Zg07JBJzqIg6YWre2A,3495
32
+ exa_py/websets/types.py,sha256=naBzmlJ-nZK3ynDGBE15lmItD5p8-x_OfsWGFpKZRDs,50874
33
+ exa_py/websets/webhooks/__init__.py,sha256=DMl6RFkS0c79AWzkuHOXnaU5QKHmkIHYW2PhZWUFIGc,191
34
+ exa_py/websets/webhooks/client.py,sha256=rdYU0DZKAslw5LwGKB567j3T8L34ZF9tSnlN9jLi23A,7143
35
+ exa_py-1.15.2.dist-info/METADATA,sha256=Izyx0YsIaj8Q8bztKKC0UD1L75KJHJrZsMjZ_CVbLv0,3826
36
+ exa_py-1.15.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
37
+ exa_py-1.15.2.dist-info/RECORD,,
@@ -1,35 +0,0 @@
1
- exa_py/__init__.py,sha256=M2GC9oSdoV6m2msboW0vMWWl8wrth4o6gmEV4MYLGG8,66
2
- exa_py/api.py,sha256=gUvQ2NXtUgBlrFrWrCIUwiq-z2lAlo_gWVFncN68Vhw,108947
3
- exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- exa_py/research/__init__.py,sha256=qbWY5c3LYBM7L4yGVtiMs9nUg_kMcAVhMhT0DvN6EI4,1014
5
- exa_py/research/async_client.py,sha256=jP6BF8nc29Mt4iU2ZEQGAC5dGM-Z9I4k3pzpPcCKJIs,9436
6
- exa_py/research/base.py,sha256=0C52XGUMRwRox1JSVBrbiHZxqPI6Cgif7EFNqYxpc40,5451
7
- exa_py/research/models.py,sha256=2gu4jckbLYHlTmln8BhDzovuqg1fejTCncqi4r0oDow,9822
8
- exa_py/research/sync_client.py,sha256=LHMkgqUZgKCQWgLP41Fj6EWLbt_YfX4aAgvWGjNgbXM,9155
9
- exa_py/research/utils.py,sha256=YR61UkReyK-LrvOTaX_aG_neS1DsmCkv7B6YODpwHvU,5965
10
- exa_py/utils.py,sha256=1jwKwcJwHSbrzwgMkprXSEZ-xssCtXxwf-GTRgaFmz8,6395
11
- exa_py/websets/__init__.py,sha256=x7Dc0MS8raRXA7Ud6alKgnsUmLi6X9GTqfB8kOwC9iQ,179
12
- exa_py/websets/_generator/pydantic/BaseModel.jinja2,sha256=RUDCmPZVamoVx1WudylscYFfDhGoNNtRYlpTvKjAiuA,1276
13
- exa_py/websets/client.py,sha256=sKkji8QaPFnGM1-J5TB6yKJcGAEd6gk7lsnIebzXNQ8,5856
14
- exa_py/websets/core/__init__.py,sha256=xOyrFaqtBocMUu321Jpbk7IzIQRNZufSIGJXrKoG-Bg,323
15
- exa_py/websets/core/base.py,sha256=RldWYwBg2iVfkWmdPke7xjXdwb4JKeABIOgiZtqvz-4,4125
16
- exa_py/websets/enrichments/__init__.py,sha256=5dJIEKKceUost3RnI6PpCSB3VjUCBzxseEsIXu-ZY-Y,83
17
- exa_py/websets/enrichments/client.py,sha256=obUjn4vH6tKBMtHEBVdMzlN8in0Fx3sCP-bXx-Le1zM,2338
18
- exa_py/websets/events/__init__.py,sha256=aFJ9O5UudtQQzndVmdB96IaM2l07qyM1B_8xKY7rp58,60
19
- exa_py/websets/events/client.py,sha256=Hzatqp3X-K0ZGe36cjFMgbhnsErcDLdGWQVirhmHjvY,3622
20
- exa_py/websets/imports/__init__.py,sha256=iEl-fZZSdcvKaqLgjMES_0RwYn7hZDCMf6BZriCrjgw,64
21
- exa_py/websets/imports/client.py,sha256=nJs46hxlSkZm7qjboYHNBuJ62gLmA_Yzr9fc-NDky0Y,6795
22
- exa_py/websets/items/__init__.py,sha256=DCWZJVtRmUjnMEkKdb5gW1LT9cHcb-J8lENMnyyBeKU,71
23
- exa_py/websets/items/client.py,sha256=stAQ47AgkJdEsNb1E_YAXLe96VrtglOZsG79KVcy--M,3038
24
- exa_py/websets/monitors/__init__.py,sha256=jfr-gq8eKVa_gNe_DEqX9XCZPbJjpOe7QpH_D4RCFJQ,122
25
- exa_py/websets/monitors/client.py,sha256=fFxCSngkUPXqf9ilUMl8DaO2ihYveD-WfSoqARwf1eQ,3526
26
- exa_py/websets/monitors/runs/__init__.py,sha256=TmcETf3zdQouA_vAeLiosCNL1MYJnZ0yW2sbOAjTmm8,71
27
- exa_py/websets/monitors/runs/client.py,sha256=WnwcWCf7UKk68VCNUp8mRXBtlU8vglTSX-eoWVXzKIw,1229
28
- exa_py/websets/searches/__init__.py,sha256=_0Zx8ES5fFTEL3T8mhLxq_xK2t0JONx6ad6AtbvClsE,77
29
- exa_py/websets/searches/client.py,sha256=X3f7axWGfecmxf-2tBTX0Yf_--xToz1X8ZHbbudEzy0,1790
30
- exa_py/websets/types.py,sha256=DxO_T4Ijnd06gxFAX3f238Mt5P0_ulpY44M1kiT4y4U,47120
31
- exa_py/websets/webhooks/__init__.py,sha256=iTPBCxFd73z4RifLQMX6iRECx_6pwlI5qscLNjMOUHE,77
32
- exa_py/websets/webhooks/client.py,sha256=zS1eoWKliuiY4AIeFJdpAlPZeOINyphn7KEWANF-zaE,4384
33
- exa_py-1.15.0.dist-info/METADATA,sha256=QTMlL2y63YGWPWdSrQy-BkoDSAZ-axbTMVEtPhE_H0c,3826
34
- exa_py-1.15.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
35
- exa_py-1.15.0.dist-info/RECORD,,