exa-py 1.8.9__py3-none-any.whl → 1.9.0__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
@@ -47,6 +47,12 @@ def snake_to_camel(snake_str: str) -> str:
47
47
  Returns:
48
48
  str: The string converted to camelCase format.
49
49
  """
50
+ # Handle special cases where the field should start with non-alphanumeric characters
51
+ if snake_str == "schema_":
52
+ return "$schema"
53
+ if snake_str == "not_":
54
+ return "not"
55
+
50
56
  components = snake_str.split("_")
51
57
  return components[0] + "".join(x.title() for x in components[1:])
52
58
 
@@ -247,15 +253,38 @@ class HighlightsContentsOptions(TypedDict, total=False):
247
253
  highlights_per_url: int
248
254
 
249
255
 
256
+ class JSONSchema(TypedDict, total=False):
257
+ """Represents a JSON Schema definition used for structured summary output.
258
+ To learn more visit https://json-schema.org/overview/what-is-jsonschema.
259
+ """
260
+ schema_: str # This will be converted to "$schema" in JSON
261
+ title: str
262
+ description: str
263
+ type: Literal["object", "array", "string", "number", "boolean", "null", "integer"]
264
+ properties: Dict[str, JSONSchema]
265
+ items: Union[JSONSchema, List[JSONSchema]]
266
+ required: List[str]
267
+ enum: List
268
+ additionalProperties: Union[bool, JSONSchema]
269
+ definitions: Dict[str, JSONSchema]
270
+ patternProperties: Dict[str, JSONSchema]
271
+ allOf: List[JSONSchema]
272
+ anyOf: List[JSONSchema]
273
+ oneOf: List[JSONSchema]
274
+ not_: JSONSchema # This will be converted to "not" in JSON
275
+
276
+
250
277
  class SummaryContentsOptions(TypedDict, total=False):
251
278
  """A class representing the options that you can specify when requesting summary
252
279
 
253
280
  Attributes:
254
281
  query (str): The query string for the summary. Summary will bias towards answering the query.
282
+ schema (JSONSchema): JSON schema for structured output from summary.
255
283
  """
256
284
 
257
285
  query: str
258
-
286
+ schema: JSONSchema
287
+
259
288
 
260
289
  class ExtrasOptions(TypedDict, total=False):
261
290
  """A class representing additional extraction fields (e.g. links, images)"""
@@ -759,7 +788,7 @@ class Exa:
759
788
  self,
760
789
  api_key: Optional[str],
761
790
  base_url: str = "https://api.exa.ai",
762
- user_agent: str = "exa-py 1.8.9",
791
+ user_agent: str = "exa-py 1.9.0",
763
792
  ):
764
793
  """Initialize the Exa client with the provided API key and optional base URL and user agent.
765
794
 
@@ -1,23 +1,20 @@
1
- Metadata-Version: 2.1
2
- Name: exa_py
3
- Version: 1.8.9
1
+ Metadata-Version: 2.3
2
+ Name: exa-py
3
+ Version: 1.9.0
4
4
  Summary: Python SDK for Exa API.
5
- Home-page: https://github.com/exa-labs/exa-py
6
- Author: Exa
5
+ Author: Exa AI
7
6
  Author-email: hello@exa.ai
8
- Classifier: Development Status :: 5 - Production/Stable
9
- Classifier: Intended Audience :: Developers
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
 
@@ -106,3 +103,4 @@ exa = Exa(api_key="your-api-key")
106
103
 
107
104
  ```
108
105
 
106
+
@@ -0,0 +1,7 @@
1
+ exa_py/__init__.py,sha256=1selemczpRm1y8V9cWNm90LARnU1jbtyp-Qpx3c7cTw,28
2
+ exa_py/api.py,sha256=Y9oeiUHGgy2a6o8aBMUbCzWSTG6VFpowO_B2WYazqBg,66264
3
+ exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
5
+ exa_py-1.9.0.dist-info/METADATA,sha256=1s4-K0s9Sf443Kkm0pLZ1vZvRd-ifOrXvdr7ZKSmbp0,3419
6
+ exa_py-1.9.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
7
+ exa_py-1.9.0.dist-info/RECORD,,
@@ -1,5 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: poetry-core 2.1.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
-
@@ -1,8 +0,0 @@
1
- exa_py/__init__.py,sha256=1selemczpRm1y8V9cWNm90LARnU1jbtyp-Qpx3c7cTw,28
2
- exa_py/api.py,sha256=BSZ-uSRYfCyHWBMUpV4SV-2yaWustPS7xc63gArbJSE,65156
3
- exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
5
- exa_py-1.8.9.dist-info/METADATA,sha256=O_ivBX4PUV2yWQPL69nSmXlqP6S0BTlTYiVMpz4nLAM,3522
6
- exa_py-1.8.9.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
7
- exa_py-1.8.9.dist-info/top_level.txt,sha256=Mfkmscdw9HWR1PtVhU1gAiVo6DHu_tyiVdb89gfZBVI,7
8
- exa_py-1.8.9.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- exa_py