exa-py 1.14.0__py3-none-any.whl → 1.14.1__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/research/client.py CHANGED
@@ -9,7 +9,7 @@ block, but at runtime we only pay the cost if/when a helper is actually used.
9
9
 
10
10
  from __future__ import annotations
11
11
 
12
- from typing import TYPE_CHECKING, Any, Dict, Optional
12
+ from typing import TYPE_CHECKING, Any, Dict, Optional, Literal
13
13
 
14
14
  if TYPE_CHECKING: # pragma: no cover – only for static analysers
15
15
  # Import with full type info when static type-checking. `_Result` still
@@ -39,15 +39,20 @@ class ResearchClient:
39
39
  self,
40
40
  *,
41
41
  instructions: str,
42
- model: str = "exa-research",
43
- output_schema: Dict[str, Any],
42
+ model: Literal["exa-research", "exa-research-pro"] = "exa-research",
43
+ output_infer_schema: bool = None,
44
+ output_schema: Dict[str, Any] = None,
44
45
  ) -> "ResearchTaskId":
45
46
  """Submit a research request and return the *task identifier*."""
46
- payload = {
47
- "instructions": instructions,
48
- "model": model,
49
- "output": {"schema": output_schema},
50
- }
47
+ payload = {"instructions": instructions}
48
+ if model is not None:
49
+ payload["model"] = model
50
+ if output_schema is not None or output_infer_schema is not None:
51
+ payload["output"] = {}
52
+ if output_schema is not None:
53
+ payload["output"]["schema"] = output_schema
54
+ if output_infer_schema is not None:
55
+ payload["output"]["inferSchema"] = output_infer_schema
51
56
 
52
57
  raw_response: Dict[str, Any] = self._client.request(
53
58
  "/research/v0/tasks", payload
@@ -64,9 +69,7 @@ class ResearchClient:
64
69
 
65
70
  return ResearchTaskId(id=raw_response["id"])
66
71
 
67
- def get_task(
68
- self, id: str
69
- ) -> "ResearchTask": # noqa: D401 – imperative mood is fine
72
+ def get_task(self, id: str) -> "ResearchTask": # noqa: D401 – imperative mood is fine
70
73
  """Fetch the current status / result for a research task."""
71
74
  endpoint = f"/research/v0/tasks/{id}"
72
75
 
@@ -175,7 +178,7 @@ class AsyncResearchClient:
175
178
  self,
176
179
  *,
177
180
  instructions: str,
178
- model: str = "exa-research",
181
+ model: Literal["exa-research", "exa-research-pro"] = "exa-research",
179
182
  output_schema: Dict[str, Any],
180
183
  ) -> "ResearchTaskId":
181
184
  """Submit a research request and return the *task identifier* (async)."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: exa-py
3
- Version: 1.14.0
3
+ Version: 1.14.1
4
4
  Summary: Python SDK for Exa API.
5
5
  License: MIT
6
6
  Author: Exa AI
@@ -2,7 +2,7 @@ exa_py/__init__.py,sha256=M2GC9oSdoV6m2msboW0vMWWl8wrth4o6gmEV4MYLGG8,66
2
2
  exa_py/api.py,sha256=zwTEiIkWa6Gynx5NW9VMMY4Nws63gVDRSmzKdT4v2aY,84903
3
3
  exa_py/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  exa_py/research/__init__.py,sha256=QeY-j6bP4QP5tF9ytX0IeQhJvd0Wn4cJCD69U8pP7kA,271
5
- exa_py/research/client.py,sha256=oFQpczMcfA20Sn_yq36As8GlFo2u8B77IqVMMRqt3qE,11481
5
+ exa_py/research/client.py,sha256=C2ukFq_dE1xUfhMlHwpD9cY5rDClgn8N92pH4_FEVpE,11901
6
6
  exa_py/research/models.py,sha256=j7YgRoMRp2MLgnaij7775x_hJEeV5gksKpfLwmawqxY,3704
7
7
  exa_py/utils.py,sha256=Rc1FJjoR9LQ7L_OJM91Sd1GNkbHjcLyEvJENhRix6gc,2405
8
8
  exa_py/websets/__init__.py,sha256=uOBAb9VrIHrPKoddGOp2ai2KgWlyUVCLMZqfbGOlboA,70
@@ -23,6 +23,6 @@ exa_py/websets/streams/runs/client.py,sha256=ja63-G0Y74YDgsWq30aoa0llIx8I9mIwbCb
23
23
  exa_py/websets/types.py,sha256=-KmC6N9LMh5fPhhXZslmUyQcSmBqIdPF-qQ27qS4GEw,34756
24
24
  exa_py/websets/webhooks/__init__.py,sha256=iTPBCxFd73z4RifLQMX6iRECx_6pwlI5qscLNjMOUHE,77
25
25
  exa_py/websets/webhooks/client.py,sha256=zsIRMTeJU65yj-zo7Zz-gG02Prtzgcx6utGFSoY4HQQ,4222
26
- exa_py-1.14.0.dist-info/METADATA,sha256=jOIKH214iEOdk7HE46-tyhST5d9iGvgCaaff12tPxiY,4120
27
- exa_py-1.14.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
28
- exa_py-1.14.0.dist-info/RECORD,,
26
+ exa_py-1.14.1.dist-info/METADATA,sha256=Mf9xdxUdIxEXkxcXa_mTDKRt34M4QR0lR7IPF2H26k8,4120
27
+ exa_py-1.14.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
28
+ exa_py-1.14.1.dist-info/RECORD,,