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.
Files changed (60) hide show
  1. mistralai/agents.py +31 -31
  2. mistralai/chat.py +4 -4
  3. mistralai/jobs.py +8 -8
  4. mistralai/models/__init__.py +20 -20
  5. mistralai/models/agentscompletionstreamrequest.py +33 -31
  6. mistralai/models/archiveftmodelout.py +4 -2
  7. mistralai/models/chatcompletionchoice.py +3 -4
  8. mistralai/models/chatcompletionrequest.py +2 -2
  9. mistralai/models/chatcompletionstreamrequest.py +2 -2
  10. mistralai/models/deltamessage.py +3 -3
  11. mistralai/models/detailedjobout.py +19 -5
  12. mistralai/models/files_api_routes_upload_fileop.py +7 -4
  13. mistralai/models/fileschema.py +8 -3
  14. mistralai/models/ftmodelout.py +4 -2
  15. mistralai/models/githubrepositoryin.py +4 -2
  16. mistralai/models/githubrepositoryout.py +4 -2
  17. mistralai/models/jobin.py +16 -4
  18. mistralai/models/jobout.py +20 -5
  19. mistralai/models/jobsout.py +4 -2
  20. mistralai/models/legacyjobmetadataout.py +4 -2
  21. mistralai/models/retrievefileout.py +8 -3
  22. mistralai/models/tool.py +9 -5
  23. mistralai/models/toolcall.py +8 -4
  24. mistralai/models/trainingparameters.py +6 -2
  25. mistralai/models/trainingparametersin.py +10 -2
  26. mistralai/models/unarchiveftmodelout.py +4 -2
  27. mistralai/models/uploadfileout.py +8 -3
  28. mistralai/models/wandbintegration.py +4 -2
  29. mistralai/models/wandbintegrationout.py +4 -2
  30. mistralai/sdk.py +2 -2
  31. mistralai/sdkconfiguration.py +3 -3
  32. mistralai/utils/__init__.py +2 -2
  33. mistralai/utils/forms.py +10 -9
  34. mistralai/utils/headers.py +8 -8
  35. mistralai/utils/logger.py +8 -0
  36. mistralai/utils/queryparams.py +16 -14
  37. mistralai/utils/serializers.py +17 -8
  38. mistralai/utils/url.py +13 -8
  39. mistralai/utils/values.py +6 -0
  40. mistralai/version.py +7 -0
  41. {mistralai-1.0.1.dist-info → mistralai-1.0.3.dist-info}/METADATA +6 -3
  42. {mistralai-1.0.1.dist-info → mistralai-1.0.3.dist-info}/RECORD +60 -59
  43. mistralai_azure/models/__init__.py +3 -3
  44. mistralai_azure/models/chatcompletionchoice.py +3 -4
  45. mistralai_azure/models/deltamessage.py +3 -3
  46. mistralai_azure/models/tool.py +9 -5
  47. mistralai_azure/models/toolcall.py +8 -4
  48. mistralai_azure/sdkconfiguration.py +3 -3
  49. mistralai_gcp/chat.py +4 -4
  50. mistralai_gcp/models/__init__.py +3 -3
  51. mistralai_gcp/models/chatcompletionchoice.py +3 -4
  52. mistralai_gcp/models/chatcompletionrequest.py +2 -2
  53. mistralai_gcp/models/chatcompletionstreamrequest.py +2 -2
  54. mistralai_gcp/models/deltamessage.py +3 -3
  55. mistralai_gcp/models/tool.py +9 -5
  56. mistralai_gcp/models/toolcall.py +8 -4
  57. mistralai_gcp/sdk.py +17 -12
  58. mistralai_gcp/sdkconfiguration.py +3 -3
  59. {mistralai-1.0.1.dist-info → mistralai-1.0.3.dist-info}/LICENSE +0 -0
  60. {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
- 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()
@@ -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.0-rc.4"
33
- gen_version: str = "2.390.6"
34
- user_agent: str = "speakeasy-sdk/python 1.0.0-rc.4 2.390.6 0.0.2 mistralai-gcp"
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