exa-py 1.9.0__py3-none-any.whl → 1.9.1__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/api.py +29 -7
- exa_py/websets/__init__.py +5 -0
- exa_py/websets/_generator/pydantic/BaseModel.jinja2 +42 -0
- exa_py/websets/client.py +126 -0
- exa_py/websets/core/__init__.py +9 -0
- exa_py/websets/core/base.py +41 -0
- exa_py/websets/enrichments/__init__.py +3 -0
- exa_py/websets/enrichments/client.py +65 -0
- exa_py/websets/items/__init__.py +3 -0
- exa_py/websets/items/client.py +78 -0
- exa_py/websets/searches/__init__.py +3 -0
- exa_py/websets/searches/client.py +52 -0
- exa_py/websets/types.py +1054 -0
- exa_py/websets/webhooks/__init__.py +3 -0
- exa_py/websets/webhooks/client.py +80 -0
- {exa_py-1.9.0.dist-info → exa_py-1.9.1.dist-info}/METADATA +3 -1
- exa_py-1.9.1.dist-info/RECORD +21 -0
- exa_py-1.9.0.dist-info/RECORD +0 -7
- {exa_py-1.9.0.dist-info → exa_py-1.9.1.dist-info}/WHEEL +0 -0
exa_py/websets/types.py
ADDED
|
@@ -0,0 +1,1054 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Any, Dict, List, Literal, Optional, Union
|
|
6
|
+
|
|
7
|
+
from pydantic import AnyUrl, Field, confloat, constr
|
|
8
|
+
from .core.base import ExaBaseModel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class CanceledReason(Enum):
|
|
12
|
+
"""
|
|
13
|
+
The reason the search was canceled
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
webset_deleted = 'webset_deleted'
|
|
17
|
+
webset_canceled = 'webset_canceled'
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class CreateCriterionParameters(ExaBaseModel):
|
|
21
|
+
description: constr(min_length=1, max_length=300)
|
|
22
|
+
"""
|
|
23
|
+
The description of the criterion
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class CreateEnrichmentParameters(ExaBaseModel):
|
|
28
|
+
description: constr(min_length=1, max_length=5000)
|
|
29
|
+
"""
|
|
30
|
+
Provide a description of the enrichment task you want to perform to each Webset Item.
|
|
31
|
+
"""
|
|
32
|
+
format: Optional[str] = None
|
|
33
|
+
"""
|
|
34
|
+
Format of the enrichment response.
|
|
35
|
+
|
|
36
|
+
We automatically select the best format based on the description. If you want to explicitly specify the format, you can do so here.
|
|
37
|
+
"""
|
|
38
|
+
options: Optional[List[Option]] = Field(None, max_items=20, min_items=1)
|
|
39
|
+
"""
|
|
40
|
+
When the format is options, the different options for the enrichment agent to choose from.
|
|
41
|
+
"""
|
|
42
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
43
|
+
"""
|
|
44
|
+
Set of key-value pairs you want to associate with this object.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class CreateWebhookParameters(ExaBaseModel):
|
|
49
|
+
events: List[Event] = Field(..., max_items=12, min_items=1)
|
|
50
|
+
"""
|
|
51
|
+
The events to trigger the webhook
|
|
52
|
+
"""
|
|
53
|
+
url: AnyUrl
|
|
54
|
+
"""
|
|
55
|
+
The URL to send the webhook to
|
|
56
|
+
"""
|
|
57
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
58
|
+
"""
|
|
59
|
+
Set of key-value pairs you want to associate with this object.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class CreateWebsetParameters(ExaBaseModel):
|
|
64
|
+
search: Search
|
|
65
|
+
"""
|
|
66
|
+
Create initial search for the Webset.
|
|
67
|
+
"""
|
|
68
|
+
enrichments: Optional[List[CreateEnrichmentParameters]] = Field(None, max_items=10)
|
|
69
|
+
"""
|
|
70
|
+
Add Enrichments for the Webset.
|
|
71
|
+
"""
|
|
72
|
+
external_id: Optional[str] = Field(None, alias='externalId')
|
|
73
|
+
"""
|
|
74
|
+
The external identifier for the webset.
|
|
75
|
+
|
|
76
|
+
You can use this to reference the Webset by your own internal identifiers.
|
|
77
|
+
"""
|
|
78
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
79
|
+
"""
|
|
80
|
+
Set of key-value pairs you want to associate with this object.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class CreateWebsetSearchParameters(ExaBaseModel):
|
|
85
|
+
count: confloat(ge=1.0)
|
|
86
|
+
"""
|
|
87
|
+
Number of Items the Search will attempt to find.
|
|
88
|
+
|
|
89
|
+
The actual number of Items found may be less than this number depending on the query complexity.
|
|
90
|
+
"""
|
|
91
|
+
query: constr(min_length=1, max_length=5000) = Field(
|
|
92
|
+
...,
|
|
93
|
+
examples=[
|
|
94
|
+
'Marketing agencies based in the US, that focus on consumer products. Get brands worked with and city'
|
|
95
|
+
],
|
|
96
|
+
)
|
|
97
|
+
"""
|
|
98
|
+
Query describing what you are looking for.
|
|
99
|
+
|
|
100
|
+
Any URL provided will be crawled and used as context for the search.
|
|
101
|
+
"""
|
|
102
|
+
entity: Optional[
|
|
103
|
+
Union[
|
|
104
|
+
WebsetCompanyEntity,
|
|
105
|
+
WebsetPersonEntity,
|
|
106
|
+
WebsetArticleEntity,
|
|
107
|
+
WebsetResearchPaperEntity,
|
|
108
|
+
WebsetCustomEntity,
|
|
109
|
+
]
|
|
110
|
+
] = None
|
|
111
|
+
"""
|
|
112
|
+
Entity the Webset will return results for.
|
|
113
|
+
|
|
114
|
+
It is not required to provide it, we automatically detect the entity from all the information provided in the query.
|
|
115
|
+
"""
|
|
116
|
+
criteria: Optional[List[CreateCriterionParameters]] = Field(
|
|
117
|
+
None, max_items=5, min_items=1
|
|
118
|
+
)
|
|
119
|
+
"""
|
|
120
|
+
Criteria every item is evaluated against.
|
|
121
|
+
|
|
122
|
+
It's not required to provide your own criteria, we automatically detect the criteria from all the information provided in the query.
|
|
123
|
+
"""
|
|
124
|
+
behaviour: Optional[WebsetSearchBehaviour] = Field(
|
|
125
|
+
'override', title='WebsetSearchBehaviour'
|
|
126
|
+
)
|
|
127
|
+
"""
|
|
128
|
+
The behaviour of the Search when it is added to a Webset.
|
|
129
|
+
|
|
130
|
+
- `override`: the search will reuse the existing Items found in the Webset and evaluate them against the new criteria. Any Items that don't match the new criteria will not be discarded.
|
|
131
|
+
"""
|
|
132
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
133
|
+
"""
|
|
134
|
+
Set of key-value pairs you want to associate with this object.
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class Criterion(ExaBaseModel):
|
|
139
|
+
description: constr(min_length=1, max_length=300)
|
|
140
|
+
"""
|
|
141
|
+
The description of the criterion
|
|
142
|
+
"""
|
|
143
|
+
success_rate: confloat(ge=0.0, le=100.0) = Field(..., alias='successRate')
|
|
144
|
+
"""
|
|
145
|
+
Value between 0 and 100 representing the percentage of results that meet the criterion.
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class EnrichmentResult(ExaBaseModel):
|
|
150
|
+
object: Literal['enrichment_result']
|
|
151
|
+
format: WebsetEnrichmentFormat
|
|
152
|
+
result: List[str]
|
|
153
|
+
"""
|
|
154
|
+
The result of the enrichment.
|
|
155
|
+
"""
|
|
156
|
+
reasoning: Optional[str] = None
|
|
157
|
+
"""
|
|
158
|
+
The reasoning for the result when an Agent is used.
|
|
159
|
+
"""
|
|
160
|
+
references: List[Reference]
|
|
161
|
+
"""
|
|
162
|
+
The references used to generate the result.
|
|
163
|
+
"""
|
|
164
|
+
enrichment_id: str = Field(..., alias='enrichmentId')
|
|
165
|
+
"""
|
|
166
|
+
The id of the Enrichment that generated the result
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class Event(Enum):
|
|
171
|
+
webset_created = 'webset.created'
|
|
172
|
+
webset_deleted = 'webset.deleted'
|
|
173
|
+
webset_paused = 'webset.paused'
|
|
174
|
+
webset_idle = 'webset.idle'
|
|
175
|
+
webset_search_created = 'webset.search.created'
|
|
176
|
+
webset_search_canceled = 'webset.search.canceled'
|
|
177
|
+
webset_search_completed = 'webset.search.completed'
|
|
178
|
+
webset_search_updated = 'webset.search.updated'
|
|
179
|
+
webset_export_created = 'webset.export.created'
|
|
180
|
+
webset_export_completed = 'webset.export.completed'
|
|
181
|
+
webset_item_created = 'webset.item.created'
|
|
182
|
+
webset_item_enriched = 'webset.item.enriched'
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
class Format(Enum):
|
|
186
|
+
"""
|
|
187
|
+
Format of the enrichment response.
|
|
188
|
+
|
|
189
|
+
We automatically select the best format based on the description. If you want to explicitly specify the format, you can do so here.
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
text = 'text'
|
|
193
|
+
date = 'date'
|
|
194
|
+
number = 'number'
|
|
195
|
+
options = 'options'
|
|
196
|
+
email = 'email'
|
|
197
|
+
phone = 'phone'
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class ListEventsResponse(ExaBaseModel):
|
|
201
|
+
data: List[
|
|
202
|
+
Union[
|
|
203
|
+
WebsetCreatedEvent,
|
|
204
|
+
WebsetDeletedEvent,
|
|
205
|
+
WebsetIdleEvent,
|
|
206
|
+
WebsetPausedEvent,
|
|
207
|
+
WebsetItemCreatedEvent,
|
|
208
|
+
WebsetItemEnrichedEvent,
|
|
209
|
+
WebsetSearchCreatedEvent,
|
|
210
|
+
WebsetSearchUpdatedEvent,
|
|
211
|
+
WebsetSearchCanceledEvent,
|
|
212
|
+
WebsetSearchCompletedEvent,
|
|
213
|
+
]
|
|
214
|
+
] = Field(..., discriminator='type')
|
|
215
|
+
"""
|
|
216
|
+
The list of events
|
|
217
|
+
"""
|
|
218
|
+
has_more: bool = Field(..., alias='hasMore')
|
|
219
|
+
"""
|
|
220
|
+
Whether there are more results to paginate through
|
|
221
|
+
"""
|
|
222
|
+
next_cursor: Optional[str] = Field(..., alias='nextCursor')
|
|
223
|
+
"""
|
|
224
|
+
The cursor to paginate through the next set of results
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
class ListWebhooksResponse(ExaBaseModel):
|
|
229
|
+
data: List[Webhook]
|
|
230
|
+
"""
|
|
231
|
+
The list of webhooks
|
|
232
|
+
"""
|
|
233
|
+
has_more: bool = Field(..., alias='hasMore')
|
|
234
|
+
"""
|
|
235
|
+
Whether there are more results to paginate through
|
|
236
|
+
"""
|
|
237
|
+
next_cursor: Optional[str] = Field(..., alias='nextCursor')
|
|
238
|
+
"""
|
|
239
|
+
The cursor to paginate through the next set of results
|
|
240
|
+
"""
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
class ListWebsetItemResponse(ExaBaseModel):
|
|
244
|
+
data: List[WebsetItem]
|
|
245
|
+
"""
|
|
246
|
+
The list of webset items
|
|
247
|
+
"""
|
|
248
|
+
has_more: bool = Field(..., alias='hasMore')
|
|
249
|
+
"""
|
|
250
|
+
Whether there are more Items to paginate through
|
|
251
|
+
"""
|
|
252
|
+
next_cursor: Optional[str] = Field(..., alias='nextCursor')
|
|
253
|
+
"""
|
|
254
|
+
The cursor to paginate through the next set of Items
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
class ListWebsetsResponse(ExaBaseModel):
|
|
259
|
+
data: List[Webset]
|
|
260
|
+
"""
|
|
261
|
+
The list of websets
|
|
262
|
+
"""
|
|
263
|
+
has_more: bool = Field(..., alias='hasMore')
|
|
264
|
+
"""
|
|
265
|
+
Whether there are more results to paginate through
|
|
266
|
+
"""
|
|
267
|
+
next_cursor: Optional[str] = Field(..., alias='nextCursor')
|
|
268
|
+
"""
|
|
269
|
+
The cursor to paginate through the next set of results
|
|
270
|
+
"""
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
class Option(ExaBaseModel):
|
|
274
|
+
label: str
|
|
275
|
+
"""
|
|
276
|
+
The label of the option
|
|
277
|
+
"""
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
class Progress(ExaBaseModel):
|
|
281
|
+
"""
|
|
282
|
+
The progress of the search
|
|
283
|
+
"""
|
|
284
|
+
|
|
285
|
+
found: float
|
|
286
|
+
"""
|
|
287
|
+
The number of results found so far
|
|
288
|
+
"""
|
|
289
|
+
completion: confloat(ge=0.0, le=100.0)
|
|
290
|
+
"""
|
|
291
|
+
The completion percentage of the search
|
|
292
|
+
"""
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
class Reference(ExaBaseModel):
|
|
296
|
+
title: Optional[str] = None
|
|
297
|
+
"""
|
|
298
|
+
The title of the reference
|
|
299
|
+
"""
|
|
300
|
+
snippet: Optional[str] = None
|
|
301
|
+
"""
|
|
302
|
+
The relevant snippet of the reference content
|
|
303
|
+
"""
|
|
304
|
+
url: AnyUrl
|
|
305
|
+
"""
|
|
306
|
+
The URL of the reference
|
|
307
|
+
"""
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class Satisfied(Enum):
|
|
311
|
+
"""
|
|
312
|
+
The satisfaction of the criterion
|
|
313
|
+
"""
|
|
314
|
+
|
|
315
|
+
yes = 'yes'
|
|
316
|
+
no = 'no'
|
|
317
|
+
unclear = 'unclear'
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
class Search(ExaBaseModel):
|
|
321
|
+
"""
|
|
322
|
+
Create initial search for the Webset.
|
|
323
|
+
"""
|
|
324
|
+
|
|
325
|
+
query: constr(min_length=1, max_length=5000) = Field(
|
|
326
|
+
...,
|
|
327
|
+
examples=[
|
|
328
|
+
'Marketing agencies based in the US, that focus on consumer products.'
|
|
329
|
+
],
|
|
330
|
+
)
|
|
331
|
+
"""
|
|
332
|
+
Your search query.
|
|
333
|
+
|
|
334
|
+
Use this to describe what you are looking for.
|
|
335
|
+
|
|
336
|
+
Any URL provided will be crawled and used as context for the search.
|
|
337
|
+
"""
|
|
338
|
+
count: confloat(ge=1.0)
|
|
339
|
+
"""
|
|
340
|
+
Number of Items the Webset will attempt to find.
|
|
341
|
+
|
|
342
|
+
The actual number of Items found may be less than this number depending on the search complexity.
|
|
343
|
+
"""
|
|
344
|
+
entity: Optional[
|
|
345
|
+
Union[
|
|
346
|
+
WebsetCompanyEntity,
|
|
347
|
+
WebsetPersonEntity,
|
|
348
|
+
WebsetArticleEntity,
|
|
349
|
+
WebsetResearchPaperEntity,
|
|
350
|
+
WebsetCustomEntity,
|
|
351
|
+
]
|
|
352
|
+
] = Field(None, discriminator='type')
|
|
353
|
+
"""
|
|
354
|
+
Entity the Webset will return results for.
|
|
355
|
+
|
|
356
|
+
It is not required to provide it, we automatically detect the entity from all the information provided in the query. Only use this when you need more fine control.
|
|
357
|
+
"""
|
|
358
|
+
criteria: Optional[List[CreateCriterionParameters]] = Field(
|
|
359
|
+
None, max_items=5, min_items=1
|
|
360
|
+
)
|
|
361
|
+
"""
|
|
362
|
+
Criteria every item is evaluated against.
|
|
363
|
+
|
|
364
|
+
It's not required to provide your own criteria, we automatically detect the criteria from all the information provided in the query. Only use this when you need more fine control.
|
|
365
|
+
"""
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
class Source(Enum):
|
|
369
|
+
"""
|
|
370
|
+
The source of the Item
|
|
371
|
+
"""
|
|
372
|
+
|
|
373
|
+
search = 'search'
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
class UpdateWebhookParameters(ExaBaseModel):
|
|
377
|
+
events: Optional[List[Event]] = Field(None, max_items=12, min_items=1)
|
|
378
|
+
"""
|
|
379
|
+
The events to trigger the webhook
|
|
380
|
+
"""
|
|
381
|
+
url: Optional[AnyUrl] = None
|
|
382
|
+
"""
|
|
383
|
+
The URL to send the webhook to
|
|
384
|
+
"""
|
|
385
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
386
|
+
"""
|
|
387
|
+
Set of key-value pairs you want to associate with this object.
|
|
388
|
+
"""
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
class UpdateWebsetRequest(ExaBaseModel):
|
|
392
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
393
|
+
"""
|
|
394
|
+
Set of key-value pairs you want to associate with this object.
|
|
395
|
+
"""
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
class Webhook(ExaBaseModel):
|
|
399
|
+
id: str
|
|
400
|
+
"""
|
|
401
|
+
The unique identifier for the webhook
|
|
402
|
+
"""
|
|
403
|
+
object: Literal['webhook']
|
|
404
|
+
status: WebhookStatus = Field(..., title='WebhookStatus')
|
|
405
|
+
"""
|
|
406
|
+
The status of the webhook
|
|
407
|
+
"""
|
|
408
|
+
events: List[Event] = Field(..., min_items=1)
|
|
409
|
+
"""
|
|
410
|
+
The events to trigger the webhook
|
|
411
|
+
"""
|
|
412
|
+
url: AnyUrl
|
|
413
|
+
"""
|
|
414
|
+
The URL to send the webhook to
|
|
415
|
+
"""
|
|
416
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
417
|
+
"""
|
|
418
|
+
The metadata of the webhook
|
|
419
|
+
"""
|
|
420
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
421
|
+
"""
|
|
422
|
+
The date and time the webhook was created
|
|
423
|
+
"""
|
|
424
|
+
updated_at: datetime = Field(..., alias='updatedAt')
|
|
425
|
+
"""
|
|
426
|
+
The date and time the webhook was last updated
|
|
427
|
+
"""
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
class WebhookStatus(Enum):
|
|
431
|
+
"""
|
|
432
|
+
The status of the webhook
|
|
433
|
+
"""
|
|
434
|
+
|
|
435
|
+
active = 'active'
|
|
436
|
+
inactive = 'inactive'
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
class Webset(ExaBaseModel):
|
|
440
|
+
id: str
|
|
441
|
+
"""
|
|
442
|
+
The unique identifier for the webset
|
|
443
|
+
"""
|
|
444
|
+
object: Literal['webset']
|
|
445
|
+
status: WebsetStatus = Field(..., title='WebsetStatus')
|
|
446
|
+
"""
|
|
447
|
+
The status of the webset
|
|
448
|
+
"""
|
|
449
|
+
external_id: Optional[str] = Field(..., alias='externalId')
|
|
450
|
+
"""
|
|
451
|
+
The external identifier for the webset
|
|
452
|
+
"""
|
|
453
|
+
searches: List[WebsetSearch]
|
|
454
|
+
"""
|
|
455
|
+
The searches that have been performed on the webset.
|
|
456
|
+
"""
|
|
457
|
+
enrichments: List[WebsetEnrichment]
|
|
458
|
+
"""
|
|
459
|
+
The Enrichments to apply to the Webset Items.
|
|
460
|
+
"""
|
|
461
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
462
|
+
"""
|
|
463
|
+
Set of key-value pairs you want to associate with this object.
|
|
464
|
+
"""
|
|
465
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
466
|
+
"""
|
|
467
|
+
The date and time the webset was created
|
|
468
|
+
"""
|
|
469
|
+
updated_at: datetime = Field(..., alias='updatedAt')
|
|
470
|
+
"""
|
|
471
|
+
The date and time the webset was updated
|
|
472
|
+
"""
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
class WebsetArticleEntity(ExaBaseModel):
|
|
476
|
+
type: Literal['article']
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
class WebsetCompanyEntity(ExaBaseModel):
|
|
480
|
+
type: Literal['company']
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
class WebsetCreatedEvent(ExaBaseModel):
|
|
484
|
+
id: str
|
|
485
|
+
"""
|
|
486
|
+
The unique identifier for the event
|
|
487
|
+
"""
|
|
488
|
+
object: Literal['event']
|
|
489
|
+
type: Literal['webset.created']
|
|
490
|
+
data: Webset
|
|
491
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
492
|
+
"""
|
|
493
|
+
The date and time the event was created
|
|
494
|
+
"""
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
class WebsetCustomEntity(ExaBaseModel):
|
|
498
|
+
type: Literal['custom']
|
|
499
|
+
description: constr(min_length=2, max_length=200)
|
|
500
|
+
"""
|
|
501
|
+
When you decide to use a custom entity, this is the description of the entity.
|
|
502
|
+
|
|
503
|
+
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.
|
|
504
|
+
"""
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
class WebsetDeletedEvent(ExaBaseModel):
|
|
508
|
+
id: str
|
|
509
|
+
"""
|
|
510
|
+
The unique identifier for the event
|
|
511
|
+
"""
|
|
512
|
+
object: Literal['event']
|
|
513
|
+
type: Literal['webset.deleted']
|
|
514
|
+
data: Webset
|
|
515
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
516
|
+
"""
|
|
517
|
+
The date and time the event was created
|
|
518
|
+
"""
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
class WebsetEnrichment(ExaBaseModel):
|
|
522
|
+
id: str
|
|
523
|
+
"""
|
|
524
|
+
The unique identifier for the enrichment
|
|
525
|
+
"""
|
|
526
|
+
object: Literal['webset_enrichment']
|
|
527
|
+
status: WebsetEnrichmentStatus = Field(..., title='WebsetEnrichmentStatus')
|
|
528
|
+
"""
|
|
529
|
+
The status of the enrichment
|
|
530
|
+
"""
|
|
531
|
+
webset_id: str = Field(..., alias='websetId')
|
|
532
|
+
"""
|
|
533
|
+
The unique identifier for the Webset this enrichment belongs to.
|
|
534
|
+
"""
|
|
535
|
+
title: Optional[str] = None
|
|
536
|
+
"""
|
|
537
|
+
The title of the enrichment.
|
|
538
|
+
|
|
539
|
+
This will be automatically generated based on the description and format.
|
|
540
|
+
"""
|
|
541
|
+
description: str
|
|
542
|
+
"""
|
|
543
|
+
The description of the enrichment task provided during the creation of the enrichment.
|
|
544
|
+
"""
|
|
545
|
+
format: Optional[WebsetEnrichmentFormat]
|
|
546
|
+
"""
|
|
547
|
+
The format of the enrichment response.
|
|
548
|
+
"""
|
|
549
|
+
options: Optional[List[WebsetEnrichmentOption]] = Field(
|
|
550
|
+
..., title='WebsetEnrichmentOptions'
|
|
551
|
+
)
|
|
552
|
+
"""
|
|
553
|
+
When the format is options, the different options for the enrichment agent to choose from.
|
|
554
|
+
"""
|
|
555
|
+
instructions: Optional[str] = None
|
|
556
|
+
"""
|
|
557
|
+
The instructions for the enrichment Agent.
|
|
558
|
+
|
|
559
|
+
This will be automatically generated based on the description and format.
|
|
560
|
+
"""
|
|
561
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
562
|
+
"""
|
|
563
|
+
The metadata of the enrichment
|
|
564
|
+
"""
|
|
565
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
566
|
+
"""
|
|
567
|
+
The date and time the enrichment was created
|
|
568
|
+
"""
|
|
569
|
+
updated_at: datetime = Field(..., alias='updatedAt')
|
|
570
|
+
"""
|
|
571
|
+
The date and time the enrichment was updated
|
|
572
|
+
"""
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
class WebsetEnrichmentFormat(Enum):
|
|
576
|
+
text = 'text'
|
|
577
|
+
date = 'date'
|
|
578
|
+
number = 'number'
|
|
579
|
+
options = 'options'
|
|
580
|
+
email = 'email'
|
|
581
|
+
phone = 'phone'
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
class WebsetEnrichmentOption(Option):
|
|
585
|
+
pass
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
class WebsetEnrichmentStatus(Enum):
|
|
589
|
+
"""
|
|
590
|
+
The status of the enrichment
|
|
591
|
+
"""
|
|
592
|
+
|
|
593
|
+
pending = 'pending'
|
|
594
|
+
canceled = 'canceled'
|
|
595
|
+
completed = 'completed'
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
class WebsetExportFormat(Enum):
|
|
599
|
+
csv = 'csv'
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
class WebsetIdleEvent(ExaBaseModel):
|
|
603
|
+
id: str
|
|
604
|
+
"""
|
|
605
|
+
The unique identifier for the event
|
|
606
|
+
"""
|
|
607
|
+
object: Literal['event']
|
|
608
|
+
type: Literal['webset.idle']
|
|
609
|
+
data: Webset
|
|
610
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
611
|
+
"""
|
|
612
|
+
The date and time the event was created
|
|
613
|
+
"""
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
class WebsetItem(ExaBaseModel):
|
|
617
|
+
id: str
|
|
618
|
+
"""
|
|
619
|
+
The unique identifier for the Webset Item
|
|
620
|
+
"""
|
|
621
|
+
object: Literal['webset_item']
|
|
622
|
+
source: Source
|
|
623
|
+
"""
|
|
624
|
+
The source of the Item
|
|
625
|
+
"""
|
|
626
|
+
source_id: str = Field(..., alias='sourceId')
|
|
627
|
+
"""
|
|
628
|
+
The unique identifier for the source
|
|
629
|
+
"""
|
|
630
|
+
webset_id: str = Field(..., alias='websetId')
|
|
631
|
+
"""
|
|
632
|
+
The unique identifier for the Webset this Item belongs to.
|
|
633
|
+
"""
|
|
634
|
+
properties: Union[
|
|
635
|
+
WebsetItemPersonProperties,
|
|
636
|
+
WebsetItemCompanyProperties,
|
|
637
|
+
WebsetItemArticleProperties,
|
|
638
|
+
WebsetItemResearchPaperProperties,
|
|
639
|
+
WebsetItemCustomProperties,
|
|
640
|
+
]
|
|
641
|
+
"""
|
|
642
|
+
The properties of the Item
|
|
643
|
+
"""
|
|
644
|
+
evaluations: List[WebsetItemEvaluation]
|
|
645
|
+
"""
|
|
646
|
+
The criteria evaluations of the item
|
|
647
|
+
"""
|
|
648
|
+
enrichments: Optional[List[EnrichmentResult]]
|
|
649
|
+
"""
|
|
650
|
+
The enrichments results of the Webset item
|
|
651
|
+
"""
|
|
652
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
653
|
+
"""
|
|
654
|
+
The date and time the item was created
|
|
655
|
+
"""
|
|
656
|
+
updated_at: datetime = Field(..., alias='updatedAt')
|
|
657
|
+
"""
|
|
658
|
+
The date and time the item was last updated
|
|
659
|
+
"""
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
class WebsetItemArticleProperties(ExaBaseModel):
|
|
663
|
+
type: Literal['article']
|
|
664
|
+
url: AnyUrl
|
|
665
|
+
"""
|
|
666
|
+
The URL of the article
|
|
667
|
+
"""
|
|
668
|
+
description: str
|
|
669
|
+
"""
|
|
670
|
+
Short description of the relevance of the article
|
|
671
|
+
"""
|
|
672
|
+
content: Optional[str] = None
|
|
673
|
+
"""
|
|
674
|
+
The text content for the article
|
|
675
|
+
"""
|
|
676
|
+
article: WebsetItemArticlePropertiesFields = Field(
|
|
677
|
+
..., title='WebsetItemArticlePropertiesFields'
|
|
678
|
+
)
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
class WebsetItemArticlePropertiesFields(ExaBaseModel):
|
|
682
|
+
author: Optional[str] = None
|
|
683
|
+
"""
|
|
684
|
+
The author(s) of the article
|
|
685
|
+
"""
|
|
686
|
+
published_at: Optional[str] = Field(..., alias='publishedAt')
|
|
687
|
+
"""
|
|
688
|
+
The date and time the article was published
|
|
689
|
+
"""
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
class WebsetItemCompanyProperties(ExaBaseModel):
|
|
693
|
+
type: Literal['company']
|
|
694
|
+
url: AnyUrl
|
|
695
|
+
"""
|
|
696
|
+
The URL of the company website
|
|
697
|
+
"""
|
|
698
|
+
description: str
|
|
699
|
+
"""
|
|
700
|
+
Short description of the relevance of the company
|
|
701
|
+
"""
|
|
702
|
+
content: Optional[str] = None
|
|
703
|
+
"""
|
|
704
|
+
The text content of the company website
|
|
705
|
+
"""
|
|
706
|
+
company: WebsetItemCompanyPropertiesFields = Field(
|
|
707
|
+
..., title='WebsetItemCompanyPropertiesFields'
|
|
708
|
+
)
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
class WebsetItemCompanyPropertiesFields(ExaBaseModel):
|
|
712
|
+
name: str
|
|
713
|
+
"""
|
|
714
|
+
The name of the company
|
|
715
|
+
"""
|
|
716
|
+
location: Optional[str] = None
|
|
717
|
+
"""
|
|
718
|
+
The main location of the company
|
|
719
|
+
"""
|
|
720
|
+
employees: Optional[float] = None
|
|
721
|
+
"""
|
|
722
|
+
The number of employees of the company
|
|
723
|
+
"""
|
|
724
|
+
industry: Optional[str] = None
|
|
725
|
+
"""
|
|
726
|
+
The industry of the company
|
|
727
|
+
"""
|
|
728
|
+
about: Optional[str] = None
|
|
729
|
+
"""
|
|
730
|
+
A short description of the company
|
|
731
|
+
"""
|
|
732
|
+
logo_url: Optional[AnyUrl] = Field(..., alias='logoUrl')
|
|
733
|
+
"""
|
|
734
|
+
The logo URL of the company
|
|
735
|
+
"""
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
class WebsetItemCreatedEvent(ExaBaseModel):
|
|
739
|
+
id: str
|
|
740
|
+
"""
|
|
741
|
+
The unique identifier for the event
|
|
742
|
+
"""
|
|
743
|
+
object: Literal['event']
|
|
744
|
+
type: Literal['webset.item.created']
|
|
745
|
+
data: WebsetItem
|
|
746
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
747
|
+
"""
|
|
748
|
+
The date and time the event was created
|
|
749
|
+
"""
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
class WebsetItemCustomProperties(ExaBaseModel):
|
|
753
|
+
type: Literal['custom']
|
|
754
|
+
url: AnyUrl
|
|
755
|
+
"""
|
|
756
|
+
The URL of the Item
|
|
757
|
+
"""
|
|
758
|
+
description: str
|
|
759
|
+
"""
|
|
760
|
+
Short description of the Item
|
|
761
|
+
"""
|
|
762
|
+
content: Optional[str] = None
|
|
763
|
+
"""
|
|
764
|
+
The text content of the Item
|
|
765
|
+
"""
|
|
766
|
+
custom: WebsetItemCustomPropertiesFields = Field(
|
|
767
|
+
..., title='WebsetItemCustomPropertiesFields'
|
|
768
|
+
)
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
class WebsetItemCustomPropertiesFields(ExaBaseModel):
|
|
772
|
+
author: Optional[str] = None
|
|
773
|
+
"""
|
|
774
|
+
The author(s) of the website
|
|
775
|
+
"""
|
|
776
|
+
published_at: Optional[str] = Field(..., alias='publishedAt')
|
|
777
|
+
"""
|
|
778
|
+
The date and time the website was published
|
|
779
|
+
"""
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
class WebsetItemEnrichedEvent(ExaBaseModel):
|
|
783
|
+
id: str
|
|
784
|
+
"""
|
|
785
|
+
The unique identifier for the event
|
|
786
|
+
"""
|
|
787
|
+
object: Literal['event']
|
|
788
|
+
type: Literal['webset.item.enriched']
|
|
789
|
+
data: WebsetItem
|
|
790
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
791
|
+
"""
|
|
792
|
+
The date and time the event was created
|
|
793
|
+
"""
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
class WebsetItemEvaluation(ExaBaseModel):
|
|
797
|
+
criterion: str
|
|
798
|
+
"""
|
|
799
|
+
The description of the criterion
|
|
800
|
+
"""
|
|
801
|
+
reasoning: str
|
|
802
|
+
"""
|
|
803
|
+
The reasoning for the result of the evaluation
|
|
804
|
+
"""
|
|
805
|
+
satisfied: Satisfied
|
|
806
|
+
"""
|
|
807
|
+
The satisfaction of the criterion
|
|
808
|
+
"""
|
|
809
|
+
references: Optional[List[Reference]]
|
|
810
|
+
"""
|
|
811
|
+
The references used to generate the result. `null` if the evaluation is not yet completed.
|
|
812
|
+
"""
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
class WebsetItemPersonProperties(ExaBaseModel):
|
|
816
|
+
type: Literal['person']
|
|
817
|
+
url: AnyUrl
|
|
818
|
+
"""
|
|
819
|
+
The URL of the person profile
|
|
820
|
+
"""
|
|
821
|
+
description: str
|
|
822
|
+
"""
|
|
823
|
+
Short description of the relevance of the person
|
|
824
|
+
"""
|
|
825
|
+
person: WebsetItemPersonPropertiesFields = Field(
|
|
826
|
+
..., title='WebsetItemPersonPropertiesFields'
|
|
827
|
+
)
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
class WebsetItemPersonPropertiesFields(ExaBaseModel):
|
|
831
|
+
name: str
|
|
832
|
+
"""
|
|
833
|
+
The name of the person
|
|
834
|
+
"""
|
|
835
|
+
location: Optional[str] = None
|
|
836
|
+
"""
|
|
837
|
+
The location of the person
|
|
838
|
+
"""
|
|
839
|
+
position: Optional[str] = None
|
|
840
|
+
"""
|
|
841
|
+
The current work position of the person
|
|
842
|
+
"""
|
|
843
|
+
picture_url: Optional[AnyUrl] = Field(..., alias='pictureUrl')
|
|
844
|
+
"""
|
|
845
|
+
The image URL of the person
|
|
846
|
+
"""
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
class WebsetItemResearchPaperProperties(ExaBaseModel):
|
|
850
|
+
type: Literal['research_paper']
|
|
851
|
+
url: AnyUrl
|
|
852
|
+
"""
|
|
853
|
+
The URL of the research paper
|
|
854
|
+
"""
|
|
855
|
+
description: str
|
|
856
|
+
"""
|
|
857
|
+
Short description of the relevance of the research paper
|
|
858
|
+
"""
|
|
859
|
+
content: Optional[str] = None
|
|
860
|
+
"""
|
|
861
|
+
The text content of the research paper
|
|
862
|
+
"""
|
|
863
|
+
research_paper: WebsetItemResearchPaperPropertiesFields = Field(
|
|
864
|
+
..., alias='researchPaper', title='WebsetItemResearchPaperPropertiesFields'
|
|
865
|
+
)
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
class WebsetItemResearchPaperPropertiesFields(ExaBaseModel):
|
|
869
|
+
author: Optional[str] = None
|
|
870
|
+
"""
|
|
871
|
+
The author(s) of the research paper
|
|
872
|
+
"""
|
|
873
|
+
published_at: Optional[str] = Field(..., alias='publishedAt')
|
|
874
|
+
"""
|
|
875
|
+
The date and time the research paper was published
|
|
876
|
+
"""
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
class WebsetPausedEvent(ExaBaseModel):
|
|
880
|
+
id: str
|
|
881
|
+
"""
|
|
882
|
+
The unique identifier for the event
|
|
883
|
+
"""
|
|
884
|
+
object: Literal['event']
|
|
885
|
+
type: Literal['webset.paused']
|
|
886
|
+
data: Webset
|
|
887
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
888
|
+
"""
|
|
889
|
+
The date and time the event was created
|
|
890
|
+
"""
|
|
891
|
+
|
|
892
|
+
|
|
893
|
+
class WebsetPersonEntity(ExaBaseModel):
|
|
894
|
+
type: Literal['person']
|
|
895
|
+
|
|
896
|
+
|
|
897
|
+
class WebsetResearchPaperEntity(ExaBaseModel):
|
|
898
|
+
type: Literal['research_paper']
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
class WebsetSearch(ExaBaseModel):
|
|
902
|
+
id: str
|
|
903
|
+
"""
|
|
904
|
+
The unique identifier for the search
|
|
905
|
+
"""
|
|
906
|
+
object: Literal['webset_search']
|
|
907
|
+
status: WebsetSearchStatus = Field(..., title='WebsetSearchStatus')
|
|
908
|
+
"""
|
|
909
|
+
The status of the search
|
|
910
|
+
"""
|
|
911
|
+
query: constr(min_length=1, max_length=5000)
|
|
912
|
+
"""
|
|
913
|
+
The query used to create the search.
|
|
914
|
+
"""
|
|
915
|
+
entity: Optional[
|
|
916
|
+
Union[
|
|
917
|
+
WebsetCompanyEntity,
|
|
918
|
+
WebsetPersonEntity,
|
|
919
|
+
WebsetArticleEntity,
|
|
920
|
+
WebsetResearchPaperEntity,
|
|
921
|
+
WebsetCustomEntity,
|
|
922
|
+
]
|
|
923
|
+
]
|
|
924
|
+
"""
|
|
925
|
+
The entity the search will return results for.
|
|
926
|
+
|
|
927
|
+
When no entity is provided during creation, we will automatically select the best entity based on the query.
|
|
928
|
+
"""
|
|
929
|
+
criteria: List[Criterion]
|
|
930
|
+
"""
|
|
931
|
+
The criteria the search will use to evaluate the results. If not provided, we will automatically generate them for you.
|
|
932
|
+
"""
|
|
933
|
+
count: confloat(ge=1.0)
|
|
934
|
+
"""
|
|
935
|
+
The number of results the search will attempt to find. The actual number of results may be less than this number depending on the search complexity.
|
|
936
|
+
"""
|
|
937
|
+
progress: Progress
|
|
938
|
+
"""
|
|
939
|
+
The progress of the search
|
|
940
|
+
"""
|
|
941
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
942
|
+
"""
|
|
943
|
+
Set of key-value pairs you want to associate with this object.
|
|
944
|
+
"""
|
|
945
|
+
canceled_at: Optional[datetime] = Field(..., alias='canceledAt')
|
|
946
|
+
"""
|
|
947
|
+
The date and time the search was canceled
|
|
948
|
+
"""
|
|
949
|
+
canceled_reason: Optional[CanceledReason] = Field(..., alias='canceledReason')
|
|
950
|
+
"""
|
|
951
|
+
The reason the search was canceled
|
|
952
|
+
"""
|
|
953
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
954
|
+
"""
|
|
955
|
+
The date and time the search was created
|
|
956
|
+
"""
|
|
957
|
+
updated_at: datetime = Field(..., alias='updatedAt')
|
|
958
|
+
"""
|
|
959
|
+
The date and time the search was updated
|
|
960
|
+
"""
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
class WebsetSearchBehaviour(Enum):
|
|
964
|
+
"""
|
|
965
|
+
The behaviour of the Search when it is added to a Webset.
|
|
966
|
+
|
|
967
|
+
- `override`: the search will reuse the existing Items found in the Webset and evaluate them against the new criteria. Any Items that don't match the new criteria will not be discarded.
|
|
968
|
+
"""
|
|
969
|
+
|
|
970
|
+
override = 'override'
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
class WebsetSearchCanceledEvent(ExaBaseModel):
|
|
974
|
+
id: str
|
|
975
|
+
"""
|
|
976
|
+
The unique identifier for the event
|
|
977
|
+
"""
|
|
978
|
+
object: Literal['event']
|
|
979
|
+
type: Literal['webset.search.canceled']
|
|
980
|
+
data: WebsetSearch
|
|
981
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
982
|
+
"""
|
|
983
|
+
The date and time the event was created
|
|
984
|
+
"""
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
class WebsetSearchCompletedEvent(ExaBaseModel):
|
|
988
|
+
id: str
|
|
989
|
+
"""
|
|
990
|
+
The unique identifier for the event
|
|
991
|
+
"""
|
|
992
|
+
object: Literal['event']
|
|
993
|
+
type: Literal['webset.search.completed']
|
|
994
|
+
data: WebsetSearch
|
|
995
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
996
|
+
"""
|
|
997
|
+
The date and time the event was created
|
|
998
|
+
"""
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
class WebsetSearchCreatedEvent(ExaBaseModel):
|
|
1002
|
+
id: str
|
|
1003
|
+
"""
|
|
1004
|
+
The unique identifier for the event
|
|
1005
|
+
"""
|
|
1006
|
+
object: Literal['event']
|
|
1007
|
+
type: Literal['webset.search.created']
|
|
1008
|
+
data: WebsetSearch
|
|
1009
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
1010
|
+
"""
|
|
1011
|
+
The date and time the event was created
|
|
1012
|
+
"""
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
class WebsetSearchStatus(Enum):
|
|
1016
|
+
"""
|
|
1017
|
+
The status of the search
|
|
1018
|
+
"""
|
|
1019
|
+
|
|
1020
|
+
created = 'created'
|
|
1021
|
+
running = 'running'
|
|
1022
|
+
completed = 'completed'
|
|
1023
|
+
canceled = 'canceled'
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
class WebsetSearchUpdatedEvent(ExaBaseModel):
|
|
1027
|
+
id: str
|
|
1028
|
+
"""
|
|
1029
|
+
The unique identifier for the event
|
|
1030
|
+
"""
|
|
1031
|
+
object: Literal['event']
|
|
1032
|
+
type: Literal['webset.search.updated']
|
|
1033
|
+
data: WebsetSearch
|
|
1034
|
+
created_at: datetime = Field(..., alias='createdAt')
|
|
1035
|
+
"""
|
|
1036
|
+
The date and time the event was created
|
|
1037
|
+
"""
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
class WebsetStatus(Enum):
|
|
1041
|
+
"""
|
|
1042
|
+
The status of the webset
|
|
1043
|
+
"""
|
|
1044
|
+
|
|
1045
|
+
idle = 'idle'
|
|
1046
|
+
running = 'running'
|
|
1047
|
+
paused = 'paused'
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
class GetWebsetResponse(Webset):
|
|
1051
|
+
items: Optional[List[WebsetItem]] = None
|
|
1052
|
+
"""
|
|
1053
|
+
When expand query parameter contains `items`, this will contain the items in the webset
|
|
1054
|
+
"""
|