isaacus 0.6.0__py3-none-any.whl → 0.7.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.
- isaacus/__init__.py +5 -0
- isaacus/_base_client.py +6 -0
- isaacus/_models.py +2 -0
- isaacus/_types.py +2 -0
- isaacus/_utils/_proxy.py +4 -1
- isaacus/_utils/_resources_proxy.py +24 -0
- isaacus/_version.py +1 -1
- isaacus/types/extractions/answer_extraction.py +2 -1
- {isaacus-0.6.0.dist-info → isaacus-0.7.0.dist-info}/METADATA +2 -2
- {isaacus-0.6.0.dist-info → isaacus-0.7.0.dist-info}/RECORD +12 -11
- {isaacus-0.6.0.dist-info → isaacus-0.7.0.dist-info}/WHEEL +0 -0
- {isaacus-0.6.0.dist-info → isaacus-0.7.0.dist-info}/licenses/LICENSE +0 -0
isaacus/__init__.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
+
import typing as _t
|
4
|
+
|
3
5
|
from . import types
|
4
6
|
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
|
5
7
|
from ._utils import file_from_path
|
@@ -68,6 +70,9 @@ __all__ = [
|
|
68
70
|
"DefaultAsyncHttpxClient",
|
69
71
|
]
|
70
72
|
|
73
|
+
if not _t.TYPE_CHECKING:
|
74
|
+
from ._utils._resources_proxy import resources as resources
|
75
|
+
|
71
76
|
_setup_logging()
|
72
77
|
|
73
78
|
# Update the __module__ attribute for exported symbols so that
|
isaacus/_base_client.py
CHANGED
@@ -935,6 +935,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
935
935
|
if self.custom_auth is not None:
|
936
936
|
kwargs["auth"] = self.custom_auth
|
937
937
|
|
938
|
+
if options.follow_redirects is not None:
|
939
|
+
kwargs["follow_redirects"] = options.follow_redirects
|
940
|
+
|
938
941
|
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
|
939
942
|
|
940
943
|
response = None
|
@@ -1435,6 +1438,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
1435
1438
|
if self.custom_auth is not None:
|
1436
1439
|
kwargs["auth"] = self.custom_auth
|
1437
1440
|
|
1441
|
+
if options.follow_redirects is not None:
|
1442
|
+
kwargs["follow_redirects"] = options.follow_redirects
|
1443
|
+
|
1438
1444
|
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
|
1439
1445
|
|
1440
1446
|
response = None
|
isaacus/_models.py
CHANGED
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
|
|
737
737
|
idempotency_key: str
|
738
738
|
json_data: Body
|
739
739
|
extra_json: AnyMapping
|
740
|
+
follow_redirects: bool
|
740
741
|
|
741
742
|
|
742
743
|
@final
|
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
|
|
750
751
|
files: Union[HttpxRequestFiles, None] = None
|
751
752
|
idempotency_key: Union[str, None] = None
|
752
753
|
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
|
754
|
+
follow_redirects: Union[bool, None] = None
|
753
755
|
|
754
756
|
# It should be noted that we cannot use `json` here as that would override
|
755
757
|
# a BaseModel method in an incompatible fashion.
|
isaacus/_types.py
CHANGED
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
|
|
100
100
|
params: Query
|
101
101
|
extra_json: AnyMapping
|
102
102
|
idempotency_key: str
|
103
|
+
follow_redirects: bool
|
103
104
|
|
104
105
|
|
105
106
|
# Sentinel class used until PEP 0661 is accepted
|
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
|
|
215
216
|
|
216
217
|
class HttpxSendArgs(TypedDict, total=False):
|
217
218
|
auth: httpx.Auth
|
219
|
+
follow_redirects: bool
|
isaacus/_utils/_proxy.py
CHANGED
@@ -46,7 +46,10 @@ class LazyProxy(Generic[T], ABC):
|
|
46
46
|
@property # type: ignore
|
47
47
|
@override
|
48
48
|
def __class__(self) -> type: # pyright: ignore
|
49
|
-
|
49
|
+
try:
|
50
|
+
proxied = self.__get_proxied__()
|
51
|
+
except Exception:
|
52
|
+
return type(self)
|
50
53
|
if issubclass(type(proxied), LazyProxy):
|
51
54
|
return type(proxied)
|
52
55
|
return proxied.__class__
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import Any
|
4
|
+
from typing_extensions import override
|
5
|
+
|
6
|
+
from ._proxy import LazyProxy
|
7
|
+
|
8
|
+
|
9
|
+
class ResourcesProxy(LazyProxy[Any]):
|
10
|
+
"""A proxy for the `isaacus.resources` module.
|
11
|
+
|
12
|
+
This is used so that we can lazily import `isaacus.resources` only when
|
13
|
+
needed *and* so that users can just import `isaacus` and reference `isaacus.resources`
|
14
|
+
"""
|
15
|
+
|
16
|
+
@override
|
17
|
+
def __load__(self) -> Any:
|
18
|
+
import importlib
|
19
|
+
|
20
|
+
mod = importlib.import_module("isaacus.resources")
|
21
|
+
return mod
|
22
|
+
|
23
|
+
|
24
|
+
resources = ResourcesProxy().__as_proxied__()
|
isaacus/_version.py
CHANGED
@@ -61,7 +61,8 @@ class AnswerExtraction(BaseModel):
|
|
61
61
|
extractions: List[Extraction]
|
62
62
|
"""
|
63
63
|
The results of extracting answers from the texts, ordered from highest to lowest
|
64
|
-
inextractability score
|
64
|
+
answer confidence score (or else lowest to highest inextractability score if
|
65
|
+
there are no answers for a text).
|
65
66
|
"""
|
66
67
|
|
67
68
|
usage: Usage
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: isaacus
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.7.0
|
4
4
|
Summary: The official Python library for the isaacus API
|
5
5
|
Project-URL: Homepage, https://github.com/isaacus-dev/isaacus-python
|
6
6
|
Project-URL: Repository, https://github.com/isaacus-dev/isaacus-python
|
@@ -131,7 +131,7 @@ universal_classification = client.classifications.universal.create(
|
|
131
131
|
"size": 512,
|
132
132
|
},
|
133
133
|
)
|
134
|
-
print(universal_classification.
|
134
|
+
print(universal_classification.classifications)
|
135
135
|
```
|
136
136
|
|
137
137
|
## Handling errors
|
@@ -1,22 +1,23 @@
|
|
1
|
-
isaacus/__init__.py,sha256=
|
2
|
-
isaacus/_base_client.py,sha256=
|
1
|
+
isaacus/__init__.py,sha256=wr6ddQI6xaQxDY-GoGzbBSqxrHcTB0JXRu35iJSo4f8,2537
|
2
|
+
isaacus/_base_client.py,sha256=4cPf94bP0zv3pFpiqMmUBwhHlHBCrBSOYY88AbKDksw,64303
|
3
3
|
isaacus/_client.py,sha256=-2sN8vyAm_qN2P6JuLxKel6BfvA6mragbo4TPOwLs3Y,16544
|
4
4
|
isaacus/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
5
5
|
isaacus/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
|
6
6
|
isaacus/_exceptions.py,sha256=L82uluhizzc94VydHIaJkNxkcG-2DAe74tNhrE2eN2A,3222
|
7
7
|
isaacus/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
|
8
|
-
isaacus/_models.py,sha256=
|
8
|
+
isaacus/_models.py,sha256=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
|
9
9
|
isaacus/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
|
10
10
|
isaacus/_resource.py,sha256=iP_oYhz5enCI58mK7hlwLoPMPh4Q5s8-KBv-jGfv2aM,1106
|
11
11
|
isaacus/_response.py,sha256=aXLF5ia58bjjQXTxY574lh7JfKXiGL2tDTX09klm8lw,28794
|
12
12
|
isaacus/_streaming.py,sha256=tMBfwrfEFWm0v7vWFgjn_lizsoD70lPkYigIBuADaCM,10104
|
13
|
-
isaacus/_types.py,sha256=
|
14
|
-
isaacus/_version.py,sha256=
|
13
|
+
isaacus/_types.py,sha256=OWOeOlYfnHj59_Lq34ua9FIuR_UTSHQzo4SxlaQBS9Y,6198
|
14
|
+
isaacus/_version.py,sha256=T4jgs92KgNCXwGSB02V-Ww6bGqKAhpv3rhgIGXeFzik,159
|
15
15
|
isaacus/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
isaacus/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
17
17
|
isaacus/_utils/_logs.py,sha256=rwa1Yzjbs2JaFn9KQ06rH5c_GSNa--BVwWnWhvvT1tY,777
|
18
|
-
isaacus/_utils/_proxy.py,sha256=
|
18
|
+
isaacus/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
|
19
19
|
isaacus/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
|
20
|
+
isaacus/_utils/_resources_proxy.py,sha256=vW2q6wobLs4JH9DnlVsdaotKEzn5bWqqe8WhNTAOv_k,594
|
20
21
|
isaacus/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
|
21
22
|
isaacus/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
|
22
23
|
isaacus/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
|
@@ -38,9 +39,9 @@ isaacus/types/classifications/__init__.py,sha256=GX6WFRzjx9qcuJhdRZjFLJRYMM4d5J8
|
|
38
39
|
isaacus/types/classifications/universal_classification.py,sha256=qeAaPg26wXDq1R_93SZIDzTp9AkfLRMucpd6Tie7NNU,2438
|
39
40
|
isaacus/types/classifications/universal_create_params.py,sha256=0RYreNEY9j5BqxJLMoDxIvibYZnCZcNTFN0zERz7kpg,2277
|
40
41
|
isaacus/types/extractions/__init__.py,sha256=9FahSE48xCUSAdkb1DaqRBBznuQ805lmRdlY22iLtQw,254
|
41
|
-
isaacus/types/extractions/answer_extraction.py,sha256=
|
42
|
+
isaacus/types/extractions/answer_extraction.py,sha256=KIqfIsdlYAAjDDwzM8XuFOW_1u5zv34RWbIa3WchBxc,2152
|
42
43
|
isaacus/types/extractions/qa_create_params.py,sha256=iaGIDnuJ8Kek5jW6QMQdbAQJYYiihcjZ1k_iSDbt1Mk,2065
|
43
|
-
isaacus-0.
|
44
|
-
isaacus-0.
|
45
|
-
isaacus-0.
|
46
|
-
isaacus-0.
|
44
|
+
isaacus-0.7.0.dist-info/METADATA,sha256=euCR5dIMRQIuLm1s_y99cbgf2j6ACw-NxmDAE9EzTbE,14346
|
45
|
+
isaacus-0.7.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
46
|
+
isaacus-0.7.0.dist-info/licenses/LICENSE,sha256=lUen4LYVFVGEVXBsntBAPsQsOWgMkno1e9WfgWkpZ-k,11337
|
47
|
+
isaacus-0.7.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|