exa-py 1.14.11__py3-none-any.whl → 1.14.13__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/__init__.py +2 -0
- exa_py/websets/_generator/pydantic/BaseModel.jinja2 +42 -0
- exa_py/websets/client.py +2 -0
- exa_py/websets/events/__init__.py +3 -0
- exa_py/websets/events/client.py +106 -0
- exa_py/websets/types.py +31 -15
- {exa_py-1.14.11.dist-info → exa_py-1.14.13.dist-info}/METADATA +18 -16
- {exa_py-1.14.11.dist-info → exa_py-1.14.13.dist-info}/RECORD +10 -8
- {exa_py-1.14.11.dist-info → exa_py-1.14.13.dist-info}/WHEEL +1 -2
- exa_py-1.14.11.dist-info/top_level.txt +0 -1
exa_py/websets/__init__.py
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{% for decorator in decorators -%}
|
|
2
|
+
{{ decorator }}
|
|
3
|
+
{% endfor -%}
|
|
4
|
+
class {{ class_name }}({{ base_class }}):{% if comment is defined %} # {{ comment }}{% endif %}
|
|
5
|
+
{%- if description %}
|
|
6
|
+
"""
|
|
7
|
+
{{ description | indent(4) }}
|
|
8
|
+
"""
|
|
9
|
+
{%- endif %}
|
|
10
|
+
{%- if not fields and not description %}
|
|
11
|
+
pass
|
|
12
|
+
{%- endif %}
|
|
13
|
+
{%- if config %}
|
|
14
|
+
{%- filter indent(4) %}
|
|
15
|
+
{%- endfilter %}
|
|
16
|
+
{%- endif %}
|
|
17
|
+
{%- for field in fields -%}
|
|
18
|
+
{%- if field.name == "type" and field.field %}
|
|
19
|
+
type: Literal['{{ field.default }}']
|
|
20
|
+
{%- elif field.name == "object" and field.field %}
|
|
21
|
+
object: Literal['{{ field.default }}']
|
|
22
|
+
{%- elif not field.annotated and field.field %}
|
|
23
|
+
{{ field.name }}: {{ field.type_hint }} = {{ field.field }}
|
|
24
|
+
{%- else %}
|
|
25
|
+
{%- if field.annotated %}
|
|
26
|
+
{{ field.name }}: {{ field.annotated }}
|
|
27
|
+
{%- else %}
|
|
28
|
+
{{ field.name }}: {{ field.type_hint }}
|
|
29
|
+
{%- endif %}
|
|
30
|
+
{%- if not (field.required or (field.represented_default == 'None' and field.strip_default_none)) or field.data_type.is_optional
|
|
31
|
+
%} = {{ field.represented_default }}
|
|
32
|
+
{%- endif -%}
|
|
33
|
+
{%- endif %}
|
|
34
|
+
{%- if field.docstring %}
|
|
35
|
+
"""
|
|
36
|
+
{{ field.docstring | indent(4) }}
|
|
37
|
+
"""
|
|
38
|
+
{%- endif %}
|
|
39
|
+
{%- for method in methods -%}
|
|
40
|
+
{{ method }}
|
|
41
|
+
{%- endfor -%}
|
|
42
|
+
{%- endfor -%}
|
exa_py/websets/client.py
CHANGED
|
@@ -18,6 +18,7 @@ from .enrichments import WebsetEnrichmentsClient
|
|
|
18
18
|
from .webhooks import WebsetWebhooksClient
|
|
19
19
|
from .monitors import MonitorsClient
|
|
20
20
|
from .imports import ImportsClient
|
|
21
|
+
from .events import EventsClient
|
|
21
22
|
|
|
22
23
|
class WebsetsClient(WebsetsBaseClient):
|
|
23
24
|
"""Client for managing Websets."""
|
|
@@ -30,6 +31,7 @@ class WebsetsClient(WebsetsBaseClient):
|
|
|
30
31
|
self.webhooks = WebsetWebhooksClient(client)
|
|
31
32
|
self.monitors = MonitorsClient(client)
|
|
32
33
|
self.imports = ImportsClient(client)
|
|
34
|
+
self.events = EventsClient(client)
|
|
33
35
|
|
|
34
36
|
def create(self, params: Union[Dict[str, Any], CreateWebsetParameters]) -> Webset:
|
|
35
37
|
"""Create a new Webset.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional, Union
|
|
4
|
+
|
|
5
|
+
from ..types import (
|
|
6
|
+
EventType,
|
|
7
|
+
ListEventsResponse,
|
|
8
|
+
WebsetCreatedEvent,
|
|
9
|
+
WebsetDeletedEvent,
|
|
10
|
+
WebsetIdleEvent,
|
|
11
|
+
WebsetPausedEvent,
|
|
12
|
+
WebsetItemCreatedEvent,
|
|
13
|
+
WebsetItemEnrichedEvent,
|
|
14
|
+
WebsetSearchCreatedEvent,
|
|
15
|
+
WebsetSearchUpdatedEvent,
|
|
16
|
+
WebsetSearchCanceledEvent,
|
|
17
|
+
WebsetSearchCompletedEvent,
|
|
18
|
+
)
|
|
19
|
+
from ..core.base import WebsetsBaseClient
|
|
20
|
+
|
|
21
|
+
# Type alias for all event types
|
|
22
|
+
Event = Union[
|
|
23
|
+
WebsetCreatedEvent,
|
|
24
|
+
WebsetDeletedEvent,
|
|
25
|
+
WebsetIdleEvent,
|
|
26
|
+
WebsetPausedEvent,
|
|
27
|
+
WebsetItemCreatedEvent,
|
|
28
|
+
WebsetItemEnrichedEvent,
|
|
29
|
+
WebsetSearchCreatedEvent,
|
|
30
|
+
WebsetSearchUpdatedEvent,
|
|
31
|
+
WebsetSearchCanceledEvent,
|
|
32
|
+
WebsetSearchCompletedEvent,
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
class EventsClient(WebsetsBaseClient):
|
|
36
|
+
"""Client for managing Events."""
|
|
37
|
+
|
|
38
|
+
def __init__(self, client):
|
|
39
|
+
super().__init__(client)
|
|
40
|
+
|
|
41
|
+
def list(self, *, cursor: Optional[str] = None, limit: Optional[int] = None,
|
|
42
|
+
types: Optional[List[EventType]] = None) -> ListEventsResponse:
|
|
43
|
+
"""List all Events.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
cursor (str, optional): The cursor to paginate through the results.
|
|
47
|
+
limit (int, optional): The number of results to return.
|
|
48
|
+
types (List[EventType], optional): The types of events to filter by.
|
|
49
|
+
|
|
50
|
+
Returns:
|
|
51
|
+
ListEventsResponse: List of events.
|
|
52
|
+
"""
|
|
53
|
+
params = {}
|
|
54
|
+
if cursor is not None:
|
|
55
|
+
params["cursor"] = cursor
|
|
56
|
+
if limit is not None:
|
|
57
|
+
params["limit"] = limit
|
|
58
|
+
if types is not None:
|
|
59
|
+
# Convert EventType enums to their string values
|
|
60
|
+
params["types"] = [t.value if hasattr(t, 'value') else t for t in types]
|
|
61
|
+
|
|
62
|
+
response = self.request("/v0/events", params=params, method="GET")
|
|
63
|
+
return ListEventsResponse.model_validate(response)
|
|
64
|
+
|
|
65
|
+
def get(self, id: str) -> Event:
|
|
66
|
+
"""Get an Event by ID.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
id (str): The ID of the Event.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
Event: The retrieved event.
|
|
73
|
+
"""
|
|
74
|
+
response = self.request(f"/v0/events/{id}", method="GET")
|
|
75
|
+
|
|
76
|
+
# The response should contain a 'type' field that helps us determine
|
|
77
|
+
# which specific event class to use for validation
|
|
78
|
+
event_type = response.get('type')
|
|
79
|
+
|
|
80
|
+
# Map event types to their corresponding classes
|
|
81
|
+
event_type_map = {
|
|
82
|
+
'webset.created': WebsetCreatedEvent,
|
|
83
|
+
'webset.deleted': WebsetDeletedEvent,
|
|
84
|
+
'webset.idle': WebsetIdleEvent,
|
|
85
|
+
'webset.paused': WebsetPausedEvent,
|
|
86
|
+
'webset.item.created': WebsetItemCreatedEvent,
|
|
87
|
+
'webset.item.enriched': WebsetItemEnrichedEvent,
|
|
88
|
+
'webset.search.created': WebsetSearchCreatedEvent,
|
|
89
|
+
'webset.search.updated': WebsetSearchUpdatedEvent,
|
|
90
|
+
'webset.search.canceled': WebsetSearchCanceledEvent,
|
|
91
|
+
'webset.search.completed': WebsetSearchCompletedEvent,
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
event_class = event_type_map.get(event_type)
|
|
95
|
+
if event_class:
|
|
96
|
+
return event_class.model_validate(response)
|
|
97
|
+
else:
|
|
98
|
+
# Fallback - try each type until one validates
|
|
99
|
+
# This shouldn't happen in normal operation
|
|
100
|
+
for event_class in event_type_map.values():
|
|
101
|
+
try:
|
|
102
|
+
return event_class.model_validate(response)
|
|
103
|
+
except Exception:
|
|
104
|
+
continue
|
|
105
|
+
|
|
106
|
+
raise ValueError(f"Unknown event type: {event_type}")
|
exa_py/websets/types.py
CHANGED
|
@@ -6,7 +6,7 @@ from __future__ import annotations
|
|
|
6
6
|
|
|
7
7
|
from datetime import datetime
|
|
8
8
|
from enum import Enum
|
|
9
|
-
from typing import Any, Dict, List, Literal, Optional, Union
|
|
9
|
+
from typing import Any, Dict, List, Literal, Optional, Union, Annotated
|
|
10
10
|
|
|
11
11
|
from pydantic import AnyUrl, Field, PositiveInt, confloat, constr
|
|
12
12
|
from .core.base import ExaBaseModel
|
|
@@ -287,20 +287,21 @@ class ImportSource(Enum):
|
|
|
287
287
|
|
|
288
288
|
|
|
289
289
|
class ListEventsResponse(ExaBaseModel):
|
|
290
|
-
data: List[
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
290
|
+
data: List[Annotated[
|
|
291
|
+
Union[
|
|
292
|
+
WebsetCreatedEvent,
|
|
293
|
+
WebsetDeletedEvent,
|
|
294
|
+
WebsetIdleEvent,
|
|
295
|
+
WebsetPausedEvent,
|
|
296
|
+
WebsetItemCreatedEvent,
|
|
297
|
+
WebsetItemEnrichedEvent,
|
|
298
|
+
WebsetSearchCreatedEvent,
|
|
299
|
+
WebsetSearchUpdatedEvent,
|
|
300
|
+
WebsetSearchCanceledEvent,
|
|
301
|
+
WebsetSearchCompletedEvent,
|
|
302
|
+
],
|
|
303
|
+
Field(discriminator='type')
|
|
304
|
+
]]
|
|
304
305
|
"""
|
|
305
306
|
The list of events
|
|
306
307
|
"""
|
|
@@ -1440,6 +1441,17 @@ class WebsetItemPersonProperties(ExaBaseModel):
|
|
|
1440
1441
|
"""
|
|
1441
1442
|
|
|
1442
1443
|
|
|
1444
|
+
class WebsetItemPersonCompanyPropertiesFields(ExaBaseModel):
|
|
1445
|
+
name: str
|
|
1446
|
+
"""
|
|
1447
|
+
The name of the company
|
|
1448
|
+
"""
|
|
1449
|
+
location: Optional[str] = None
|
|
1450
|
+
"""
|
|
1451
|
+
The location the person is working at the company
|
|
1452
|
+
"""
|
|
1453
|
+
|
|
1454
|
+
|
|
1443
1455
|
class WebsetItemPersonPropertiesFields(ExaBaseModel):
|
|
1444
1456
|
name: str
|
|
1445
1457
|
"""
|
|
@@ -1453,6 +1465,10 @@ class WebsetItemPersonPropertiesFields(ExaBaseModel):
|
|
|
1453
1465
|
"""
|
|
1454
1466
|
The current work position of the person
|
|
1455
1467
|
"""
|
|
1468
|
+
company: Optional[WebsetItemPersonCompanyPropertiesFields] = None
|
|
1469
|
+
"""
|
|
1470
|
+
The company the person is working at
|
|
1471
|
+
"""
|
|
1456
1472
|
picture_url: Optional[AnyUrl] = Field(None, alias='pictureUrl')
|
|
1457
1473
|
"""
|
|
1458
1474
|
The URL of the person's picture
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: exa-py
|
|
3
|
-
Version: 1.14.
|
|
3
|
+
Version: 1.14.13
|
|
4
4
|
Summary: Python SDK for Exa API.
|
|
5
|
-
Home-page: https://github.com/exa-labs/exa-py
|
|
6
|
-
Author: Exa
|
|
7
|
-
Author-email: Exa AI <hello@exa.ai>
|
|
8
5
|
License: MIT
|
|
6
|
+
Author: Exa AI
|
|
7
|
+
Author-email: hello@exa.ai
|
|
9
8
|
Requires-Python: >=3.9
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Dist: httpx (>=0.28.1)
|
|
17
|
+
Requires-Dist: openai (>=1.48)
|
|
18
|
+
Requires-Dist: pydantic (>=2.10.6)
|
|
19
|
+
Requires-Dist: requests (>=2.32.3)
|
|
20
|
+
Requires-Dist: typing-extensions (>=4.12.2)
|
|
10
21
|
Description-Content-Type: text/markdown
|
|
11
|
-
Requires-Dist: requests>=2.32.3
|
|
12
|
-
Requires-Dist: typing-extensions>=4.12.2
|
|
13
|
-
Requires-Dist: openai>=1.48
|
|
14
|
-
Requires-Dist: pydantic>=2.10.6
|
|
15
|
-
Requires-Dist: httpx>=0.28.1
|
|
16
|
-
Dynamic: author
|
|
17
|
-
Dynamic: home-page
|
|
18
22
|
|
|
19
23
|
# Exa
|
|
20
24
|
|
|
21
|
-
Exa
|
|
22
|
-
|
|
23
|
-
Note: This API is basically the same as `metaphor-python` but reflects new
|
|
24
|
-
features associated with Metaphor's rename to Exa. New site is https://exa.ai
|
|
25
|
+
Exa API in Python
|
|
25
26
|
|
|
26
27
|
## Installation
|
|
27
28
|
|
|
@@ -126,3 +127,4 @@ exa = Exa(api_key="your-api-key")
|
|
|
126
127
|
output_schema=OUTPUT_SCHEMA,
|
|
127
128
|
)
|
|
128
129
|
```
|
|
130
|
+
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
exa_py/__init__.py,sha256=M2GC9oSdoV6m2msboW0vMWWl8wrth4o6gmEV4MYLGG8,66
|
|
2
2
|
exa_py/api.py,sha256=IrToa0zN39SREpwwcyuFvnoE_-pIc9uWVDkEw07IN9I,99737
|
|
3
3
|
exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
exa_py/utils.py,sha256=sq1KOajuMWI1lygYeb9MqjXn8yqVyK0BtFZZmTwSaMY,2580
|
|
5
4
|
exa_py/research/__init__.py,sha256=QeY-j6bP4QP5tF9ytX0IeQhJvd0Wn4cJCD69U8pP7kA,271
|
|
6
5
|
exa_py/research/client.py,sha256=x9b299ROfbhdMrdto6jZCHGRJE5U5V2fWHsSlnnNkWo,12471
|
|
7
6
|
exa_py/research/models.py,sha256=j7YgRoMRp2MLgnaij7775x_hJEeV5gksKpfLwmawqxY,3704
|
|
8
|
-
exa_py/
|
|
9
|
-
exa_py/websets/
|
|
10
|
-
exa_py/websets/
|
|
7
|
+
exa_py/utils.py,sha256=sq1KOajuMWI1lygYeb9MqjXn8yqVyK0BtFZZmTwSaMY,2580
|
|
8
|
+
exa_py/websets/__init__.py,sha256=x7Dc0MS8raRXA7Ud6alKgnsUmLi6X9GTqfB8kOwC9iQ,179
|
|
9
|
+
exa_py/websets/_generator/pydantic/BaseModel.jinja2,sha256=RUDCmPZVamoVx1WudylscYFfDhGoNNtRYlpTvKjAiuA,1276
|
|
10
|
+
exa_py/websets/client.py,sha256=v8Y0p5PosjLkb7EYQ83g3nmoIIHmKaXF7JQVT8K5h2E,4967
|
|
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
|
+
exa_py/websets/events/__init__.py,sha256=aFJ9O5UudtQQzndVmdB96IaM2l07qyM1B_8xKY7rp58,60
|
|
16
|
+
exa_py/websets/events/client.py,sha256=Hzatqp3X-K0ZGe36cjFMgbhnsErcDLdGWQVirhmHjvY,3622
|
|
15
17
|
exa_py/websets/imports/__init__.py,sha256=iEl-fZZSdcvKaqLgjMES_0RwYn7hZDCMf6BZriCrjgw,64
|
|
16
18
|
exa_py/websets/imports/client.py,sha256=nJs46hxlSkZm7qjboYHNBuJ62gLmA_Yzr9fc-NDky0Y,6795
|
|
17
19
|
exa_py/websets/items/__init__.py,sha256=DCWZJVtRmUjnMEkKdb5gW1LT9cHcb-J8lENMnyyBeKU,71
|
|
@@ -22,9 +24,9 @@ exa_py/websets/monitors/runs/__init__.py,sha256=TmcETf3zdQouA_vAeLiosCNL1MYJnZ0y
|
|
|
22
24
|
exa_py/websets/monitors/runs/client.py,sha256=WnwcWCf7UKk68VCNUp8mRXBtlU8vglTSX-eoWVXzKIw,1229
|
|
23
25
|
exa_py/websets/searches/__init__.py,sha256=_0Zx8ES5fFTEL3T8mhLxq_xK2t0JONx6ad6AtbvClsE,77
|
|
24
26
|
exa_py/websets/searches/client.py,sha256=X3f7axWGfecmxf-2tBTX0Yf_--xToz1X8ZHbbudEzy0,1790
|
|
27
|
+
exa_py/websets/types.py,sha256=ykJHPXNiqr2fbRYYprshgBcG9X5IRRwi2mu56g7XCZA,42085
|
|
25
28
|
exa_py/websets/webhooks/__init__.py,sha256=iTPBCxFd73z4RifLQMX6iRECx_6pwlI5qscLNjMOUHE,77
|
|
26
29
|
exa_py/websets/webhooks/client.py,sha256=zsIRMTeJU65yj-zo7Zz-gG02Prtzgcx6utGFSoY4HQQ,4222
|
|
27
|
-
exa_py-1.14.
|
|
28
|
-
exa_py-1.14.
|
|
29
|
-
exa_py-1.14.
|
|
30
|
-
exa_py-1.14.11.dist-info/RECORD,,
|
|
30
|
+
exa_py-1.14.13.dist-info/METADATA,sha256=MEEv757QrOECC36EpaB_c4g5qKyJDH08TFR_wt4Jk8g,3827
|
|
31
|
+
exa_py-1.14.13.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
32
|
+
exa_py-1.14.13.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exa_py
|