mistralai 1.0.1__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.
- mistralai/agents.py +31 -31
- mistralai/chat.py +4 -4
- mistralai/jobs.py +8 -8
- mistralai/models/__init__.py +20 -20
- mistralai/models/agentscompletionstreamrequest.py +33 -31
- mistralai/models/archiveftmodelout.py +4 -2
- mistralai/models/chatcompletionchoice.py +3 -4
- mistralai/models/chatcompletionrequest.py +2 -2
- mistralai/models/chatcompletionstreamrequest.py +2 -2
- mistralai/models/deltamessage.py +3 -3
- mistralai/models/detailedjobout.py +19 -5
- mistralai/models/files_api_routes_upload_fileop.py +7 -4
- mistralai/models/fileschema.py +8 -3
- mistralai/models/ftmodelout.py +4 -2
- mistralai/models/githubrepositoryin.py +4 -2
- mistralai/models/githubrepositoryout.py +4 -2
- mistralai/models/jobin.py +16 -4
- mistralai/models/jobout.py +20 -5
- mistralai/models/jobsout.py +4 -2
- mistralai/models/legacyjobmetadataout.py +4 -2
- mistralai/models/retrievefileout.py +8 -3
- mistralai/models/tool.py +9 -5
- mistralai/models/toolcall.py +8 -4
- mistralai/models/trainingparameters.py +6 -2
- mistralai/models/trainingparametersin.py +10 -2
- mistralai/models/unarchiveftmodelout.py +4 -2
- mistralai/models/uploadfileout.py +8 -3
- mistralai/models/wandbintegration.py +4 -2
- mistralai/models/wandbintegrationout.py +4 -2
- mistralai/sdk.py +2 -2
- mistralai/sdkconfiguration.py +3 -3
- mistralai/utils/__init__.py +2 -2
- mistralai/utils/forms.py +10 -9
- mistralai/utils/headers.py +8 -8
- mistralai/utils/logger.py +8 -0
- mistralai/utils/queryparams.py +16 -14
- mistralai/utils/serializers.py +17 -8
- mistralai/utils/url.py +13 -8
- mistralai/utils/values.py +6 -0
- mistralai/version.py +7 -0
- {mistralai-1.0.1.dist-info → mistralai-1.0.3.dist-info}/METADATA +6 -3
- {mistralai-1.0.1.dist-info → mistralai-1.0.3.dist-info}/RECORD +60 -59
- mistralai_azure/models/__init__.py +3 -3
- mistralai_azure/models/chatcompletionchoice.py +3 -4
- mistralai_azure/models/deltamessage.py +3 -3
- mistralai_azure/models/tool.py +9 -5
- mistralai_azure/models/toolcall.py +8 -4
- mistralai_azure/sdkconfiguration.py +3 -3
- mistralai_gcp/chat.py +4 -4
- mistralai_gcp/models/__init__.py +3 -3
- mistralai_gcp/models/chatcompletionchoice.py +3 -4
- mistralai_gcp/models/chatcompletionrequest.py +2 -2
- mistralai_gcp/models/chatcompletionstreamrequest.py +2 -2
- mistralai_gcp/models/deltamessage.py +3 -3
- mistralai_gcp/models/tool.py +9 -5
- mistralai_gcp/models/toolcall.py +8 -4
- mistralai_gcp/sdk.py +17 -12
- mistralai_gcp/sdkconfiguration.py +3 -3
- {mistralai-1.0.1.dist-info → mistralai-1.0.3.dist-info}/LICENSE +0 -0
- {mistralai-1.0.1.dist-info → mistralai-1.0.3.dist-info}/WHEEL +0 -0
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
|
-
|
|
50
|
-
|
|
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
|
|
66
|
+
if access_token:
|
|
67
|
+
return access_token
|
|
68
|
+
else:
|
|
64
69
|
credentials.refresh(google.auth.transport.requests.Request())
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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()
|
|
@@ -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.
|
|
33
|
-
gen_version: str = "2.
|
|
34
|
-
user_agent: str = "speakeasy-sdk/python 1.0.
|
|
32
|
+
sdk_version: str = "1.0.1"
|
|
33
|
+
gen_version: str = "2.399.0"
|
|
34
|
+
user_agent: str = "speakeasy-sdk/python 1.0.1 2.399.0 0.0.2 mistralai-gcp"
|
|
35
35
|
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
|
36
36
|
timeout_ms: Optional[int] = None
|
|
37
37
|
|
|
File without changes
|
|
File without changes
|