mistralai 1.9.7__py3-none-any.whl → 1.9.10__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.
- mistralai/_version.py +2 -2
- mistralai/embeddings.py +6 -0
- mistralai/models/__init__.py +11 -0
- mistralai/models/apiendpoint.py +5 -0
- mistralai/models/embeddingrequest.py +5 -1
- mistralai/models/encodingformat.py +7 -0
- mistralai/models/systemmessage.py +7 -3
- mistralai/models/systemmessagecontentchunks.py +21 -0
- {mistralai-1.9.7.dist-info → mistralai-1.9.10.dist-info}/METADATA +1 -1
- {mistralai-1.9.7.dist-info → mistralai-1.9.10.dist-info}/RECORD +48 -35
- mistralai_azure/_hooks/types.py +7 -0
- mistralai_azure/_version.py +3 -3
- mistralai_azure/basesdk.py +12 -20
- mistralai_azure/chat.py +16 -0
- mistralai_azure/httpclient.py +6 -16
- mistralai_azure/models/__init__.py +298 -103
- mistralai_azure/models/assistantmessage.py +1 -1
- mistralai_azure/models/chatcompletionrequest.py +20 -3
- mistralai_azure/models/chatcompletionresponse.py +6 -6
- mistralai_azure/models/chatcompletionstreamrequest.py +20 -3
- mistralai_azure/models/completionresponsestreamchoice.py +1 -1
- mistralai_azure/models/deltamessage.py +1 -1
- mistralai_azure/models/documenturlchunk.py +62 -0
- mistralai_azure/models/filechunk.py +23 -0
- mistralai_azure/models/imageurl.py +1 -1
- mistralai_azure/models/jsonschema.py +1 -1
- mistralai_azure/models/mistralpromptmode.py +8 -0
- mistralai_azure/models/ocrimageobject.py +89 -0
- mistralai_azure/models/ocrpagedimensions.py +25 -0
- mistralai_azure/models/ocrpageobject.py +64 -0
- mistralai_azure/models/ocrrequest.py +120 -0
- mistralai_azure/models/ocrresponse.py +68 -0
- mistralai_azure/models/ocrusageinfo.py +57 -0
- mistralai_azure/models/responseformat.py +1 -1
- mistralai_azure/models/toolmessage.py +1 -1
- mistralai_azure/models/usageinfo.py +71 -8
- mistralai_azure/models/usermessage.py +1 -1
- mistralai_azure/ocr.py +271 -0
- mistralai_azure/sdk.py +45 -17
- mistralai_azure/sdkconfiguration.py +0 -7
- mistralai_azure/types/basemodel.py +3 -3
- mistralai_azure/utils/__init__.py +130 -45
- mistralai_azure/utils/datetimes.py +23 -0
- mistralai_azure/utils/enums.py +67 -27
- mistralai_azure/utils/forms.py +49 -28
- mistralai_azure/utils/serializers.py +32 -3
- {mistralai-1.9.7.dist-info → mistralai-1.9.10.dist-info}/LICENSE +0 -0
- {mistralai-1.9.7.dist-info → mistralai-1.9.10.dist-info}/WHEEL +0 -0
mistralai/_version.py
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "mistralai"
|
|
6
|
-
__version__: str = "1.9.
|
|
6
|
+
__version__: str = "1.9.10"
|
|
7
7
|
__openapi_doc_version__: str = "1.0.0"
|
|
8
8
|
__gen_version__: str = "2.634.2"
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 1.9.
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 1.9.10 2.634.2 1.0.0 mistralai"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
mistralai/embeddings.py
CHANGED
|
@@ -20,6 +20,7 @@ class Embeddings(BaseSDK):
|
|
|
20
20
|
],
|
|
21
21
|
output_dimension: OptionalNullable[int] = UNSET,
|
|
22
22
|
output_dtype: Optional[models.EmbeddingDtype] = None,
|
|
23
|
+
encoding_format: Optional[models.EncodingFormat] = None,
|
|
23
24
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
24
25
|
server_url: Optional[str] = None,
|
|
25
26
|
timeout_ms: Optional[int] = None,
|
|
@@ -33,6 +34,7 @@ class Embeddings(BaseSDK):
|
|
|
33
34
|
:param inputs: Text to embed.
|
|
34
35
|
:param output_dimension: The dimension of the output embeddings.
|
|
35
36
|
:param output_dtype:
|
|
37
|
+
:param encoding_format:
|
|
36
38
|
:param retries: Override the default retry configuration for this method
|
|
37
39
|
:param server_url: Override the default server URL for this method
|
|
38
40
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -53,6 +55,7 @@ class Embeddings(BaseSDK):
|
|
|
53
55
|
inputs=inputs,
|
|
54
56
|
output_dimension=output_dimension,
|
|
55
57
|
output_dtype=output_dtype,
|
|
58
|
+
encoding_format=encoding_format,
|
|
56
59
|
)
|
|
57
60
|
|
|
58
61
|
req = self._build_request(
|
|
@@ -134,6 +137,7 @@ class Embeddings(BaseSDK):
|
|
|
134
137
|
],
|
|
135
138
|
output_dimension: OptionalNullable[int] = UNSET,
|
|
136
139
|
output_dtype: Optional[models.EmbeddingDtype] = None,
|
|
140
|
+
encoding_format: Optional[models.EncodingFormat] = None,
|
|
137
141
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
138
142
|
server_url: Optional[str] = None,
|
|
139
143
|
timeout_ms: Optional[int] = None,
|
|
@@ -147,6 +151,7 @@ class Embeddings(BaseSDK):
|
|
|
147
151
|
:param inputs: Text to embed.
|
|
148
152
|
:param output_dimension: The dimension of the output embeddings.
|
|
149
153
|
:param output_dtype:
|
|
154
|
+
:param encoding_format:
|
|
150
155
|
:param retries: Override the default retry configuration for this method
|
|
151
156
|
:param server_url: Override the default server URL for this method
|
|
152
157
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -167,6 +172,7 @@ class Embeddings(BaseSDK):
|
|
|
167
172
|
inputs=inputs,
|
|
168
173
|
output_dimension=output_dimension,
|
|
169
174
|
output_dtype=output_dtype,
|
|
175
|
+
encoding_format=encoding_format,
|
|
170
176
|
)
|
|
171
177
|
|
|
172
178
|
req = self._build_request_async(
|
mistralai/models/__init__.py
CHANGED
|
@@ -389,6 +389,7 @@ if TYPE_CHECKING:
|
|
|
389
389
|
EmbeddingResponseData,
|
|
390
390
|
EmbeddingResponseDataTypedDict,
|
|
391
391
|
)
|
|
392
|
+
from .encodingformat import EncodingFormat
|
|
392
393
|
from .entitytype import EntityType
|
|
393
394
|
from .eventout import EventOut, EventOutTypedDict
|
|
394
395
|
from .file import File, FileTypedDict
|
|
@@ -767,6 +768,10 @@ if TYPE_CHECKING:
|
|
|
767
768
|
SystemMessageContentTypedDict,
|
|
768
769
|
SystemMessageTypedDict,
|
|
769
770
|
)
|
|
771
|
+
from .systemmessagecontentchunks import (
|
|
772
|
+
SystemMessageContentChunks,
|
|
773
|
+
SystemMessageContentChunksTypedDict,
|
|
774
|
+
)
|
|
770
775
|
from .textchunk import TextChunk, TextChunkType, TextChunkTypedDict
|
|
771
776
|
from .thinkchunk import (
|
|
772
777
|
ThinkChunk,
|
|
@@ -1156,6 +1161,7 @@ __all__ = [
|
|
|
1156
1161
|
"EmbeddingResponseData",
|
|
1157
1162
|
"EmbeddingResponseDataTypedDict",
|
|
1158
1163
|
"EmbeddingResponseTypedDict",
|
|
1164
|
+
"EncodingFormat",
|
|
1159
1165
|
"EntityType",
|
|
1160
1166
|
"Entries",
|
|
1161
1167
|
"EntriesTypedDict",
|
|
@@ -1472,6 +1478,8 @@ __all__ = [
|
|
|
1472
1478
|
"StopTypedDict",
|
|
1473
1479
|
"SystemMessage",
|
|
1474
1480
|
"SystemMessageContent",
|
|
1481
|
+
"SystemMessageContentChunks",
|
|
1482
|
+
"SystemMessageContentChunksTypedDict",
|
|
1475
1483
|
"SystemMessageContentTypedDict",
|
|
1476
1484
|
"SystemMessageTypedDict",
|
|
1477
1485
|
"TextChunk",
|
|
@@ -1858,6 +1866,7 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1858
1866
|
"EmbeddingResponseTypedDict": ".embeddingresponse",
|
|
1859
1867
|
"EmbeddingResponseData": ".embeddingresponsedata",
|
|
1860
1868
|
"EmbeddingResponseDataTypedDict": ".embeddingresponsedata",
|
|
1869
|
+
"EncodingFormat": ".encodingformat",
|
|
1861
1870
|
"EntityType": ".entitytype",
|
|
1862
1871
|
"EventOut": ".eventout",
|
|
1863
1872
|
"EventOutTypedDict": ".eventout",
|
|
@@ -2159,6 +2168,8 @@ _dynamic_imports: dict[str, str] = {
|
|
|
2159
2168
|
"SystemMessageContent": ".systemmessage",
|
|
2160
2169
|
"SystemMessageContentTypedDict": ".systemmessage",
|
|
2161
2170
|
"SystemMessageTypedDict": ".systemmessage",
|
|
2171
|
+
"SystemMessageContentChunks": ".systemmessagecontentchunks",
|
|
2172
|
+
"SystemMessageContentChunksTypedDict": ".systemmessagecontentchunks",
|
|
2162
2173
|
"TextChunk": ".textchunk",
|
|
2163
2174
|
"TextChunkType": ".textchunk",
|
|
2164
2175
|
"TextChunkTypedDict": ".textchunk",
|
mistralai/models/apiendpoint.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from .embeddingdtype import EmbeddingDtype
|
|
5
|
+
from .encodingformat import EncodingFormat
|
|
5
6
|
from mistralai.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
6
7
|
import pydantic
|
|
7
8
|
from pydantic import model_serializer
|
|
@@ -27,6 +28,7 @@ class EmbeddingRequestTypedDict(TypedDict):
|
|
|
27
28
|
output_dimension: NotRequired[Nullable[int]]
|
|
28
29
|
r"""The dimension of the output embeddings."""
|
|
29
30
|
output_dtype: NotRequired[EmbeddingDtype]
|
|
31
|
+
encoding_format: NotRequired[EncodingFormat]
|
|
30
32
|
|
|
31
33
|
|
|
32
34
|
class EmbeddingRequest(BaseModel):
|
|
@@ -41,9 +43,11 @@ class EmbeddingRequest(BaseModel):
|
|
|
41
43
|
|
|
42
44
|
output_dtype: Optional[EmbeddingDtype] = None
|
|
43
45
|
|
|
46
|
+
encoding_format: Optional[EncodingFormat] = None
|
|
47
|
+
|
|
44
48
|
@model_serializer(mode="wrap")
|
|
45
49
|
def serialize_model(self, handler):
|
|
46
|
-
optional_fields = ["output_dimension", "output_dtype"]
|
|
50
|
+
optional_fields = ["output_dimension", "output_dtype", "encoding_format"]
|
|
47
51
|
nullable_fields = ["output_dimension"]
|
|
48
52
|
null_default_fields = []
|
|
49
53
|
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .
|
|
4
|
+
from .systemmessagecontentchunks import (
|
|
5
|
+
SystemMessageContentChunks,
|
|
6
|
+
SystemMessageContentChunksTypedDict,
|
|
7
|
+
)
|
|
5
8
|
from mistralai.types import BaseModel
|
|
6
9
|
from typing import List, Literal, Optional, Union
|
|
7
10
|
from typing_extensions import NotRequired, TypeAliasType, TypedDict
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
SystemMessageContentTypedDict = TypeAliasType(
|
|
11
|
-
"SystemMessageContentTypedDict",
|
|
14
|
+
"SystemMessageContentTypedDict",
|
|
15
|
+
Union[str, List[SystemMessageContentChunksTypedDict]],
|
|
12
16
|
)
|
|
13
17
|
|
|
14
18
|
|
|
15
19
|
SystemMessageContent = TypeAliasType(
|
|
16
|
-
"SystemMessageContent", Union[str, List[
|
|
20
|
+
"SystemMessageContent", Union[str, List[SystemMessageContentChunks]]
|
|
17
21
|
)
|
|
18
22
|
|
|
19
23
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .textchunk import TextChunk, TextChunkTypedDict
|
|
5
|
+
from .thinkchunk import ThinkChunk, ThinkChunkTypedDict
|
|
6
|
+
from mistralai.utils import get_discriminator
|
|
7
|
+
from pydantic import Discriminator, Tag
|
|
8
|
+
from typing import Union
|
|
9
|
+
from typing_extensions import Annotated, TypeAliasType
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
SystemMessageContentChunksTypedDict = TypeAliasType(
|
|
13
|
+
"SystemMessageContentChunksTypedDict",
|
|
14
|
+
Union[TextChunkTypedDict, ThinkChunkTypedDict],
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
SystemMessageContentChunks = Annotated[
|
|
19
|
+
Union[Annotated[TextChunk, Tag("text")], Annotated[ThinkChunk, Tag("thinking")]],
|
|
20
|
+
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
|
21
|
+
]
|
|
@@ -3,32 +3,41 @@ mistralai_azure/_hooks/__init__.py,sha256=9_7W5jAYw8rcO8Kfc-Ty-lB82BHfksAJJpVFb_
|
|
|
3
3
|
mistralai_azure/_hooks/custom_user_agent.py,sha256=0m-1JzJxOT42rvRTEuCiFLqbOMriOlsraSrAGaXAbyo,656
|
|
4
4
|
mistralai_azure/_hooks/registration.py,sha256=5BN-U92pwP5kUaN7EOso2vWrwZlLvRcU5Coccibqp20,741
|
|
5
5
|
mistralai_azure/_hooks/sdkhooks.py,sha256=urOhVMYX_n5KgMoNDNmGs4fsgUWoeSG6_GarhPxH-YU,2565
|
|
6
|
-
mistralai_azure/_hooks/types.py,sha256=
|
|
7
|
-
mistralai_azure/_version.py,sha256=
|
|
8
|
-
mistralai_azure/basesdk.py,sha256=
|
|
9
|
-
mistralai_azure/chat.py,sha256=
|
|
10
|
-
mistralai_azure/httpclient.py,sha256=
|
|
11
|
-
mistralai_azure/models/__init__.py,sha256=
|
|
12
|
-
mistralai_azure/models/assistantmessage.py,sha256=
|
|
6
|
+
mistralai_azure/_hooks/types.py,sha256=F5N_UYekLG4DK9X22awmKxTefZCtmJ8JoH7MQ_1vvq8,3059
|
|
7
|
+
mistralai_azure/_version.py,sha256=v9Stuq-LTWVt4os7IEen_TdltjSyuWmz27kACZK3WmY,472
|
|
8
|
+
mistralai_azure/basesdk.py,sha256=GDFjY61iCGIMrrhM_m5DSeyMZV27X2MEwCb4QG7SK0s,11810
|
|
9
|
+
mistralai_azure/chat.py,sha256=GN3z1pP9Cq8W2l5GNS4lgvE1Jtmj_wDZI-5-ALTozro,37218
|
|
10
|
+
mistralai_azure/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
|
|
11
|
+
mistralai_azure/models/__init__.py,sha256=mEq5qJ0R8y0G28Hsnme4xFZ6ZsN9TAfJkVpV-9gecWU,14188
|
|
12
|
+
mistralai_azure/models/assistantmessage.py,sha256=aR4_dCNMC5gaViAGN1g-HvBdvkJoe3LMLG1xKbPQU9U,2661
|
|
13
13
|
mistralai_azure/models/chatcompletionchoice.py,sha256=-JE13p36mWnyc3zxnHLJp1Q43QVgj5QRurnZslXdJc0,935
|
|
14
|
-
mistralai_azure/models/chatcompletionrequest.py,sha256=
|
|
15
|
-
mistralai_azure/models/chatcompletionresponse.py,sha256=
|
|
16
|
-
mistralai_azure/models/chatcompletionstreamrequest.py,sha256=
|
|
14
|
+
mistralai_azure/models/chatcompletionrequest.py,sha256=w2VNBLoNOT55acEBt9STL6t3YnKxTIG8ZO1TjPSWHMM,10515
|
|
15
|
+
mistralai_azure/models/chatcompletionresponse.py,sha256=Yn7xcGIzmc2i4jSpq53YgmwOSKYk8oXKyIYWo8QjYfo,715
|
|
16
|
+
mistralai_azure/models/chatcompletionstreamrequest.py,sha256=ewycVKlbjL6Y-DY-99xw3-WtwAr7Z67Q5oCNz0cUs6s,9651
|
|
17
17
|
mistralai_azure/models/completionchunk.py,sha256=yoA0tYoyK5RChQPbEvYUi1BVmuyH-QT5IYwEYJNtsXM,877
|
|
18
18
|
mistralai_azure/models/completionevent.py,sha256=8wkRAMMpDFfhFSm7OEmli80lsK98Tir7R6IxW-KxeuE,405
|
|
19
|
-
mistralai_azure/models/completionresponsestreamchoice.py,sha256=
|
|
19
|
+
mistralai_azure/models/completionresponsestreamchoice.py,sha256=ysp8H1ztx8B_jlnqKgcwEb7St0BCEWKR1QhnPRhxBvU,1840
|
|
20
20
|
mistralai_azure/models/contentchunk.py,sha256=a7A9ymr1Qvg4am-uqrGxqrmTf9NBMPiGbVncuOevchE,881
|
|
21
|
-
mistralai_azure/models/deltamessage.py,sha256=
|
|
21
|
+
mistralai_azure/models/deltamessage.py,sha256=uDjAlgTy_W9wIX7qQUWbwsf7zSLn0GkBvYyIg7d_sto,1976
|
|
22
|
+
mistralai_azure/models/documenturlchunk.py,sha256=bxo2zp8MmL-be5AMGLD2XBCmgfzJMVc7-relOfKsz3o,1741
|
|
23
|
+
mistralai_azure/models/filechunk.py,sha256=wR69lE1QRNUwYDgKOM1ZXg5-8qQjomZ0tPzSUXgxqGI,653
|
|
22
24
|
mistralai_azure/models/function.py,sha256=VKcPB1oJ8_jvfXRfqufa2Y9to5WdxS-hi9OLu78GNpM,540
|
|
23
25
|
mistralai_azure/models/functioncall.py,sha256=H2eemkzk2Zm1LEm11atVh6PGvr6XJn9SWqNUziT_WK8,562
|
|
24
26
|
mistralai_azure/models/functionname.py,sha256=4rGsO-FYjvLMRGDBbdZ3cLyiiwml_voRQQ924K2_S1M,473
|
|
25
27
|
mistralai_azure/models/httpvalidationerror.py,sha256=tcUK2zfyCZ1TJjmvF93E9G2Ah-S2UUSpM-ZJBbR4hgc,616
|
|
26
|
-
mistralai_azure/models/imageurl.py,sha256=
|
|
28
|
+
mistralai_azure/models/imageurl.py,sha256=TUOpT-mTQJ9VoMoVcN303592gGBgrx6NZmmDhui-8h8,1402
|
|
27
29
|
mistralai_azure/models/imageurlchunk.py,sha256=JWfOtcxm-AEzRdNny-KWAWXV275hSnWFfn_Ux6OjrYA,1000
|
|
28
|
-
mistralai_azure/models/jsonschema.py,sha256=
|
|
30
|
+
mistralai_azure/models/jsonschema.py,sha256=Cu_coSyKmQB3tB_6PLKmcsdaOeyuAJDx5Z6Y1POuJ0Q,1689
|
|
31
|
+
mistralai_azure/models/mistralpromptmode.py,sha256=WDDqWnoJyI_krKYEOWNbWNYByFnLEYED_6hoYUZY_AE,259
|
|
32
|
+
mistralai_azure/models/ocrimageobject.py,sha256=FmmDchJs3dB7ctG_S-pFoUBhHvaLs20fJl3oya32VOo,2839
|
|
33
|
+
mistralai_azure/models/ocrpagedimensions.py,sha256=y3tkCQcdNUd_QWi3rzH6iROyVzsr4f-hQ8qh8bbbmgI,615
|
|
34
|
+
mistralai_azure/models/ocrpageobject.py,sha256=wF0iD_OpB-FFsLyQTuf7BExUMtAw0hMPGX4l1z3rXo8,2097
|
|
35
|
+
mistralai_azure/models/ocrrequest.py,sha256=N56QyuUst9uYasdioz6607RPEQuUs7xPNWtpZsJvHGo,4368
|
|
36
|
+
mistralai_azure/models/ocrresponse.py,sha256=BXz6SzdBWPELQoNd6dp6o8E3b3KlN1oUNMq4-JHquE4,2079
|
|
37
|
+
mistralai_azure/models/ocrusageinfo.py,sha256=mWKzoh9WQKeQOuQrSagn2LlXj3rvPHml_84UtEgalp0,1608
|
|
29
38
|
mistralai_azure/models/prediction.py,sha256=GERxBI8NoS9Fc14FD4ityVfJfXNts1dxjoK3XIVHHc0,730
|
|
30
39
|
mistralai_azure/models/referencechunk.py,sha256=uiouhIPrWpVEhpY_Cea1Som9XapC4mM3R82hhND-j-s,525
|
|
31
|
-
mistralai_azure/models/responseformat.py,sha256=
|
|
40
|
+
mistralai_azure/models/responseformat.py,sha256=A82NwuTKo-xI7b6VPkOwgQnIkGpzRQAo4zbSjdyXhzw,2262
|
|
32
41
|
mistralai_azure/models/responseformats.py,sha256=O9lwS2M9m53DsRxTC4uRP12SvRhgaQoMjIYsDys5A7s,503
|
|
33
42
|
mistralai_azure/models/sdkerror.py,sha256=kd75e3JYF2TXNgRZopcV-oGdBWoBZqRcvrwqn2fsFYs,528
|
|
34
43
|
mistralai_azure/models/security.py,sha256=lPLcQ1OV2SA6ZJP5_lOFWUDVuPc-L90C3N127KMWdPo,627
|
|
@@ -38,21 +47,23 @@ mistralai_azure/models/tool.py,sha256=Li0qpB3KgGN0mtT8lKG1N_MfOOwGvzok0ZRK_J3Us8
|
|
|
38
47
|
mistralai_azure/models/toolcall.py,sha256=MYHTegL2wzO23cG9AyPS9YhomXWh8ekULwzIeGt31Pw,836
|
|
39
48
|
mistralai_azure/models/toolchoice.py,sha256=etDg86Frx-VoiccMlGP_Va3Vipy4UGMa9LMUGQFY6UY,1033
|
|
40
49
|
mistralai_azure/models/toolchoiceenum.py,sha256=Ca4ileCwuOjfPzIXLRIxT3RkE5zR7oqV6nXU-UjW0w0,197
|
|
41
|
-
mistralai_azure/models/toolmessage.py,sha256=
|
|
50
|
+
mistralai_azure/models/toolmessage.py,sha256=I-zRrc1Qs_l0lfNTeGSP90SohNUuzv1q3TbigaB7y8w,2075
|
|
42
51
|
mistralai_azure/models/tooltypes.py,sha256=AGC_JaMGWyMRJ1rCIGhLh5DWbyohdiQkEeKoW5a97Ro,250
|
|
43
|
-
mistralai_azure/models/usageinfo.py,sha256=
|
|
44
|
-
mistralai_azure/models/usermessage.py,sha256=
|
|
52
|
+
mistralai_azure/models/usageinfo.py,sha256=u9Ds73z87KyluvVCLjlTXnzCVjbBGlLWTBBPpGK6AcM,2349
|
|
53
|
+
mistralai_azure/models/usermessage.py,sha256=tzTfEH0wzDHf96C8AJanTxckrDJOpxtMOa3tiLHDxs4,1805
|
|
45
54
|
mistralai_azure/models/validationerror.py,sha256=vghbUqW9H5AsbYmW5i0C56eHPFC054x8SJA-mJZPKak,532
|
|
55
|
+
mistralai_azure/ocr.py,sha256=hHX6-72A_nSRt8aPOaBf5DPP9NVKdqddRkkWObK8KeM,11911
|
|
46
56
|
mistralai_azure/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
|
47
|
-
mistralai_azure/sdk.py,sha256=
|
|
48
|
-
mistralai_azure/sdkconfiguration.py,sha256=
|
|
57
|
+
mistralai_azure/sdk.py,sha256=JByPLw6kJhZi2npJvki87fd3b2Z4E-dAA6eshZ19BOI,6667
|
|
58
|
+
mistralai_azure/sdkconfiguration.py,sha256=tqLLVewof7YZcBIykjMjGZIEtX_b_JKaMP9KHNdrRsM,1728
|
|
49
59
|
mistralai_azure/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
|
50
|
-
mistralai_azure/types/basemodel.py,sha256=
|
|
51
|
-
mistralai_azure/utils/__init__.py,sha256=
|
|
60
|
+
mistralai_azure/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
|
|
61
|
+
mistralai_azure/utils/__init__.py,sha256=811KKdkxMaWDfz2lMohUWqrR4JnIWxqeNQ1lRGQU4DM,5341
|
|
52
62
|
mistralai_azure/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_5Y,1699
|
|
53
|
-
mistralai_azure/utils/
|
|
63
|
+
mistralai_azure/utils/datetimes.py,sha256=oppAA5e3V35pQov1-FNLKxAaNF1_XWi-bQtyjjql3H8,855
|
|
64
|
+
mistralai_azure/utils/enums.py,sha256=REU6ydF8gsVL3xaeGX4sMNyiL3q5P9h29-f6Sa6luAE,2633
|
|
54
65
|
mistralai_azure/utils/eventstreaming.py,sha256=LtcrfJYw4nP2Oe4Wl0-cEURLzRGYReRGWNFY5wYECIE,6186
|
|
55
|
-
mistralai_azure/utils/forms.py,sha256=
|
|
66
|
+
mistralai_azure/utils/forms.py,sha256=EJdnrfIkuwpDtekyHutla0HjI_FypTYcmYNyPKEu_W0,6874
|
|
56
67
|
mistralai_azure/utils/headers.py,sha256=cPxWSmUILrefTGDzTH1Hdj7_Hlsj-EY6K5Tyc4iH4dk,3663
|
|
57
68
|
mistralai_azure/utils/logger.py,sha256=9nUtlKHo3RFsIVyMw5jq3wEKZMVwHnZMSc6xLp-otC0,520
|
|
58
69
|
mistralai_azure/utils/metadata.py,sha256=Per2KFXXOqOtoUWXrlIfjrSrBg199KrRW0nKQDgHIBU,3136
|
|
@@ -60,7 +71,7 @@ mistralai_azure/utils/queryparams.py,sha256=MTK6inMS1_WwjmMJEJmAn67tSHHJyarpdGRl
|
|
|
60
71
|
mistralai_azure/utils/requestbodies.py,sha256=ySjEyjcLi731LNUahWvLOrES2HihuA8VrOJx4eQ7Qzg,2101
|
|
61
72
|
mistralai_azure/utils/retries.py,sha256=6yhfZifqIat9i76xF0lTR2jLj1IN9BNGyqqxATlEFPU,6348
|
|
62
73
|
mistralai_azure/utils/security.py,sha256=ktep3HKwbFs-MLxUYTM8Jd4v-ZBum5_Z0u1PFIdYBX0,5516
|
|
63
|
-
mistralai_azure/utils/serializers.py,sha256=
|
|
74
|
+
mistralai_azure/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
|
|
64
75
|
mistralai_azure/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
65
76
|
mistralai_azure/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
|
66
77
|
mistralai_gcp/__init__.py,sha256=Tz5Y5FzbIUT1AmaYiTwJI56XTmuldo9AalaAm4h_FdE,423
|
|
@@ -139,7 +150,7 @@ mistralai/_hooks/deprecation_warning.py,sha256=eyEOf7-o9uqqNWJnufD2RXp3dYrGV4in9
|
|
|
139
150
|
mistralai/_hooks/registration.py,sha256=ML0W-XbE4WYdJ4eGks_XxF2aLCJTaIWjQATFGzFwvyU,861
|
|
140
151
|
mistralai/_hooks/sdkhooks.py,sha256=s-orhdvnV89TmI3QiPC2LWQtYeM9RrsG1CTll-fYZmQ,2559
|
|
141
152
|
mistralai/_hooks/types.py,sha256=70IiFr5bfsJYafuDkXQWVfl6nY4dQkA5SZoEBCircqs,3047
|
|
142
|
-
mistralai/_version.py,sha256=
|
|
153
|
+
mistralai/_version.py,sha256=LEQalhqj3K9_phhNqDx2o8HDpgflVQxEcns-7vQGtB8,462
|
|
143
154
|
mistralai/accesses.py,sha256=o5VCW-nyOfwzopHo0jSXrPKJ1fqJL88PZto1RwysXPA,27320
|
|
144
155
|
mistralai/agents.py,sha256=3E-c1YZOp3mS1PqA6OYekZmOcAdLCqWfq1o-hqUMsIw,33960
|
|
145
156
|
mistralai/async_client.py,sha256=KUdYxIIqoD6L7vB0EGwUR6lQ0NK5iCTHjnLVR9CVcJY,355
|
|
@@ -152,7 +163,7 @@ mistralai/classifiers.py,sha256=EsAvZi0dxM4qDw8xl84h6kZBWm4zdiP-f0eslqvDxAo,3415
|
|
|
152
163
|
mistralai/client.py,sha256=hrPg-LciKMKiascF0WbRRmqQyCv1lb2yDh6j-aaKVNo,509
|
|
153
164
|
mistralai/conversations.py,sha256=TXssMV9qjYRSTk90IVXPrzh-N1-pwb9sjKz3-48lRsw,110878
|
|
154
165
|
mistralai/documents.py,sha256=yh7BNimMrNa6XmiF3-ym5VqAuPneKtMXS2fKN5PP8BY,85763
|
|
155
|
-
mistralai/embeddings.py,sha256=
|
|
166
|
+
mistralai/embeddings.py,sha256=M4XS5GclIGRYHMNH0sSIro5KmB2g7d0DMATi8im2gHc,9636
|
|
156
167
|
mistralai/extra/README.md,sha256=BTS9fy0ijkiUP7ZVoFQ7FVBxHtXIXqucYZyy_ucFjo4,1739
|
|
157
168
|
mistralai/extra/__init__.py,sha256=8DsU_omYYadqcwlmBOoakBwkWKcSohwLmtB8v-jkn2M,392
|
|
158
169
|
mistralai/extra/exceptions.py,sha256=4EEygCfdsniYiroHEFVSVDqerQZkpRG027mlJXvMqns,428
|
|
@@ -181,7 +192,7 @@ mistralai/jobs.py,sha256=BUeEMx-SR3QrB8tyjjDndtcCTF-cs3640I38AWYW18w,47237
|
|
|
181
192
|
mistralai/libraries.py,sha256=C7TqHmnFR3j4yGaEulGRu2Xdp9tW9Pj-FSZZG9fBn9g,41070
|
|
182
193
|
mistralai/mistral_agents.py,sha256=6osNLzBNN9IFRhpeNzt6VGpqHlCo_6HnmMBvxzqd3F4,46043
|
|
183
194
|
mistralai/mistral_jobs.py,sha256=LlN0-ro8mMqgRRDtUHxwfA76IjDmScQ9rT1gb6Qu91I,31962
|
|
184
|
-
mistralai/models/__init__.py,sha256=
|
|
195
|
+
mistralai/models/__init__.py,sha256=E3Yv-bm4lLG4AEZDA8u8AypEaOJtSI-XqbGj7VPIVZg,97418
|
|
185
196
|
mistralai/models/agent.py,sha256=kM3lPW08V5B3CfBuIFZrEYAyClECj0Ial7-cQztfGmA,4191
|
|
186
197
|
mistralai/models/agentconversation.py,sha256=-vqTZ116MNx4JRs9N6cabsGXn4tILg_JP3JcL-iJpK0,2092
|
|
187
198
|
mistralai/models/agentcreationrequest.py,sha256=VdCCQEnBVfZU2m1EtRy5vEm_zsPIGPGLF21TXKjOm7E,3958
|
|
@@ -203,7 +214,7 @@ mistralai/models/agents_api_v1_conversations_restartop.py,sha256=pjsbjzKTeWgSBiv
|
|
|
203
214
|
mistralai/models/agentscompletionrequest.py,sha256=9eQ3v_F4pIOFP0d2mph27_3PS45a0UvQzDSFO88EhAk,8589
|
|
204
215
|
mistralai/models/agentscompletionstreamrequest.py,sha256=hTypANJ-SHYTpWt7wWzQWCHuvcnahZoGdDJ1COQsdys,8034
|
|
205
216
|
mistralai/models/agentupdaterequest.py,sha256=uoqwrx1KypzBrRNYECuoD_Z6r0ahsxqDiPvhuqnaH4E,4100
|
|
206
|
-
mistralai/models/apiendpoint.py,sha256=
|
|
217
|
+
mistralai/models/apiendpoint.py,sha256=e-d_e8Z7indj9QtiDZtYU3m7OQTvzRw-cCk3Ag_gbEo,551
|
|
207
218
|
mistralai/models/archiveftmodelout.py,sha256=VdppiqIB9JGNB2B0-Y6XQfQgDmB-hOa1Bta3v_StbLs,565
|
|
208
219
|
mistralai/models/assistantmessage.py,sha256=3qbCraZpjX_clXjT1wgOBeQuQBjX22XLQMIlR3v5fZw,2630
|
|
209
220
|
mistralai/models/audiochunk.py,sha256=npAWiX43d_fZ-8Bnnm_z-p7bcwpAhKyYidy_VIJcrxs,481
|
|
@@ -267,9 +278,10 @@ mistralai/models/documenttextcontent.py,sha256=uQKQu3H31Oo8HgAt7qDYMX4CByAPY71lh
|
|
|
267
278
|
mistralai/models/documentupdatein.py,sha256=ql6Exax-hZMIVdS9tbtzWX0YIJ_mSqwSUV56al2laOE,1352
|
|
268
279
|
mistralai/models/documenturlchunk.py,sha256=yiqte4P63DCyDKDIYKD0pP9S4HjFNXHCXob4nnzY6nY,1710
|
|
269
280
|
mistralai/models/embeddingdtype.py,sha256=c7L-PKhBgPVPZeMGuMub0ZOs0MdxMbpW2ebE0t7oEpU,209
|
|
270
|
-
mistralai/models/embeddingrequest.py,sha256=
|
|
281
|
+
mistralai/models/embeddingrequest.py,sha256=akcstmiH5e21xKqAzXSid4HzFeUMVA28vRhJpHKROSg,2429
|
|
271
282
|
mistralai/models/embeddingresponse.py,sha256=te6E_LYEzRjHJ9QREmsFp5PeNP2J_8ALVjyb1T20pNA,663
|
|
272
283
|
mistralai/models/embeddingresponsedata.py,sha256=fJ3mrZqyBBBE40a6iegOJX3DVDfgyMRq23ByeGSTLFk,534
|
|
284
|
+
mistralai/models/encodingformat.py,sha256=pH02s992pVskofo56idSek4sAn3MD6Iu7IAyCGmeJ-U,181
|
|
273
285
|
mistralai/models/entitytype.py,sha256=tyqYYy74ygqwapkV-KFllGcgW7SYrU1ROjQ1CJbOZsM,313
|
|
274
286
|
mistralai/models/eventout.py,sha256=UMqHEJMMJH68gbPA7uKF8bnPZmVzKSa-fXibFyXqTOg,1639
|
|
275
287
|
mistralai/models/file.py,sha256=QJ3IkP4t_ZssCivHzIPp-4co_rIY16Usg2dLrVb5kz0,956
|
|
@@ -386,7 +398,8 @@ mistralai/models/sharingin.py,sha256=0TWKw7Fb3dPjBH-kBvZWV62TFlOoFGxkO3d7B9Z01zo
|
|
|
386
398
|
mistralai/models/sharingout.py,sha256=9bxela_QJXxLD37ba8siYMidyqEpp-2a9sVFvabr3PU,1557
|
|
387
399
|
mistralai/models/source.py,sha256=_MSV-LRL2fL7wCUTXEvvsOUIWlOKqPvdZS4rm2Xhs0o,264
|
|
388
400
|
mistralai/models/ssetypes.py,sha256=xJlN3JFQ-EaF90nkD88zwjSSsgRN1C59JPZ97K1kASc,531
|
|
389
|
-
mistralai/models/systemmessage.py,sha256
|
|
401
|
+
mistralai/models/systemmessage.py,sha256=-yWm6HzcVh34YOTop1z3l92IvgNwcWMMENFD8bCgMLk,889
|
|
402
|
+
mistralai/models/systemmessagecontentchunks.py,sha256=zO5Hfr7u5E-DDsH1lPVmUg88pI3ZOjpXBDAwnea-RHk,732
|
|
390
403
|
mistralai/models/textchunk.py,sha256=2VD-TR3NOOWJ9Jzcw_E3ryq0GWz6b5XSP3k5o7oVlnc,448
|
|
391
404
|
mistralai/models/thinkchunk.py,sha256=HpD23LlAzITRtTQI2naWYp4nDDSnzV7U97QoXSby2Fg,1084
|
|
392
405
|
mistralai/models/timestampgranularity.py,sha256=UxTv5VJwJ2bkp1cD9kWPptVC8zqUSOa3hb7NatzydH0,179
|
|
@@ -445,7 +458,7 @@ mistralai/utils/security.py,sha256=vWlpkikOnGN_HRRhJ7Pb8ywVAjiM3d3ey3oTWtM6jTU,6
|
|
|
445
458
|
mistralai/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
|
|
446
459
|
mistralai/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
447
460
|
mistralai/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
|
448
|
-
mistralai-1.9.
|
|
449
|
-
mistralai-1.9.
|
|
450
|
-
mistralai-1.9.
|
|
451
|
-
mistralai-1.9.
|
|
461
|
+
mistralai-1.9.10.dist-info/LICENSE,sha256=rUtQ_9GD0OyLPlb-2uWVdfE87hzudMRmsW-tS-0DK-0,11340
|
|
462
|
+
mistralai-1.9.10.dist-info/METADATA,sha256=DJmhK8c34yXgOFqLTic-fhf1m9PxL3jP2hvfOjNcUDk,37250
|
|
463
|
+
mistralai-1.9.10.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
464
|
+
mistralai-1.9.10.dist-info/RECORD,,
|
mistralai_azure/_hooks/types.py
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
4
|
import httpx
|
|
5
5
|
from mistralai_azure.httpclient import HttpClient
|
|
6
|
+
from mistralai_azure.sdkconfiguration import SDKConfiguration
|
|
6
7
|
from typing import Any, Callable, List, Optional, Tuple, Union
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class HookContext:
|
|
11
|
+
config: SDKConfiguration
|
|
10
12
|
base_url: str
|
|
11
13
|
operation_id: str
|
|
12
14
|
oauth2_scopes: Optional[List[str]] = None
|
|
@@ -14,11 +16,13 @@ class HookContext:
|
|
|
14
16
|
|
|
15
17
|
def __init__(
|
|
16
18
|
self,
|
|
19
|
+
config: SDKConfiguration,
|
|
17
20
|
base_url: str,
|
|
18
21
|
operation_id: str,
|
|
19
22
|
oauth2_scopes: Optional[List[str]],
|
|
20
23
|
security_source: Optional[Union[Any, Callable[[], Any]]],
|
|
21
24
|
):
|
|
25
|
+
self.config = config
|
|
22
26
|
self.base_url = base_url
|
|
23
27
|
self.operation_id = operation_id
|
|
24
28
|
self.oauth2_scopes = oauth2_scopes
|
|
@@ -28,6 +32,7 @@ class HookContext:
|
|
|
28
32
|
class BeforeRequestContext(HookContext):
|
|
29
33
|
def __init__(self, hook_ctx: HookContext):
|
|
30
34
|
super().__init__(
|
|
35
|
+
hook_ctx.config,
|
|
31
36
|
hook_ctx.base_url,
|
|
32
37
|
hook_ctx.operation_id,
|
|
33
38
|
hook_ctx.oauth2_scopes,
|
|
@@ -38,6 +43,7 @@ class BeforeRequestContext(HookContext):
|
|
|
38
43
|
class AfterSuccessContext(HookContext):
|
|
39
44
|
def __init__(self, hook_ctx: HookContext):
|
|
40
45
|
super().__init__(
|
|
46
|
+
hook_ctx.config,
|
|
41
47
|
hook_ctx.base_url,
|
|
42
48
|
hook_ctx.operation_id,
|
|
43
49
|
hook_ctx.oauth2_scopes,
|
|
@@ -48,6 +54,7 @@ class AfterSuccessContext(HookContext):
|
|
|
48
54
|
class AfterErrorContext(HookContext):
|
|
49
55
|
def __init__(self, hook_ctx: HookContext):
|
|
50
56
|
super().__init__(
|
|
57
|
+
hook_ctx.config,
|
|
51
58
|
hook_ctx.base_url,
|
|
52
59
|
hook_ctx.operation_id,
|
|
53
60
|
hook_ctx.oauth2_scopes,
|
mistralai_azure/_version.py
CHANGED
|
@@ -4,9 +4,9 @@ import importlib.metadata
|
|
|
4
4
|
|
|
5
5
|
__title__: str = "mistralai_azure"
|
|
6
6
|
__version__: str = "1.6.0"
|
|
7
|
-
__openapi_doc_version__: str = "0.0
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 1.6.0 2.
|
|
7
|
+
__openapi_doc_version__: str = "1.0.0"
|
|
8
|
+
__gen_version__: str = "2.634.2"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 1.6.0 2.634.2 1.0.0 mistralai_azure"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
mistralai_azure/basesdk.py
CHANGED
|
@@ -218,12 +218,12 @@ class BaseSDK:
|
|
|
218
218
|
client = self.sdk_configuration.client
|
|
219
219
|
logger = self.sdk_configuration.debug_logger
|
|
220
220
|
|
|
221
|
+
hooks = self.sdk_configuration.__dict__["_hooks"]
|
|
222
|
+
|
|
221
223
|
def do():
|
|
222
224
|
http_res = None
|
|
223
225
|
try:
|
|
224
|
-
req =
|
|
225
|
-
BeforeRequestContext(hook_ctx), request
|
|
226
|
-
)
|
|
226
|
+
req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
|
|
227
227
|
logger.debug(
|
|
228
228
|
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
229
229
|
req.method,
|
|
@@ -237,9 +237,7 @@ class BaseSDK:
|
|
|
237
237
|
|
|
238
238
|
http_res = client.send(req, stream=stream)
|
|
239
239
|
except Exception as e:
|
|
240
|
-
_, e =
|
|
241
|
-
AfterErrorContext(hook_ctx), None, e
|
|
242
|
-
)
|
|
240
|
+
_, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
|
|
243
241
|
if e is not None:
|
|
244
242
|
logger.debug("Request Exception", exc_info=True)
|
|
245
243
|
raise e
|
|
@@ -257,7 +255,7 @@ class BaseSDK:
|
|
|
257
255
|
)
|
|
258
256
|
|
|
259
257
|
if utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
260
|
-
result, err =
|
|
258
|
+
result, err = hooks.after_error(
|
|
261
259
|
AfterErrorContext(hook_ctx), http_res, None
|
|
262
260
|
)
|
|
263
261
|
if err is not None:
|
|
@@ -277,9 +275,7 @@ class BaseSDK:
|
|
|
277
275
|
http_res = do()
|
|
278
276
|
|
|
279
277
|
if not utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
280
|
-
http_res =
|
|
281
|
-
AfterSuccessContext(hook_ctx), http_res
|
|
282
|
-
)
|
|
278
|
+
http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
|
|
283
279
|
|
|
284
280
|
return http_res
|
|
285
281
|
|
|
@@ -294,12 +290,12 @@ class BaseSDK:
|
|
|
294
290
|
client = self.sdk_configuration.async_client
|
|
295
291
|
logger = self.sdk_configuration.debug_logger
|
|
296
292
|
|
|
293
|
+
hooks = self.sdk_configuration.__dict__["_hooks"]
|
|
294
|
+
|
|
297
295
|
async def do():
|
|
298
296
|
http_res = None
|
|
299
297
|
try:
|
|
300
|
-
req =
|
|
301
|
-
BeforeRequestContext(hook_ctx), request
|
|
302
|
-
)
|
|
298
|
+
req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
|
|
303
299
|
logger.debug(
|
|
304
300
|
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
305
301
|
req.method,
|
|
@@ -313,9 +309,7 @@ class BaseSDK:
|
|
|
313
309
|
|
|
314
310
|
http_res = await client.send(req, stream=stream)
|
|
315
311
|
except Exception as e:
|
|
316
|
-
_, e =
|
|
317
|
-
AfterErrorContext(hook_ctx), None, e
|
|
318
|
-
)
|
|
312
|
+
_, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
|
|
319
313
|
if e is not None:
|
|
320
314
|
logger.debug("Request Exception", exc_info=True)
|
|
321
315
|
raise e
|
|
@@ -333,7 +327,7 @@ class BaseSDK:
|
|
|
333
327
|
)
|
|
334
328
|
|
|
335
329
|
if utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
336
|
-
result, err =
|
|
330
|
+
result, err = hooks.after_error(
|
|
337
331
|
AfterErrorContext(hook_ctx), http_res, None
|
|
338
332
|
)
|
|
339
333
|
if err is not None:
|
|
@@ -355,8 +349,6 @@ class BaseSDK:
|
|
|
355
349
|
http_res = await do()
|
|
356
350
|
|
|
357
351
|
if not utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
358
|
-
http_res =
|
|
359
|
-
AfterSuccessContext(hook_ctx), http_res
|
|
360
|
-
)
|
|
352
|
+
http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
|
|
361
353
|
|
|
362
354
|
return http_res
|