exa-py 1.8.7__py3-none-any.whl → 1.8.8__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
@@ -686,7 +686,7 @@ class Exa:
686
686
  self,
687
687
  api_key: Optional[str],
688
688
  base_url: str = "https://api.exa.ai",
689
- user_agent: str = "exa-py 1.8.7",
689
+ user_agent: str = "exa-py 1.8.8",
690
690
  ):
691
691
  """Initialize the Exa client with the provided API key and optional base URL and user agent.
692
692
 
@@ -826,6 +826,8 @@ class Exa:
826
826
  use_autoprompt: Optional[bool] = None,
827
827
  type: Optional[str] = None,
828
828
  category: Optional[str] = None,
829
+ flags: Optional[List[str]] = None,
830
+ moderation: Optional[bool] = None,
829
831
  subpages: Optional[int] = None,
830
832
  livecrawl_timeout: Optional[int] = None,
831
833
  livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
@@ -974,6 +976,8 @@ class Exa:
974
976
  category: Optional[str] = None,
975
977
  subpages: Optional[int] = None,
976
978
  subpage_target: Optional[Union[str, List[str]]] = None,
979
+ flags: Optional[List[str]] = None,
980
+ moderation: Optional[bool] = None,
977
981
  livecrawl_timeout: Optional[int] = None,
978
982
  livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
979
983
  filter_empty_results: Optional[bool] = None,
@@ -1002,11 +1006,12 @@ class Exa:
1002
1006
  type: Optional[str] = None,
1003
1007
  category: Optional[str] = None,
1004
1008
  flags: Optional[List[str]] = None,
1009
+ moderation: Optional[bool] = None,
1005
1010
  livecrawl_timeout: Optional[int] = None,
1006
1011
  livecrawl: Optional[LIVECRAWL_OPTIONS] = None,
1007
- filter_empty_results: Optional[bool] = None,
1008
1012
  subpages: Optional[int] = None,
1009
1013
  subpage_target: Optional[Union[str, List[str]]] = None,
1014
+ filter_empty_results: Optional[bool] = None,
1010
1015
  extras: Optional[ExtrasOptions] = None,
1011
1016
  ) -> SearchResponse[ResultWithTextAndHighlightsAndSummary]:
1012
1017
  ...
@@ -1656,6 +1661,7 @@ class Exa:
1656
1661
  *,
1657
1662
  stream: Optional[bool] = False,
1658
1663
  text: Optional[bool] = False,
1664
+ model: Optional[Literal["exa", "exa-pro"]] = None,
1659
1665
  ) -> Union[AnswerResponse, StreamAnswerResponse]:
1660
1666
  ...
1661
1667
 
@@ -1665,12 +1671,14 @@ class Exa:
1665
1671
  *,
1666
1672
  stream: Optional[bool] = False,
1667
1673
  text: Optional[bool] = False,
1674
+ model: Optional[Literal["exa", "exa-pro"]] = None,
1668
1675
  ) -> Union[AnswerResponse, StreamAnswerResponse]:
1669
1676
  """Generate an answer to a query using Exa's search and LLM capabilities.
1670
1677
 
1671
1678
  Args:
1672
1679
  query (str): The query to answer.
1673
1680
  text (bool, optional): Whether to include full text in the results. Defaults to False.
1681
+ model (str, optional): The model to use for answering. Either "exa" or "exa-pro". Defaults to None.
1674
1682
 
1675
1683
  Returns:
1676
1684
  AnswerResponse: An object containing the answer and citations.
@@ -1702,12 +1710,14 @@ class Exa:
1702
1710
  query: str,
1703
1711
  *,
1704
1712
  text: bool = False,
1713
+ model: Optional[Literal["exa", "exa-pro"]] = None,
1705
1714
  ) -> StreamAnswerResponse:
1706
1715
  """Generate a streaming answer response.
1707
1716
 
1708
1717
  Args:
1709
1718
  query (str): The query to answer.
1710
1719
  text (bool): Whether to include full text in the results. Defaults to False.
1720
+ model (str, optional): The model to use for answering. Either "exa" or "exa-pro". Defaults to None.
1711
1721
 
1712
1722
  Returns:
1713
1723
  StreamAnswerResponse: An object that can be iterated over to retrieve (partial text, partial citations).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: exa-py
3
- Version: 1.8.7
3
+ Version: 1.8.8
4
4
  Summary: Python SDK for Exa API.
5
5
  Author: Exa AI
6
6
  Author-email: hello@exa.ai
@@ -91,8 +91,8 @@ exa = Exa(api_key="your-api-key")
91
91
  # basic answer
92
92
  response = exa.answer("This is a query to answer a question")
93
93
 
94
- # answer with full text
95
- response = exa.answer("This is a query to answer a question", text=True)
94
+ # answer with full text, using the exa-pro model (sends 2 expanded quries to exa search)
95
+ response = exa.answer("This is a query to answer a question", text=True, model="exa-pro")
96
96
 
97
97
  # answer with streaming
98
98
  response = exa.stream_answer("This is a query to answer:")
@@ -0,0 +1,7 @@
1
+ exa_py/__init__.py,sha256=1selemczpRm1y8V9cWNm90LARnU1jbtyp-Qpx3c7cTw,28
2
+ exa_py/api.py,sha256=yzQkUJ94RbnMglVjpevmwuixvKnkwhN_r6KuVV9j3Sw,63279
3
+ exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
5
+ exa_py-1.8.8.dist-info/METADATA,sha256=UV9_4Df_l1JP-SPRFfryyg7SP7VwYNZ3Iz34FsIXP3M,3419
6
+ exa_py-1.8.8.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
7
+ exa_py-1.8.8.dist-info/RECORD,,
exa_py/example.py DELETED
@@ -1,11 +0,0 @@
1
- from exa_py import Exa
2
-
3
- exa = Exa(api_key = "995da727-7b91-42d0-b282-326daa290b39")
4
-
5
- response = exa.stream_answer(
6
- "How close are we to meeting aliens?",
7
- text=True
8
- )
9
-
10
- for chunk in response:
11
- print(chunk, end='', flush=True)
@@ -1,8 +0,0 @@
1
- exa_py/__init__.py,sha256=1selemczpRm1y8V9cWNm90LARnU1jbtyp-Qpx3c7cTw,28
2
- exa_py/api.py,sha256=5uuKVZpLtXQvxEi_X7W_x8JYqTQlsO8R2Ln0IRAQCrk,62663
3
- exa_py/example.py,sha256=V2uZvFTQFLVr61lVQ_HbZz8G8TFT6Ic44-TTE5ixzBk,235
4
- exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
6
- exa_py-1.8.7.dist-info/METADATA,sha256=xbby0b9LVLEzzBMu1mGivh0ZO0gDm_xjvPoF219riLk,3337
7
- exa_py-1.8.7.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
8
- exa_py-1.8.7.dist-info/RECORD,,
File without changes