exa-py 1.0.18__tar.gz → 1.1.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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exa_py
3
- Version: 1.0.18
3
+ Version: 1.1.0
4
4
  Summary: Python SDK for Exa API.
5
5
  Home-page: https://github.com/exa-labs/exa-py
6
6
  Author: Exa
@@ -9,13 +9,15 @@ Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Typing :: Typed
12
- Classifier: Programming Language :: Python :: 3.7
13
12
  Classifier: Programming Language :: Python :: 3.8
14
13
  Classifier: Programming Language :: Python :: 3.9
15
14
  Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Description-Content-Type: text/markdown
18
+ Requires-Dist: requests
19
+ Requires-Dist: typing-extensions
20
+ Requires-Dist: openai>=1.10.0
19
21
 
20
22
  # Exa
21
23
 
@@ -27,6 +27,12 @@ from exa_py.utils import (
27
27
  format_exa_result,
28
28
  maybe_get_query,
29
29
  )
30
+ from dotenv import load_dotenv
31
+ import os
32
+
33
+ load_dotenv()
34
+
35
+ is_beta = os.getenv("IS_BETA") == "True"
30
36
 
31
37
 
32
38
  def snake_to_camel(snake_str: str) -> str:
@@ -132,8 +138,18 @@ CONTENTS_OPTIONS_TYPES = {
132
138
  "text": [dict, bool],
133
139
  "highlights": [dict, bool],
134
140
  "summary": [dict, bool],
141
+ "metadata": [dict, bool],
142
+
135
143
  }
136
144
 
145
+ # the livecrawl options
146
+ LIVECRAWL_OPTIONS = Literal["always", "fallback", "never"]
147
+ CONTENTS_OPTIONS_TYPES["livecrawl_timeout"] = [int]
148
+ CONTENTS_OPTIONS_TYPES["livecrawl"] = [LIVECRAWL_OPTIONS]
149
+
150
+ if is_beta:
151
+ CONTENTS_OPTIONS_TYPES["filter_empty_results"] = [bool]
152
+
137
153
 
138
154
  def validate_search_options(
139
155
  options: Dict[str, Optional[object]], expected: dict
@@ -530,6 +546,9 @@ class Exa:
530
546
  use_autoprompt: Optional[bool] = None,
531
547
  type: Optional[str] = None,
532
548
  category: Optional[str] = None,
549
+ livecrawl_timeout: Optional[int] = None,
550
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
551
+ filter_empty_results: Optional[bool] = None,
533
552
  ) -> SearchResponse[ResultWithText]:
534
553
  ...
535
554
 
@@ -551,6 +570,9 @@ class Exa:
551
570
  use_autoprompt: Optional[bool] = None,
552
571
  type: Optional[str] = None,
553
572
  category: Optional[str] = None,
573
+ livecrawl_timeout: Optional[int] = None,
574
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
575
+ filter_empty_results: Optional[bool] = None,
554
576
  ) -> SearchResponse[ResultWithText]:
555
577
  ...
556
578
 
@@ -572,6 +594,9 @@ class Exa:
572
594
  use_autoprompt: Optional[bool] = None,
573
595
  type: Optional[str] = None,
574
596
  category: Optional[str] = None,
597
+ livecrawl_timeout: Optional[int] = None,
598
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
599
+ filter_empty_results: Optional[bool] = None,
575
600
  ) -> SearchResponse[ResultWithHighlights]:
576
601
  ...
577
602
 
@@ -594,6 +619,9 @@ class Exa:
594
619
  use_autoprompt: Optional[bool] = None,
595
620
  type: Optional[str] = None,
596
621
  category: Optional[str] = None,
622
+ livecrawl_timeout: Optional[int] = None,
623
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
624
+ filter_empty_results: Optional[bool] = None,
597
625
  ) -> SearchResponse[ResultWithTextAndHighlights]:
598
626
  ...
599
627
 
@@ -615,6 +643,9 @@ class Exa:
615
643
  use_autoprompt: Optional[bool] = None,
616
644
  type: Optional[str] = None,
617
645
  category: Optional[str] = None,
646
+ livecrawl_timeout: Optional[int] = None,
647
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
648
+ filter_empty_results: Optional[bool] = None,
618
649
  ) -> SearchResponse[ResultWithSummary]:
619
650
  ...
620
651
 
@@ -637,6 +668,9 @@ class Exa:
637
668
  use_autoprompt: Optional[bool] = None,
638
669
  type: Optional[str] = None,
639
670
  category: Optional[str] = None,
671
+ livecrawl_timeout: Optional[int] = None,
672
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
673
+ filter_empty_results: Optional[bool] = None,
640
674
  ) -> SearchResponse[ResultWithTextAndSummary]:
641
675
  ...
642
676
 
@@ -659,6 +693,9 @@ class Exa:
659
693
  use_autoprompt: Optional[bool] = None,
660
694
  type: Optional[str] = None,
661
695
  category: Optional[str] = None,
696
+ livecrawl_timeout: Optional[int] = None,
697
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
698
+ filter_empty_results: Optional[bool] = None,
662
699
  ) -> SearchResponse[ResultWithHighlightsAndSummary]:
663
700
  ...
664
701
 
@@ -682,6 +719,9 @@ class Exa:
682
719
  use_autoprompt: Optional[bool] = None,
683
720
  type: Optional[str] = None,
684
721
  category: Optional[str] = None,
722
+ livecrawl_timeout: Optional[int] = None,
723
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
724
+ filter_empty_results: Optional[bool] = None,
685
725
  ) -> SearchResponse[ResultWithTextAndHighlightsAndSummary]:
686
726
  ...
687
727
 
@@ -709,6 +749,9 @@ class Exa:
709
749
  def get_contents(
710
750
  self,
711
751
  ids: Union[str, List[str], List[_Result]],
752
+ livecrawl_timeout: Optional[int] = None,
753
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
754
+ filter_empty_results: Optional[bool] = None,
712
755
  ) -> SearchResponse[ResultWithText]:
713
756
  ...
714
757
 
@@ -718,6 +761,9 @@ class Exa:
718
761
  ids: Union[str, List[str], List[_Result]],
719
762
  *,
720
763
  text: Union[TextContentsOptions, Literal[True]],
764
+ livecrawl_timeout: Optional[int] = None,
765
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
766
+ filter_empty_results: Optional[bool] = None,
721
767
  ) -> SearchResponse[ResultWithText]:
722
768
  ...
723
769
 
@@ -727,6 +773,9 @@ class Exa:
727
773
  ids: Union[str, List[str], List[_Result]],
728
774
  *,
729
775
  highlights: Union[HighlightsContentsOptions, Literal[True]],
776
+ livecrawl_timeout: Optional[int] = None,
777
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
778
+ filter_empty_results: Optional[bool] = None,
730
779
  ) -> SearchResponse[ResultWithHighlights]:
731
780
  ...
732
781
 
@@ -737,6 +786,9 @@ class Exa:
737
786
  *,
738
787
  text: Union[TextContentsOptions, Literal[True]],
739
788
  highlights: Union[HighlightsContentsOptions, Literal[True]],
789
+ livecrawl_timeout: Optional[int] = None,
790
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
791
+ filter_empty_results: Optional[bool] = None,
740
792
  ) -> SearchResponse[ResultWithTextAndHighlights]:
741
793
  ...
742
794
 
@@ -746,6 +798,9 @@ class Exa:
746
798
  ids: Union[str, List[str], List[_Result]],
747
799
  *,
748
800
  summary: Union[SummaryContentsOptions, Literal[True]],
801
+ livecrawl_timeout: Optional[int] = None,
802
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
803
+ filter_empty_results: Optional[bool] = None,
749
804
  ) -> SearchResponse[ResultWithSummary]:
750
805
  ...
751
806
 
@@ -756,6 +811,9 @@ class Exa:
756
811
  *,
757
812
  text: Union[TextContentsOptions, Literal[True]],
758
813
  summary: Union[SummaryContentsOptions, Literal[True]],
814
+ livecrawl_timeout: Optional[int] = None,
815
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
816
+ filter_empty_results: Optional[bool] = None,
759
817
  ) -> SearchResponse[ResultWithTextAndSummary]:
760
818
  ...
761
819
 
@@ -766,6 +824,9 @@ class Exa:
766
824
  *,
767
825
  highlights: Union[HighlightsContentsOptions, Literal[True]],
768
826
  summary: Union[SummaryContentsOptions, Literal[True]],
827
+ livecrawl_timeout: Optional[int] = None,
828
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
829
+ filter_empty_results: Optional[bool] = None,
769
830
  ) -> SearchResponse[ResultWithHighlightsAndSummary]:
770
831
  ...
771
832
 
@@ -777,6 +838,9 @@ class Exa:
777
838
  text: Union[TextContentsOptions, Literal[True]],
778
839
  highlights: Union[HighlightsContentsOptions, Literal[True]],
779
840
  summary: Union[SummaryContentsOptions, Literal[True]],
841
+ livecrawl_timeout: Optional[int] = None,
842
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
843
+ filter_empty_results: Optional[bool] = None,
780
844
  ) -> SearchResponse[ResultWithTextAndHighlightsAndSummary]:
781
845
  ...
782
846
 
@@ -839,6 +903,9 @@ class Exa:
839
903
  exclude_text: Optional[List[str]] = None,
840
904
  exclude_source_domain: Optional[bool] = None,
841
905
  category: Optional[str] = None,
906
+ livecrawl_timeout: Optional[int] = None,
907
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
908
+ filter_empty_results: Optional[bool] = None,
842
909
  ) -> SearchResponse[ResultWithText]:
843
910
  ...
844
911
 
@@ -859,6 +926,9 @@ class Exa:
859
926
  exclude_text: Optional[List[str]] = None,
860
927
  exclude_source_domain: Optional[bool] = None,
861
928
  category: Optional[str] = None,
929
+ livecrawl_timeout: Optional[int] = None,
930
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
931
+ filter_empty_results: Optional[bool] = None,
862
932
  ) -> SearchResponse[ResultWithText]:
863
933
  ...
864
934
 
@@ -879,6 +949,9 @@ class Exa:
879
949
  exclude_text: Optional[List[str]] = None,
880
950
  exclude_source_domain: Optional[bool] = None,
881
951
  category: Optional[str] = None,
952
+ livecrawl_timeout: Optional[int] = None,
953
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
954
+ filter_empty_results: Optional[bool] = None,
882
955
  ) -> SearchResponse[ResultWithHighlights]:
883
956
  ...
884
957
 
@@ -900,6 +973,9 @@ class Exa:
900
973
  exclude_text: Optional[List[str]] = None,
901
974
  exclude_source_domain: Optional[bool] = None,
902
975
  category: Optional[str] = None,
976
+ livecrawl_timeout: Optional[int] = None,
977
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
978
+ filter_empty_results: Optional[bool] = None,
903
979
  ) -> SearchResponse[ResultWithTextAndHighlights]:
904
980
  ...
905
981
 
@@ -920,6 +996,9 @@ class Exa:
920
996
  exclude_text: Optional[List[str]] = None,
921
997
  exclude_source_domain: Optional[bool] = None,
922
998
  category: Optional[str] = None,
999
+ livecrawl_timeout: Optional[int] = None,
1000
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
1001
+ filter_empty_results: Optional[bool] = None,
923
1002
  ) -> SearchResponse[ResultWithSummary]:
924
1003
  ...
925
1004
 
@@ -941,6 +1020,9 @@ class Exa:
941
1020
  exclude_text: Optional[List[str]] = None,
942
1021
  exclude_source_domain: Optional[bool] = None,
943
1022
  category: Optional[str] = None,
1023
+ livecrawl_timeout: Optional[int] = None,
1024
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
1025
+ filter_empty_results: Optional[bool] = None,
944
1026
  ) -> SearchResponse[ResultWithTextAndSummary]:
945
1027
  ...
946
1028
 
@@ -962,6 +1044,9 @@ class Exa:
962
1044
  exclude_text: Optional[List[str]] = None,
963
1045
  exclude_source_domain: Optional[bool] = None,
964
1046
  category: Optional[str] = None,
1047
+ livecrawl_timeout: Optional[int] = None,
1048
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
1049
+ filter_empty_results: Optional[bool] = None,
965
1050
  ) -> SearchResponse[ResultWithHighlightsAndSummary]:
966
1051
  ...
967
1052
 
@@ -984,6 +1069,9 @@ class Exa:
984
1069
  exclude_text: Optional[List[str]] = None,
985
1070
  exclude_source_domain: Optional[bool] = None,
986
1071
  category: Optional[str] = None,
1072
+ livecrawl_timeout: Optional[int] = None,
1073
+ livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
1074
+ filter_empty_results: Optional[bool] = None,
987
1075
  ) -> SearchResponse[ResultWithTextAndHighlightsAndSummary]:
988
1076
  ...
989
1077
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
- Name: exa-py
3
- Version: 1.0.18
2
+ Name: exa_py
3
+ Version: 1.1.0
4
4
  Summary: Python SDK for Exa API.
5
5
  Home-page: https://github.com/exa-labs/exa-py
6
6
  Author: Exa
@@ -9,13 +9,15 @@ Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Typing :: Typed
12
- Classifier: Programming Language :: Python :: 3.7
13
12
  Classifier: Programming Language :: Python :: 3.8
14
13
  Classifier: Programming Language :: Python :: 3.9
15
14
  Classifier: Programming Language :: Python :: 3.10
16
15
  Classifier: Programming Language :: Python :: 3.11
17
16
  Classifier: Programming Language :: Python :: 3.12
18
17
  Description-Content-Type: text/markdown
18
+ Requires-Dist: requests
19
+ Requires-Dist: typing-extensions
20
+ Requires-Dist: openai>=1.10.0
19
21
 
20
22
  # Exa
21
23
 
@@ -1,4 +1,5 @@
1
1
  README.md
2
+ pyproject.toml
2
3
  setup.py
3
4
  exa_py/__init__.py
4
5
  exa_py/api.py
@@ -0,0 +1,24 @@
1
+ [tool.poetry]
2
+ name = "exa-py"
3
+ version = "1.0.18"
4
+ description = "Python SDK for Exa API."
5
+ authors = ["Exa AI <hello@exa.ai>"]
6
+ readme = "README.md"
7
+
8
+ [tool.poetry.dependencies]
9
+ python = "^3.9"
10
+ requests = "^2.32.3"
11
+ typing-extensions = "^4.12.2"
12
+ openai = "^1.10"
13
+
14
+
15
+ [tool.poetry.group.dev.dependencies]
16
+ python-dotenv = "^1.0.1"
17
+ setuptools = "^74.0.0"
18
+ docutils = "^0.21.2"
19
+ twine = "^5.1.1"
20
+
21
+
22
+ [build-system]
23
+ requires = ["poetry-core"]
24
+ build-backend = "poetry.core.masonry.api"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="exa_py",
5
- version="1.0.18",
5
+ version="1.1.0",
6
6
  description="Python SDK for Exa API.",
7
7
  long_description_content_type="text/markdown",
8
8
  long_description=open("README.md").read(),
@@ -21,7 +21,6 @@ setup(
21
21
  "Intended Audience :: Developers",
22
22
  "License :: OSI Approved :: MIT License",
23
23
  "Typing :: Typed",
24
- "Programming Language :: Python :: 3.7",
25
24
  "Programming Language :: Python :: 3.8",
26
25
  "Programming Language :: Python :: 3.9",
27
26
  "Programming Language :: Python :: 3.10",
File without changes
File without changes
File without changes
File without changes
File without changes