mistralai 1.9.8__py3-none-any.whl → 1.9.9__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 CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "mistralai"
6
- __version__: str = "1.9.8"
6
+ __version__: str = "1.9.9"
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.8 2.634.2 1.0.0 mistralai"
9
+ __user_agent__: str = "speakeasy-sdk/python 1.9.9 2.634.2 1.0.0 mistralai"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mistralai
3
- Version: 1.9.8
3
+ Version: 1.9.9
4
4
  Summary: Python Client SDK for the Mistral AI API.
5
5
  Author: Mistral
6
6
  Requires-Python: >=3.9
@@ -54,7 +54,7 @@ mistralai_azure/models/usermessage.py,sha256=tzTfEH0wzDHf96C8AJanTxckrDJOpxtMOa3
54
54
  mistralai_azure/models/validationerror.py,sha256=vghbUqW9H5AsbYmW5i0C56eHPFC054x8SJA-mJZPKak,532
55
55
  mistralai_azure/ocr.py,sha256=hHX6-72A_nSRt8aPOaBf5DPP9NVKdqddRkkWObK8KeM,11911
56
56
  mistralai_azure/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
57
- mistralai_azure/sdk.py,sha256=CVTTW027gX8y4rhprAbmkB5W7r3afru01yRSPwxpMk4,5437
57
+ mistralai_azure/sdk.py,sha256=JByPLw6kJhZi2npJvki87fd3b2Z4E-dAA6eshZ19BOI,6667
58
58
  mistralai_azure/sdkconfiguration.py,sha256=tqLLVewof7YZcBIykjMjGZIEtX_b_JKaMP9KHNdrRsM,1728
59
59
  mistralai_azure/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
60
60
  mistralai_azure/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
@@ -150,7 +150,7 @@ mistralai/_hooks/deprecation_warning.py,sha256=eyEOf7-o9uqqNWJnufD2RXp3dYrGV4in9
150
150
  mistralai/_hooks/registration.py,sha256=ML0W-XbE4WYdJ4eGks_XxF2aLCJTaIWjQATFGzFwvyU,861
151
151
  mistralai/_hooks/sdkhooks.py,sha256=s-orhdvnV89TmI3QiPC2LWQtYeM9RrsG1CTll-fYZmQ,2559
152
152
  mistralai/_hooks/types.py,sha256=70IiFr5bfsJYafuDkXQWVfl6nY4dQkA5SZoEBCircqs,3047
153
- mistralai/_version.py,sha256=6FjB8zY1tFIrap8yREauj7OwtQdW0EpeYdqcdGIlUwA,460
153
+ mistralai/_version.py,sha256=tcED2lXg3-eXOf5rk4PMKqXkrEyP1CRbp0gcg_R7j9I,460
154
154
  mistralai/accesses.py,sha256=o5VCW-nyOfwzopHo0jSXrPKJ1fqJL88PZto1RwysXPA,27320
155
155
  mistralai/agents.py,sha256=3E-c1YZOp3mS1PqA6OYekZmOcAdLCqWfq1o-hqUMsIw,33960
156
156
  mistralai/async_client.py,sha256=KUdYxIIqoD6L7vB0EGwUR6lQ0NK5iCTHjnLVR9CVcJY,355
@@ -456,7 +456,7 @@ mistralai/utils/security.py,sha256=vWlpkikOnGN_HRRhJ7Pb8ywVAjiM3d3ey3oTWtM6jTU,6
456
456
  mistralai/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
457
457
  mistralai/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
458
458
  mistralai/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
459
- mistralai-1.9.8.dist-info/LICENSE,sha256=rUtQ_9GD0OyLPlb-2uWVdfE87hzudMRmsW-tS-0DK-0,11340
460
- mistralai-1.9.8.dist-info/METADATA,sha256=1Dbq0gOz5mYZMZq-iWpXAabW8wXQ04G8GrRQe1Il8Oc,37249
461
- mistralai-1.9.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
462
- mistralai-1.9.8.dist-info/RECORD,,
459
+ mistralai-1.9.9.dist-info/LICENSE,sha256=rUtQ_9GD0OyLPlb-2uWVdfE87hzudMRmsW-tS-0DK-0,11340
460
+ mistralai-1.9.9.dist-info/METADATA,sha256=T6zZVvWMj9h_ZYBUSt6R3yw0lyEmbuf-w6KCGGVYH7k,37249
461
+ mistralai-1.9.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
462
+ mistralai-1.9.9.dist-info/RECORD,,
mistralai_azure/sdk.py CHANGED
@@ -1,27 +1,33 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
- import weakref
4
- from typing import Any, Callable, Dict, Optional, Union, cast
5
-
6
- import httpx
7
-
8
- from mistralai_azure import models, utils
9
- from mistralai_azure._hooks import SDKHooks
10
- from mistralai_azure.chat import Chat
11
- from mistralai_azure.types import UNSET, OptionalNullable
12
-
13
3
  from .basesdk import BaseSDK
14
4
  from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients
15
5
  from .sdkconfiguration import SDKConfiguration
16
6
  from .utils.logger import Logger, get_default_logger
17
7
  from .utils.retries import RetryConfig
8
+ import httpx
9
+ import importlib
10
+ from mistralai_azure import models, utils
11
+ from mistralai_azure._hooks import SDKHooks
12
+ from mistralai_azure.types import OptionalNullable, UNSET
13
+ from typing import Any, Callable, Dict, Optional, TYPE_CHECKING, Union, cast
14
+ import weakref
15
+
16
+ if TYPE_CHECKING:
17
+ from mistralai_azure.chat import Chat
18
+ from mistralai_azure.ocr import Ocr
18
19
 
19
20
 
20
21
  class MistralAzure(BaseSDK):
21
22
  r"""Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it."""
22
23
 
23
- chat: Chat
24
+ chat: "Chat"
24
25
  r"""Chat Completion API."""
26
+ ocr: "Ocr"
27
+ _sub_sdk_map = {
28
+ "chat": ("mistralai_azure.chat", "Chat"),
29
+ "ocr": ("mistralai_azure.ocr", "Ocr"),
30
+ }
25
31
 
26
32
  def __init__(
27
33
  self,
@@ -101,6 +107,9 @@ class MistralAzure(BaseSDK):
101
107
 
102
108
  hooks = SDKHooks()
103
109
 
110
+ # pylint: disable=protected-access
111
+ self.sdk_configuration.__dict__["_hooks"] = hooks
112
+
104
113
  current_server_url, *_ = self.sdk_configuration.get_server_details()
105
114
  server_url, self.sdk_configuration.client = hooks.sdk_init(
106
115
  current_server_url, client
@@ -108,9 +117,6 @@ class MistralAzure(BaseSDK):
108
117
  if current_server_url != server_url:
109
118
  self.sdk_configuration.server_url = server_url
110
119
 
111
- # pylint: disable=protected-access
112
- self.sdk_configuration.__dict__["_hooks"] = hooks
113
-
114
120
  weakref.finalize(
115
121
  self,
116
122
  close_clients,
@@ -121,10 +127,32 @@ class MistralAzure(BaseSDK):
121
127
  self.sdk_configuration.async_client_supplied,
122
128
  )
123
129
 
124
- self._init_sdks()
130
+ def __getattr__(self, name: str):
131
+ if name in self._sub_sdk_map:
132
+ module_path, class_name = self._sub_sdk_map[name]
133
+ try:
134
+ module = importlib.import_module(module_path)
135
+ klass = getattr(module, class_name)
136
+ instance = klass(self.sdk_configuration)
137
+ setattr(self, name, instance)
138
+ return instance
139
+ except ImportError as e:
140
+ raise AttributeError(
141
+ f"Failed to import module {module_path} for attribute {name}: {e}"
142
+ ) from e
143
+ except AttributeError as e:
144
+ raise AttributeError(
145
+ f"Failed to find class {class_name} in module {module_path} for attribute {name}: {e}"
146
+ ) from e
147
+
148
+ raise AttributeError(
149
+ f"'{type(self).__name__}' object has no attribute '{name}'"
150
+ )
125
151
 
126
- def _init_sdks(self):
127
- self.chat = Chat(self.sdk_configuration)
152
+ def __dir__(self):
153
+ default_attrs = list(super().__dir__())
154
+ lazy_attrs = list(self._sub_sdk_map.keys())
155
+ return sorted(list(set(default_attrs + lazy_attrs)))
128
156
 
129
157
  def __enter__(self):
130
158
  return self