exa-py 1.3.1b0__tar.gz → 1.4.0__tar.gz
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-1.3.1b0 → exa_py-1.4.0}/PKG-INFO +1 -1
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py/api.py +13 -23
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py.egg-info/PKG-INFO +1 -1
- {exa_py-1.3.1b0 → exa_py-1.4.0}/setup.py +1 -1
- {exa_py-1.3.1b0 → exa_py-1.4.0}/README.md +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py/__init__.py +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py/py.typed +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py/utils.py +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py.egg-info/SOURCES.txt +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py.egg-info/dependency_links.txt +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py.egg-info/requires.txt +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/exa_py.egg-info/top_level.txt +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/pyproject.toml +0 -0
- {exa_py-1.3.1b0 → exa_py-1.4.0}/setup.cfg +0 -0
|
@@ -146,11 +146,6 @@ CONTENTS_OPTIONS_TYPES = {
|
|
|
146
146
|
"filter_empty_results": [bool],
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
CONTENTS_ENDPOINT_OPTIONS_TYPES = {
|
|
150
|
-
"subpages": [int], # Number of subpages to get contents for; these will appear as additional content results
|
|
151
|
-
"subpage_target": [str, list] # Specific subpage(s) to get contents for
|
|
152
|
-
}
|
|
153
|
-
|
|
154
149
|
# FOR BETA OPTIONS
|
|
155
150
|
# if is_beta:
|
|
156
151
|
|
|
@@ -238,6 +233,16 @@ class _Result:
|
|
|
238
233
|
score: Optional[float] = None
|
|
239
234
|
published_date: Optional[str] = None
|
|
240
235
|
author: Optional[str] = None
|
|
236
|
+
image: Optional[str] = None
|
|
237
|
+
|
|
238
|
+
def __init__(self, **kwargs):
|
|
239
|
+
self.url = kwargs['url']
|
|
240
|
+
self.id = kwargs['id']
|
|
241
|
+
self.title = kwargs.get('title')
|
|
242
|
+
self.score = kwargs.get('score')
|
|
243
|
+
self.published_date = kwargs.get('published_date')
|
|
244
|
+
self.author = kwargs.get('author')
|
|
245
|
+
self.image = kwargs.get('image')
|
|
241
246
|
|
|
242
247
|
def __str__(self):
|
|
243
248
|
return (
|
|
@@ -247,6 +252,7 @@ class _Result:
|
|
|
247
252
|
f"Score: {self.score}\n"
|
|
248
253
|
f"Published Date: {self.published_date}\n"
|
|
249
254
|
f"Author: {self.author}\n"
|
|
255
|
+
f"Image: {self.image}\n"
|
|
250
256
|
)
|
|
251
257
|
|
|
252
258
|
|
|
@@ -471,7 +477,7 @@ class Exa:
|
|
|
471
477
|
self,
|
|
472
478
|
api_key: Optional[str],
|
|
473
479
|
base_url: str = "https://api.exa.ai",
|
|
474
|
-
user_agent: str = "exa-py 1.
|
|
480
|
+
user_agent: str = "exa-py 1.4.0",
|
|
475
481
|
):
|
|
476
482
|
"""Initialize the Exa client with the provided API key and optional base URL and user agent.
|
|
477
483
|
|
|
@@ -769,8 +775,6 @@ class Exa:
|
|
|
769
775
|
livecrawl_timeout: Optional[int] = None,
|
|
770
776
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
771
777
|
filter_empty_results: Optional[bool] = None,
|
|
772
|
-
subpages: Optional[int] = None,
|
|
773
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
774
778
|
) -> SearchResponse[ResultWithText]:
|
|
775
779
|
...
|
|
776
780
|
|
|
@@ -783,8 +787,6 @@ class Exa:
|
|
|
783
787
|
livecrawl_timeout: Optional[int] = None,
|
|
784
788
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
785
789
|
filter_empty_results: Optional[bool] = None,
|
|
786
|
-
subpages: Optional[int] = None,
|
|
787
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
788
790
|
) -> SearchResponse[ResultWithText]:
|
|
789
791
|
...
|
|
790
792
|
|
|
@@ -797,8 +799,6 @@ class Exa:
|
|
|
797
799
|
livecrawl_timeout: Optional[int] = None,
|
|
798
800
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
799
801
|
filter_empty_results: Optional[bool] = None,
|
|
800
|
-
subpages: Optional[int] = None,
|
|
801
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
802
802
|
) -> SearchResponse[ResultWithHighlights]:
|
|
803
803
|
...
|
|
804
804
|
|
|
@@ -812,8 +812,6 @@ class Exa:
|
|
|
812
812
|
livecrawl_timeout: Optional[int] = None,
|
|
813
813
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
814
814
|
filter_empty_results: Optional[bool] = None,
|
|
815
|
-
subpages: Optional[int] = None,
|
|
816
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
817
815
|
) -> SearchResponse[ResultWithTextAndHighlights]:
|
|
818
816
|
...
|
|
819
817
|
|
|
@@ -826,8 +824,6 @@ class Exa:
|
|
|
826
824
|
livecrawl_timeout: Optional[int] = None,
|
|
827
825
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
828
826
|
filter_empty_results: Optional[bool] = None,
|
|
829
|
-
subpages: Optional[int] = None,
|
|
830
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
831
827
|
) -> SearchResponse[ResultWithSummary]:
|
|
832
828
|
...
|
|
833
829
|
|
|
@@ -841,8 +837,6 @@ class Exa:
|
|
|
841
837
|
livecrawl_timeout: Optional[int] = None,
|
|
842
838
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
843
839
|
filter_empty_results: Optional[bool] = None,
|
|
844
|
-
subpages: Optional[int] = None,
|
|
845
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
846
840
|
) -> SearchResponse[ResultWithTextAndSummary]:
|
|
847
841
|
...
|
|
848
842
|
|
|
@@ -856,8 +850,6 @@ class Exa:
|
|
|
856
850
|
livecrawl_timeout: Optional[int] = None,
|
|
857
851
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
858
852
|
filter_empty_results: Optional[bool] = None,
|
|
859
|
-
subpages: Optional[int] = None,
|
|
860
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
861
853
|
) -> SearchResponse[ResultWithHighlightsAndSummary]:
|
|
862
854
|
...
|
|
863
855
|
|
|
@@ -872,8 +864,6 @@ class Exa:
|
|
|
872
864
|
livecrawl_timeout: Optional[int] = None,
|
|
873
865
|
livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
|
|
874
866
|
filter_empty_results: Optional[bool] = None,
|
|
875
|
-
subpages: Optional[int] = None,
|
|
876
|
-
subpage_target: Optional[Union[str, List[str]]] = None
|
|
877
867
|
) -> SearchResponse[ResultWithTextAndHighlightsAndSummary]:
|
|
878
868
|
...
|
|
879
869
|
|
|
@@ -885,7 +875,7 @@ class Exa:
|
|
|
885
875
|
}
|
|
886
876
|
if "text" not in options and "highlights" not in options and "summary" not in options:
|
|
887
877
|
options["text"] = True
|
|
888
|
-
validate_search_options(options, {**CONTENTS_OPTIONS_TYPES
|
|
878
|
+
validate_search_options(options, {**CONTENTS_OPTIONS_TYPES})
|
|
889
879
|
options = to_camel_case(options)
|
|
890
880
|
data = self.request("/contents", options)
|
|
891
881
|
return SearchResponse(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|