exa-py 1.7.2__py3-none-any.whl → 1.7.3__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
CHANGED
|
@@ -100,13 +100,13 @@ SEARCH_OPTIONS_TYPES = {
|
|
|
100
100
|
"exclude_domains": [list], # Domains to omit; exclusive with 'include_domains'.
|
|
101
101
|
"start_crawl_date": [str], # Results after this crawl date. ISO 8601 format.
|
|
102
102
|
"end_crawl_date": [str], # Results before this crawl date. ISO 8601 format.
|
|
103
|
-
"start_published_date": [str], # Results after this publish date; excludes links with no date.
|
|
104
|
-
"end_published_date": [str], # Results before this publish date; excludes links with no date.
|
|
103
|
+
"start_published_date": [str], # Results after this publish date; excludes links with no date. ISO 8601 format.
|
|
104
|
+
"end_published_date": [str], # Results before this publish date; excludes links with no date. ISO 8601 format.
|
|
105
105
|
"include_text": [list], # Must be present in webpage text. (One string, up to 5 words)
|
|
106
106
|
"exclude_text": [list], # Must not be present in webpage text. (One string, up to 5 words)
|
|
107
107
|
"use_autoprompt": [bool], # Convert query to Exa. (Default: false)
|
|
108
|
-
"type": [str], # 'keyword' or '
|
|
109
|
-
"category": [str], #
|
|
108
|
+
"type": [str], # 'keyword', 'neural', or 'auto' (Default: auto).'neural' uses embeddings search, 'keyword' is SERP and 'auto' decides the best search type based on your query
|
|
109
|
+
"category": [str], # A data category to focus on: 'company', 'research paper', 'news', 'pdf', 'github', 'tweet', 'personal site', 'linkedin profile', 'financial report'
|
|
110
110
|
"flags": [list], # Experimental flags array for Exa usage.
|
|
111
111
|
}
|
|
112
112
|
|
|
@@ -130,7 +130,7 @@ FIND_SIMILAR_OPTIONS_TYPES = {
|
|
|
130
130
|
LIVECRAWL_OPTIONS = Literal["always", "fallback", "never", "auto"]
|
|
131
131
|
|
|
132
132
|
CONTENTS_OPTIONS_TYPES = {
|
|
133
|
-
"
|
|
133
|
+
"urls": [list],
|
|
134
134
|
"text": [dict, bool],
|
|
135
135
|
"highlights": [dict, bool],
|
|
136
136
|
"summary": [dict, bool],
|
|
@@ -216,7 +216,6 @@ class SummaryContentsOptions(TypedDict, total=False):
|
|
|
216
216
|
|
|
217
217
|
query: str
|
|
218
218
|
|
|
219
|
-
|
|
220
219
|
class ExtrasOptions(TypedDict, total=False):
|
|
221
220
|
"""A class representing additional extraction fields (e.g. links, images)"""
|
|
222
221
|
|
|
@@ -273,7 +272,8 @@ class _Result:
|
|
|
273
272
|
f"Published Date: {self.published_date}\n"
|
|
274
273
|
f"Author: {self.author}\n"
|
|
275
274
|
f"Image: {self.image}\n"
|
|
276
|
-
f"
|
|
275
|
+
f"Favicon: {self.favicon}\n"
|
|
276
|
+
f"Extras: {self.extras}\n"
|
|
277
277
|
f"Subpages: {self.subpages}\n"
|
|
278
278
|
)
|
|
279
279
|
|
|
@@ -548,7 +548,7 @@ class Exa:
|
|
|
548
548
|
self,
|
|
549
549
|
api_key: Optional[str],
|
|
550
550
|
base_url: str = "https://api.exa.ai",
|
|
551
|
-
user_agent: str = "exa-py 1.7.
|
|
551
|
+
user_agent: str = "exa-py 1.7.3",
|
|
552
552
|
):
|
|
553
553
|
"""Initialize the Exa client with the provided API key and optional base URL and user agent.
|
|
554
554
|
|
|
@@ -894,7 +894,7 @@ class Exa:
|
|
|
894
894
|
@overload
|
|
895
895
|
def get_contents(
|
|
896
896
|
self,
|
|
897
|
-
|
|
897
|
+
urls: Union[str, List[str], List[_Result]],
|
|
898
898
|
livecrawl_timeout: Optional[int] = None,
|
|
899
899
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
900
900
|
filter_empty_results: Optional[bool] = None,
|
|
@@ -908,7 +908,7 @@ class Exa:
|
|
|
908
908
|
@overload
|
|
909
909
|
def get_contents(
|
|
910
910
|
self,
|
|
911
|
-
|
|
911
|
+
urls: Union[str, List[str], List[_Result]],
|
|
912
912
|
*,
|
|
913
913
|
text: Union[TextContentsOptions, Literal[True]],
|
|
914
914
|
livecrawl_timeout: Optional[int] = None,
|
|
@@ -924,7 +924,7 @@ class Exa:
|
|
|
924
924
|
@overload
|
|
925
925
|
def get_contents(
|
|
926
926
|
self,
|
|
927
|
-
|
|
927
|
+
urls: Union[str, List[str], List[_Result]],
|
|
928
928
|
*,
|
|
929
929
|
highlights: Union[HighlightsContentsOptions, Literal[True]],
|
|
930
930
|
livecrawl_timeout: Optional[int] = None,
|
|
@@ -940,7 +940,7 @@ class Exa:
|
|
|
940
940
|
@overload
|
|
941
941
|
def get_contents(
|
|
942
942
|
self,
|
|
943
|
-
|
|
943
|
+
urls: Union[str, List[str], List[_Result]],
|
|
944
944
|
*,
|
|
945
945
|
text: Union[TextContentsOptions, Literal[True]],
|
|
946
946
|
highlights: Union[HighlightsContentsOptions, Literal[True]],
|
|
@@ -957,7 +957,7 @@ class Exa:
|
|
|
957
957
|
@overload
|
|
958
958
|
def get_contents(
|
|
959
959
|
self,
|
|
960
|
-
|
|
960
|
+
urls: Union[str, List[str], List[_Result]],
|
|
961
961
|
*,
|
|
962
962
|
summary: Union[SummaryContentsOptions, Literal[True]],
|
|
963
963
|
livecrawl_timeout: Optional[int] = None,
|
|
@@ -973,7 +973,7 @@ class Exa:
|
|
|
973
973
|
@overload
|
|
974
974
|
def get_contents(
|
|
975
975
|
self,
|
|
976
|
-
|
|
976
|
+
urls: Union[str, List[str], List[_Result]],
|
|
977
977
|
*,
|
|
978
978
|
text: Union[TextContentsOptions, Literal[True]],
|
|
979
979
|
summary: Union[SummaryContentsOptions, Literal[True]],
|
|
@@ -990,7 +990,7 @@ class Exa:
|
|
|
990
990
|
@overload
|
|
991
991
|
def get_contents(
|
|
992
992
|
self,
|
|
993
|
-
|
|
993
|
+
urls: Union[str, List[str], List[_Result]],
|
|
994
994
|
*,
|
|
995
995
|
highlights: Union[HighlightsContentsOptions, Literal[True]],
|
|
996
996
|
summary: Union[SummaryContentsOptions, Literal[True]],
|
|
@@ -1007,7 +1007,7 @@ class Exa:
|
|
|
1007
1007
|
@overload
|
|
1008
1008
|
def get_contents(
|
|
1009
1009
|
self,
|
|
1010
|
-
|
|
1010
|
+
urls: Union[str, List[str], List[_Result]],
|
|
1011
1011
|
*,
|
|
1012
1012
|
text: Union[TextContentsOptions, Literal[True]],
|
|
1013
1013
|
highlights: Union[HighlightsContentsOptions, Literal[True]],
|
|
@@ -1021,16 +1021,13 @@ class Exa:
|
|
|
1021
1021
|
flags: Optional[List[str]] = None,
|
|
1022
1022
|
) -> SearchResponse[ResultWithTextAndHighlightsAndSummary]:
|
|
1023
1023
|
...
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
and "summary" not in options
|
|
1032
|
-
and "extras" not in options
|
|
1033
|
-
):
|
|
1024
|
+
def get_contents(self, urls: Union[str, List[str], List[_Result]], **kwargs):
|
|
1025
|
+
options = {
|
|
1026
|
+
k: v
|
|
1027
|
+
for k, v in {"urls": urls, **kwargs}.items()
|
|
1028
|
+
if k != "self" and v is not None
|
|
1029
|
+
}
|
|
1030
|
+
if "text" not in options and "highlights" not in options and "summary" not in options and "extras" not in options:
|
|
1034
1031
|
options["text"] = True
|
|
1035
1032
|
|
|
1036
1033
|
validate_search_options(
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: exa-py
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.3
|
|
4
4
|
Summary: Python SDK for Exa API.
|
|
5
|
-
|
|
6
|
-
Author: Exa
|
|
5
|
+
Author: Exa AI
|
|
7
6
|
Author-email: hello@exa.ai
|
|
8
|
-
|
|
9
|
-
Classifier:
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Typing :: Typed
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
7
|
+
Requires-Python: >=3.9,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
9
|
Classifier: Programming Language :: Python :: 3.9
|
|
14
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Requires-Dist: openai (>=1.48,<2.0)
|
|
15
|
+
Requires-Dist: requests (>=2.32.3,<3.0.0)
|
|
16
|
+
Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
|
-
Requires-Dist: requests
|
|
19
|
-
Requires-Dist: typing-extensions
|
|
20
|
-
Requires-Dist: openai (>=1.10.0)
|
|
21
18
|
|
|
22
19
|
# Exa
|
|
23
20
|
|
|
@@ -81,14 +78,15 @@ exa = Exa(api_key="your-api-key")
|
|
|
81
78
|
results = exa.find_similar_and_contents("https://example.com", text=True, highlights=True)
|
|
82
79
|
|
|
83
80
|
# get text contents
|
|
84
|
-
results = exa.get_contents(["
|
|
81
|
+
results = exa.get_contents(["urls"])
|
|
85
82
|
|
|
86
83
|
# get highlights
|
|
87
|
-
results = exa.get_contents(["
|
|
84
|
+
results = exa.get_contents(["urls"], highlights=True)
|
|
88
85
|
|
|
89
86
|
# get contents with contents options
|
|
90
|
-
results = exa.get_contents(["
|
|
87
|
+
results = exa.get_contents(["urls"],
|
|
91
88
|
text={"include_html_tags": True, "max_characters": 1000},
|
|
92
89
|
highlights={"highlights_per_url": 2, "num_sentences": 1, "query": "This is the highlight query:"})
|
|
93
90
|
```
|
|
94
91
|
|
|
92
|
+
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
exa_py/__init__.py,sha256=1selemczpRm1y8V9cWNm90LARnU1jbtyp-Qpx3c7cTw,28
|
|
2
|
+
exa_py/api.py,sha256=s2PzWTN_NSECTlJjEnaN22frTnoxXw0PdO2aalKUX2I,53610
|
|
3
|
+
exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
|
|
5
|
+
exa_py-1.7.3.dist-info/METADATA,sha256=tMUP_KFmo-S9zvX72MFY3qW8MIMMj5ZtYUldP_4fTt4,2930
|
|
6
|
+
exa_py-1.7.3.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
7
|
+
exa_py-1.7.3.dist-info/RECORD,,
|
exa_py-1.7.2.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
exa_py/__init__.py,sha256=1selemczpRm1y8V9cWNm90LARnU1jbtyp-Qpx3c7cTw,28
|
|
2
|
-
exa_py/api.py,sha256=ssd6BKnt6cTmj7sXRFZRL5UljxV8oD545m91_YeEH7w,53349
|
|
3
|
-
exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
|
|
5
|
-
exa_py-1.7.2.dist-info/METADATA,sha256=sL65wDOkdMBBlOhxuZpD4UxxXqab0myIWc6qnYvcjsY,3032
|
|
6
|
-
exa_py-1.7.2.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
7
|
-
exa_py-1.7.2.dist-info/top_level.txt,sha256=Mfkmscdw9HWR1PtVhU1gAiVo6DHu_tyiVdb89gfZBVI,7
|
|
8
|
-
exa_py-1.7.2.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exa_py
|