exa-py 1.15.6__py3-none-any.whl → 1.16.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 +19 -6
- exa_py/research/async_client.py +2 -1
- exa_py/research/models.py +6 -2
- exa_py/research/sync_client.py +5 -4
- {exa_py-1.15.6.dist-info → exa_py-1.16.1.dist-info}/METADATA +3 -1
- {exa_py-1.15.6.dist-info → exa_py-1.16.1.dist-info}/RECORD +7 -7
- {exa_py-1.15.6.dist-info → exa_py-1.16.1.dist-info}/WHEEL +1 -1
exa_py/api.py
CHANGED
|
@@ -142,7 +142,9 @@ SEARCH_OPTIONS_TYPES = {
|
|
|
142
142
|
list
|
|
143
143
|
], # Must not be present in webpage text. (One string, up to 5 words)
|
|
144
144
|
"use_autoprompt": [bool], # Convert query to Exa. (Default: false)
|
|
145
|
-
"type": [
|
|
145
|
+
"type": [
|
|
146
|
+
str
|
|
147
|
+
], # 'keyword', 'neural', 'hybrid', 'fast', 'deep', or 'auto' (Default: auto)
|
|
146
148
|
"category": [
|
|
147
149
|
str
|
|
148
150
|
], # A data category to focus on: 'company', 'research paper', 'news', 'pdf', 'github', 'tweet', 'personal site', 'linkedin profile', 'financial report'
|
|
@@ -260,6 +262,10 @@ class HighlightsContentsOptions(TypedDict, total=False):
|
|
|
260
262
|
query (str): The query string for the highlights.
|
|
261
263
|
num_sentences (int): Size of highlights to return, in sentences. Default: 5
|
|
262
264
|
highlights_per_url (int): Number of highlights to return per URL. Default: 1
|
|
265
|
+
|
|
266
|
+
NOTE: When using the "deep" search type, only the default highlights=True is supported.
|
|
267
|
+
These options will NOT be respected. Highlights will always be based on the user's query,
|
|
268
|
+
and the number and length may vary.
|
|
263
269
|
"""
|
|
264
270
|
|
|
265
271
|
query: str
|
|
@@ -1275,7 +1281,7 @@ class Exa:
|
|
|
1275
1281
|
include_text (List[str], optional): Strings that must appear in the page text.
|
|
1276
1282
|
exclude_text (List[str], optional): Strings that must not appear in the page text.
|
|
1277
1283
|
use_autoprompt (bool, optional): Convert query to Exa (default False).
|
|
1278
|
-
type (str, optional): 'keyword', 'neural', 'hybrid', 'fast', or 'auto' (default 'auto').
|
|
1284
|
+
type (str, optional): 'keyword', 'neural', 'hybrid', 'fast', 'deep', or 'auto' (default 'auto').
|
|
1279
1285
|
category (str, optional): e.g. 'company'
|
|
1280
1286
|
flags (List[str], optional): Experimental flags for Exa usage.
|
|
1281
1287
|
moderation (bool, optional): If True, the search results will be moderated for safety.
|
|
@@ -2438,8 +2444,12 @@ class AsyncExa(Exa):
|
|
|
2438
2444
|
return self._client
|
|
2439
2445
|
|
|
2440
2446
|
async def async_request(
|
|
2441
|
-
self,
|
|
2442
|
-
|
|
2447
|
+
self,
|
|
2448
|
+
endpoint: str,
|
|
2449
|
+
data=None,
|
|
2450
|
+
method: str = "POST",
|
|
2451
|
+
params=None,
|
|
2452
|
+
headers: Optional[Dict[str, str]] = None,
|
|
2443
2453
|
):
|
|
2444
2454
|
"""Send a request to the Exa API, optionally streaming if data['stream'] is True.
|
|
2445
2455
|
|
|
@@ -2470,7 +2480,10 @@ class AsyncExa(Exa):
|
|
|
2470
2480
|
if method.upper() == "GET":
|
|
2471
2481
|
if needs_streaming:
|
|
2472
2482
|
request = httpx.Request(
|
|
2473
|
-
"GET",
|
|
2483
|
+
"GET",
|
|
2484
|
+
self.base_url + endpoint,
|
|
2485
|
+
params=params,
|
|
2486
|
+
headers=request_headers,
|
|
2474
2487
|
)
|
|
2475
2488
|
res = await self.client.send(request, stream=True)
|
|
2476
2489
|
return res
|
|
@@ -2529,7 +2542,7 @@ class AsyncExa(Exa):
|
|
|
2529
2542
|
include_text (List[str], optional): Strings that must appear in the page text.
|
|
2530
2543
|
exclude_text (List[str], optional): Strings that must not appear in the page text.
|
|
2531
2544
|
use_autoprompt (bool, optional): Convert query to Exa (default False).
|
|
2532
|
-
type (str, optional): 'keyword', 'neural', 'hybrid', 'fast', or 'auto' (default 'auto').
|
|
2545
|
+
type (str, optional): 'keyword', 'neural', 'hybrid', 'fast', 'deep', or 'auto' (default 'auto').
|
|
2533
2546
|
category (str, optional): e.g. 'company'
|
|
2534
2547
|
flags (List[str], optional): Experimental flags for Exa usage.
|
|
2535
2548
|
moderation (bool, optional): If True, the search results will be moderated for safety.
|
exa_py/research/async_client.py
CHANGED
|
@@ -23,6 +23,7 @@ from .models import (
|
|
|
23
23
|
ResearchDto,
|
|
24
24
|
ResearchEvent,
|
|
25
25
|
ListResearchResponseDto,
|
|
26
|
+
ResearchModel,
|
|
26
27
|
)
|
|
27
28
|
from .utils import (
|
|
28
29
|
async_stream_sse_events,
|
|
@@ -64,7 +65,7 @@ class AsyncResearchClient(AsyncResearchBaseClient):
|
|
|
64
65
|
self,
|
|
65
66
|
*,
|
|
66
67
|
instructions: str,
|
|
67
|
-
model:
|
|
68
|
+
model: ResearchModel = "exa-research-fast",
|
|
68
69
|
) -> ResearchDto: ...
|
|
69
70
|
|
|
70
71
|
@overload
|
exa_py/research/models.py
CHANGED
|
@@ -5,6 +5,9 @@ from typing import Annotated, Any, Dict, List, Literal, Optional, Union
|
|
|
5
5
|
from pydantic import BaseModel, Field, RootModel
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
ResearchModel = Literal["exa-research-fast", "exa-research", "exa-research-pro"]
|
|
9
|
+
|
|
10
|
+
|
|
8
11
|
class CostDollars(BaseModel):
|
|
9
12
|
total: float
|
|
10
13
|
num_pages: Annotated[float, Field(alias="numPages")]
|
|
@@ -191,7 +194,7 @@ class ResearchBaseDto(BaseModel):
|
|
|
191
194
|
float, Field(alias="createdAt", description="Milliseconds since epoch time")
|
|
192
195
|
]
|
|
193
196
|
model: Annotated[
|
|
194
|
-
|
|
197
|
+
ResearchModel,
|
|
195
198
|
Field(description="The model used for the research request"),
|
|
196
199
|
] = "exa-research"
|
|
197
200
|
instructions: Annotated[
|
|
@@ -273,7 +276,7 @@ class ListResearchResponseDto(BaseModel):
|
|
|
273
276
|
|
|
274
277
|
|
|
275
278
|
class ResearchCreateRequestDto(BaseModel):
|
|
276
|
-
model:
|
|
279
|
+
model: ResearchModel = "exa-research"
|
|
277
280
|
instructions: Annotated[
|
|
278
281
|
str,
|
|
279
282
|
Field(
|
|
@@ -313,6 +316,7 @@ __all__ = [
|
|
|
313
316
|
"ResearchTaskOutput",
|
|
314
317
|
"ResearchTaskOutputEvent",
|
|
315
318
|
"ResearchMetaEvent",
|
|
319
|
+
"ResearchModel",
|
|
316
320
|
"ResearchPlanEvent",
|
|
317
321
|
"ResearchTaskEvent",
|
|
318
322
|
"ResearchEvent",
|
exa_py/research/sync_client.py
CHANGED
|
@@ -23,6 +23,7 @@ from .models import (
|
|
|
23
23
|
ResearchDto,
|
|
24
24
|
ResearchEvent,
|
|
25
25
|
ListResearchResponseDto,
|
|
26
|
+
ResearchModel,
|
|
26
27
|
)
|
|
27
28
|
from .utils import (
|
|
28
29
|
is_pydantic_model,
|
|
@@ -63,7 +64,7 @@ class ResearchClient(ResearchBaseClient):
|
|
|
63
64
|
self,
|
|
64
65
|
*,
|
|
65
66
|
instructions: str,
|
|
66
|
-
model:
|
|
67
|
+
model: ResearchModel = "exa-research-fast",
|
|
67
68
|
) -> ResearchDto: ...
|
|
68
69
|
|
|
69
70
|
@overload
|
|
@@ -71,7 +72,7 @@ class ResearchClient(ResearchBaseClient):
|
|
|
71
72
|
self,
|
|
72
73
|
*,
|
|
73
74
|
instructions: str,
|
|
74
|
-
model:
|
|
75
|
+
model: ResearchModel = "exa-research-fast",
|
|
75
76
|
output_schema: Dict[str, Any],
|
|
76
77
|
) -> ResearchDto: ...
|
|
77
78
|
|
|
@@ -80,7 +81,7 @@ class ResearchClient(ResearchBaseClient):
|
|
|
80
81
|
self,
|
|
81
82
|
*,
|
|
82
83
|
instructions: str,
|
|
83
|
-
model:
|
|
84
|
+
model: ResearchModel = "exa-research-fast",
|
|
84
85
|
output_schema: Type[T],
|
|
85
86
|
) -> ResearchDto: ...
|
|
86
87
|
|
|
@@ -88,7 +89,7 @@ class ResearchClient(ResearchBaseClient):
|
|
|
88
89
|
self,
|
|
89
90
|
*,
|
|
90
91
|
instructions: str,
|
|
91
|
-
model:
|
|
92
|
+
model: ResearchModel = "exa-research-fast",
|
|
92
93
|
output_schema: Optional[Union[Dict[str, Any], Type[BaseModel]]] = None,
|
|
93
94
|
) -> ResearchDto:
|
|
94
95
|
"""Create a new research request.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: exa-py
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.16.1
|
|
4
4
|
Summary: Python SDK for Exa API.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Exa AI
|
|
@@ -13,9 +13,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Dist: httpcore (>=1.0.9)
|
|
16
17
|
Requires-Dist: httpx (>=0.28.1)
|
|
17
18
|
Requires-Dist: openai (>=1.48)
|
|
18
19
|
Requires-Dist: pydantic (>=2.10.6)
|
|
20
|
+
Requires-Dist: python-dotenv (>=1.0.1)
|
|
19
21
|
Requires-Dist: requests (>=2.32.3)
|
|
20
22
|
Requires-Dist: typing-extensions (>=4.12.2)
|
|
21
23
|
Description-Content-Type: text/markdown
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
exa_py/__init__.py,sha256=M2GC9oSdoV6m2msboW0vMWWl8wrth4o6gmEV4MYLGG8,66
|
|
2
|
-
exa_py/api.py,sha256=
|
|
2
|
+
exa_py/api.py,sha256=vvhpalfGtBs9-hOilhFtjUTiNSOFtZVIs5j7pE7FUW0,110347
|
|
3
3
|
exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
exa_py/research/__init__.py,sha256=qbWY5c3LYBM7L4yGVtiMs9nUg_kMcAVhMhT0DvN6EI4,1014
|
|
5
|
-
exa_py/research/async_client.py,sha256=
|
|
5
|
+
exa_py/research/async_client.py,sha256=XbqmJEAh8oHJmVVF3yOfLdNVOHi6knvUjCcz52RvxJU,9482
|
|
6
6
|
exa_py/research/base.py,sha256=0C52XGUMRwRox1JSVBrbiHZxqPI6Cgif7EFNqYxpc40,5451
|
|
7
|
-
exa_py/research/models.py,sha256=
|
|
8
|
-
exa_py/research/sync_client.py,sha256=
|
|
7
|
+
exa_py/research/models.py,sha256=y-f_d1FBNl7X49KveWhxtTM_RHVKq0MT95nu6NSQTjk,10330
|
|
8
|
+
exa_py/research/sync_client.py,sha256=QCAj2npkvlqdQjgSHSywEo0r_SFZj6YNbx41PjGCjS4,9074
|
|
9
9
|
exa_py/research/utils.py,sha256=YR61UkReyK-LrvOTaX_aG_neS1DsmCkv7B6YODpwHvU,5965
|
|
10
10
|
exa_py/utils.py,sha256=1jwKwcJwHSbrzwgMkprXSEZ-xssCtXxwf-GTRgaFmz8,6395
|
|
11
11
|
exa_py/websets/__init__.py,sha256=8ZWndRgeTKceZ3Wcm5xCh_dykrKkoCYdZdKcK7C3aSw,226
|
|
@@ -32,6 +32,6 @@ exa_py/websets/searches/client.py,sha256=XjOU-CWc9nVYbFYUvPzo26oKAkGgETqR5YCLHJG
|
|
|
32
32
|
exa_py/websets/types.py,sha256=ZsZtVzjBZ7UsqZNs4rBhX3PJxGKOC0ulOT1NuSlsW30,51398
|
|
33
33
|
exa_py/websets/webhooks/__init__.py,sha256=DMl6RFkS0c79AWzkuHOXnaU5QKHmkIHYW2PhZWUFIGc,191
|
|
34
34
|
exa_py/websets/webhooks/client.py,sha256=rdYU0DZKAslw5LwGKB567j3T8L34ZF9tSnlN9jLi23A,7143
|
|
35
|
-
exa_py-1.
|
|
36
|
-
exa_py-1.
|
|
37
|
-
exa_py-1.
|
|
35
|
+
exa_py-1.16.1.dist-info/METADATA,sha256=tLfcffYzlppyozz2bfCfAlI7h5sgcj72vtjdUSDQDRA,3899
|
|
36
|
+
exa_py-1.16.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
37
|
+
exa_py-1.16.1.dist-info/RECORD,,
|