mistralai 1.0.2__py3-none-any.whl → 1.0.3__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.
@@ -29,9 +29,9 @@ class SDKConfiguration:
29
29
  server: Optional[str] = ""
30
30
  language: str = "python"
31
31
  openapi_doc_version: str = "0.0.2"
32
- sdk_version: str = "1.0.2"
33
- gen_version: str = "2.402.5"
34
- user_agent: str = "speakeasy-sdk/python 1.0.2 2.402.5 0.0.2 mistralai"
32
+ sdk_version: str = "1.0.3"
33
+ gen_version: str = "2.404.11"
34
+ user_agent: str = "speakeasy-sdk/python 1.0.3 2.404.11 0.0.2 mistralai"
35
35
  retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
36
36
  timeout_ms: Optional[int] = None
37
37
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mistralai
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Python Client SDK for the Mistral AI API.
5
5
  Author: Mistral
6
6
  Requires-Python: >=3.8,<4.0
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.10
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Provides-Extra: gcp
14
- Requires-Dist: google-auth (>=2.31.0,<3.0.0) ; extra == "gcp"
14
+ Requires-Dist: google-auth (==2.27.0) ; extra == "gcp"
15
15
  Requires-Dist: httpx (>=0.27.0,<0.28.0)
16
16
  Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
17
17
  Requires-Dist: pydantic (>=2.8.2,<2.9.0)
@@ -91,7 +91,7 @@ mistralai_gcp/models/usageinfo.py,sha256=kTFYFhieGnuNlqrOHUDW2fURMYHTqf9W641BM1J
91
91
  mistralai_gcp/models/usermessage.py,sha256=tPRjmmTW78AYQq9R_aCGUcGpUtADT5m0C2Yvsn0sLEw,700
92
92
  mistralai_gcp/models/validationerror.py,sha256=a4pmlDNdXFw9zMiP0JVAYUWQKcbGBcQgWB2IjK-ODG4,440
93
93
  mistralai_gcp/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
94
- mistralai_gcp/sdk.py,sha256=5ycbCdkzkBzgAdtDhCdr_GU5dDvnw4IheiL2hG934eY,6302
94
+ mistralai_gcp/sdk.py,sha256=RNrWOcxtaBoZZUvSwUmkjd5mVVtnM18j2v7QzLPePW8,6540
95
95
  mistralai_gcp/sdkconfiguration.py,sha256=LfztRmnUXLidnh2H3Gx2mIoHFbAbndHtP6FSLwYY-8A,1705
96
96
  mistralai_gcp/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
97
97
  mistralai_gcp/types/basemodel.py,sha256=PexI39iKiOkIlobB8Ueo0yn8PLHp6_wb-WO-zelNDZY,1170
@@ -211,7 +211,7 @@ mistralai/models/wandbintegrationout.py,sha256=d34eUKXcuFXk948yNYAuQVeEE_DZtSEEf
211
211
  mistralai/models_.py,sha256=umktQr0ejwXlXMbs1wuR45qrhPx74dx-KKGRU2FejD4,37297
212
212
  mistralai/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
213
213
  mistralai/sdk.py,sha256=NVD3gj_E4QlBHQlcBrIp1ZYvttIxQeivEYTGNY2TnUk,4663
214
- mistralai/sdkconfiguration.py,sha256=5VD83yPE-tUxtdUSfdMAhGYc9U7s4iW8JnIBRG_yGsQ,1693
214
+ mistralai/sdkconfiguration.py,sha256=riQAJDnjhq3tdTDzuZ17gjrztOCWNASnb3bluL2hZSo,1695
215
215
  mistralai/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
216
216
  mistralai/types/basemodel.py,sha256=PexI39iKiOkIlobB8Ueo0yn8PLHp6_wb-WO-zelNDZY,1170
217
217
  mistralai/utils/__init__.py,sha256=9qazjFztcyuQzo_O6QbwyDrPdPPxclel_0pVmiwN93U,2201
@@ -230,7 +230,7 @@ mistralai/utils/serializers.py,sha256=FRCVu7wAf3VCss55ve62zuvdwnjDIHLQUDHc8fkGO4
230
230
  mistralai/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
231
231
  mistralai/utils/values.py,sha256=_89YXPTI_BU6SXJBzFR4pIzTCBPQW9tsOTN1jeBBIDs,3428
232
232
  mistralai/version.py,sha256=iosXhlXclBwBqlADFKEilxAC2wWKbtuBKi87AmPi7s8,196
233
- mistralai-1.0.2.dist-info/LICENSE,sha256=rUtQ_9GD0OyLPlb-2uWVdfE87hzudMRmsW-tS-0DK-0,11340
234
- mistralai-1.0.2.dist-info/METADATA,sha256=YJrLgfLHuJmLpSS3GLKVsi6rJhuvnYK1RwOLSeAsR3I,19583
235
- mistralai-1.0.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
236
- mistralai-1.0.2.dist-info/RECORD,,
233
+ mistralai-1.0.3.dist-info/LICENSE,sha256=rUtQ_9GD0OyLPlb-2uWVdfE87hzudMRmsW-tS-0DK-0,11340
234
+ mistralai-1.0.3.dist-info/METADATA,sha256=wGlK3Tcr8LpOu9B6f_mfTcBYGRUO6PuX2R_XZw_umL0,19576
235
+ mistralai-1.0.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
236
+ mistralai-1.0.3.dist-info/RECORD,,
mistralai_gcp/sdk.py CHANGED
@@ -32,6 +32,7 @@ class MistralGoogleCloud(BaseSDK):
32
32
  self,
33
33
  region: str = "europe-west4",
34
34
  project_id: Optional[str] = None,
35
+ access_token: Optional[str] = None,
35
36
  client: Optional[HttpClient] = None,
36
37
  async_client: Optional[AsyncHttpClient] = None,
37
38
  retry_config: Optional[Nullable[RetryConfig]] = None,
@@ -46,26 +47,30 @@ class MistralGoogleCloud(BaseSDK):
46
47
  :param retry_config: The retry configuration to use for all supported methods
47
48
  """
48
49
 
49
- credentials, loaded_project_id = google.auth.default(
50
- scopes=["https://www.googleapis.com/auth/cloud-platform"],
51
- )
52
-
53
- if not isinstance(credentials, google.auth.credentials.Credentials):
54
- raise models.SDKError(
55
- "credentials must be an instance of google.auth.credentials.Credentials"
50
+ if not access_token:
51
+ credentials, loaded_project_id = google.auth.default(
52
+ scopes=["https://www.googleapis.com/auth/cloud-platform"],
56
53
  )
54
+ credentials.refresh(google.auth.transport.requests.Request())
55
+
56
+ if not isinstance(credentials, google.auth.credentials.Credentials):
57
+ raise models.SDKError(
58
+ "credentials must be an instance of google.auth.credentials.Credentials"
59
+ )
57
60
 
58
61
  project_id = project_id or loaded_project_id
59
62
  if project_id is None:
60
63
  raise models.SDKError("project_id must be provided")
61
64
 
62
65
  def auth_token() -> str:
63
- if credentials.expired:
66
+ if access_token:
67
+ return access_token
68
+ else:
64
69
  credentials.refresh(google.auth.transport.requests.Request())
65
- token = credentials.token
66
- if not token:
67
- raise models.SDKError("Failed to get token from credentials")
68
- return token
70
+ token = credentials.token
71
+ if not token:
72
+ raise models.SDKError("Failed to get token from credentials")
73
+ return token
69
74
 
70
75
  if client is None:
71
76
  client = httpx.Client()