mistralai 1.9.11__py3-none-any.whl → 1.10.1__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 (151) hide show
  1. mistralai/_hooks/registration.py +5 -0
  2. mistralai/_hooks/tracing.py +75 -0
  3. mistralai/_version.py +2 -2
  4. mistralai/accesses.py +8 -8
  5. mistralai/agents.py +29 -17
  6. mistralai/chat.py +41 -29
  7. mistralai/classifiers.py +13 -1
  8. mistralai/conversations.py +294 -62
  9. mistralai/documents.py +19 -3
  10. mistralai/embeddings.py +13 -7
  11. mistralai/extra/README.md +1 -1
  12. mistralai/extra/mcp/auth.py +10 -11
  13. mistralai/extra/mcp/base.py +17 -16
  14. mistralai/extra/mcp/sse.py +13 -15
  15. mistralai/extra/mcp/stdio.py +5 -6
  16. mistralai/extra/observability/__init__.py +15 -0
  17. mistralai/extra/observability/otel.py +372 -0
  18. mistralai/extra/run/context.py +33 -43
  19. mistralai/extra/run/result.py +29 -30
  20. mistralai/extra/run/tools.py +34 -23
  21. mistralai/extra/struct_chat.py +15 -8
  22. mistralai/extra/utils/response_format.py +5 -3
  23. mistralai/files.py +6 -0
  24. mistralai/fim.py +17 -5
  25. mistralai/mistral_agents.py +229 -1
  26. mistralai/mistral_jobs.py +39 -13
  27. mistralai/models/__init__.py +99 -3
  28. mistralai/models/agent.py +15 -2
  29. mistralai/models/agentconversation.py +11 -3
  30. mistralai/models/agentcreationrequest.py +6 -2
  31. mistralai/models/agents_api_v1_agents_deleteop.py +16 -0
  32. mistralai/models/agents_api_v1_agents_getop.py +40 -3
  33. mistralai/models/agents_api_v1_agents_listop.py +72 -2
  34. mistralai/models/agents_api_v1_conversations_deleteop.py +18 -0
  35. mistralai/models/agents_api_v1_conversations_listop.py +39 -2
  36. mistralai/models/agentscompletionrequest.py +21 -6
  37. mistralai/models/agentscompletionstreamrequest.py +21 -6
  38. mistralai/models/agentupdaterequest.py +18 -2
  39. mistralai/models/audioencoding.py +13 -0
  40. mistralai/models/audioformat.py +19 -0
  41. mistralai/models/audiotranscriptionrequest.py +2 -0
  42. mistralai/models/batchjobin.py +26 -5
  43. mistralai/models/batchjobout.py +5 -0
  44. mistralai/models/batchrequest.py +48 -0
  45. mistralai/models/chatcompletionrequest.py +22 -5
  46. mistralai/models/chatcompletionstreamrequest.py +22 -5
  47. mistralai/models/classificationrequest.py +37 -3
  48. mistralai/models/conversationrequest.py +15 -4
  49. mistralai/models/conversationrestartrequest.py +50 -2
  50. mistralai/models/conversationrestartstreamrequest.py +50 -2
  51. mistralai/models/conversationstreamrequest.py +15 -4
  52. mistralai/models/documentout.py +26 -10
  53. mistralai/models/documentupdatein.py +24 -3
  54. mistralai/models/embeddingrequest.py +19 -11
  55. mistralai/models/files_api_routes_list_filesop.py +7 -0
  56. mistralai/models/fimcompletionrequest.py +8 -9
  57. mistralai/models/fimcompletionstreamrequest.py +8 -9
  58. mistralai/models/jobs_api_routes_batch_get_batch_jobop.py +40 -3
  59. mistralai/models/libraries_documents_list_v1op.py +15 -2
  60. mistralai/models/libraryout.py +10 -7
  61. mistralai/models/listfilesout.py +35 -4
  62. mistralai/models/modelcapabilities.py +13 -4
  63. mistralai/models/modelconversation.py +8 -2
  64. mistralai/models/ocrpageobject.py +26 -5
  65. mistralai/models/ocrrequest.py +17 -1
  66. mistralai/models/ocrtableobject.py +31 -0
  67. mistralai/models/prediction.py +4 -0
  68. mistralai/models/requestsource.py +7 -0
  69. mistralai/models/responseformat.py +4 -2
  70. mistralai/models/responseformats.py +0 -1
  71. mistralai/models/sharingdelete.py +36 -5
  72. mistralai/models/sharingin.py +36 -5
  73. mistralai/models/sharingout.py +3 -3
  74. mistralai/models/toolexecutiondeltaevent.py +13 -4
  75. mistralai/models/toolexecutiondoneevent.py +13 -4
  76. mistralai/models/toolexecutionentry.py +9 -4
  77. mistralai/models/toolexecutionstartedevent.py +13 -4
  78. mistralai/models/toolfilechunk.py +11 -4
  79. mistralai/models/toolreferencechunk.py +13 -4
  80. mistralai/models_.py +2 -14
  81. mistralai/ocr.py +18 -0
  82. mistralai/transcriptions.py +4 -4
  83. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/METADATA +162 -152
  84. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/RECORD +168 -144
  85. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/WHEEL +1 -1
  86. mistralai_azure/_version.py +3 -3
  87. mistralai_azure/basesdk.py +15 -5
  88. mistralai_azure/chat.py +59 -98
  89. mistralai_azure/models/__init__.py +50 -3
  90. mistralai_azure/models/chatcompletionrequest.py +16 -4
  91. mistralai_azure/models/chatcompletionstreamrequest.py +16 -4
  92. mistralai_azure/models/httpvalidationerror.py +11 -6
  93. mistralai_azure/models/mistralazureerror.py +26 -0
  94. mistralai_azure/models/no_response_error.py +13 -0
  95. mistralai_azure/models/prediction.py +4 -0
  96. mistralai_azure/models/responseformat.py +4 -2
  97. mistralai_azure/models/responseformats.py +0 -1
  98. mistralai_azure/models/responsevalidationerror.py +25 -0
  99. mistralai_azure/models/sdkerror.py +30 -14
  100. mistralai_azure/models/systemmessage.py +7 -3
  101. mistralai_azure/models/systemmessagecontentchunks.py +21 -0
  102. mistralai_azure/models/thinkchunk.py +35 -0
  103. mistralai_azure/ocr.py +15 -36
  104. mistralai_azure/utils/__init__.py +18 -5
  105. mistralai_azure/utils/eventstreaming.py +10 -0
  106. mistralai_azure/utils/serializers.py +3 -2
  107. mistralai_azure/utils/unmarshal_json_response.py +24 -0
  108. mistralai_gcp/_hooks/types.py +7 -0
  109. mistralai_gcp/_version.py +4 -4
  110. mistralai_gcp/basesdk.py +27 -25
  111. mistralai_gcp/chat.py +75 -98
  112. mistralai_gcp/fim.py +39 -74
  113. mistralai_gcp/httpclient.py +6 -16
  114. mistralai_gcp/models/__init__.py +321 -116
  115. mistralai_gcp/models/assistantmessage.py +1 -1
  116. mistralai_gcp/models/chatcompletionrequest.py +36 -7
  117. mistralai_gcp/models/chatcompletionresponse.py +6 -6
  118. mistralai_gcp/models/chatcompletionstreamrequest.py +36 -7
  119. mistralai_gcp/models/completionresponsestreamchoice.py +1 -1
  120. mistralai_gcp/models/deltamessage.py +1 -1
  121. mistralai_gcp/models/fimcompletionrequest.py +3 -9
  122. mistralai_gcp/models/fimcompletionresponse.py +6 -6
  123. mistralai_gcp/models/fimcompletionstreamrequest.py +3 -9
  124. mistralai_gcp/models/httpvalidationerror.py +11 -6
  125. mistralai_gcp/models/imageurl.py +1 -1
  126. mistralai_gcp/models/jsonschema.py +1 -1
  127. mistralai_gcp/models/mistralgcperror.py +26 -0
  128. mistralai_gcp/models/mistralpromptmode.py +8 -0
  129. mistralai_gcp/models/no_response_error.py +13 -0
  130. mistralai_gcp/models/prediction.py +4 -0
  131. mistralai_gcp/models/responseformat.py +5 -3
  132. mistralai_gcp/models/responseformats.py +0 -1
  133. mistralai_gcp/models/responsevalidationerror.py +25 -0
  134. mistralai_gcp/models/sdkerror.py +30 -14
  135. mistralai_gcp/models/systemmessage.py +7 -3
  136. mistralai_gcp/models/systemmessagecontentchunks.py +21 -0
  137. mistralai_gcp/models/thinkchunk.py +35 -0
  138. mistralai_gcp/models/toolmessage.py +1 -1
  139. mistralai_gcp/models/usageinfo.py +71 -8
  140. mistralai_gcp/models/usermessage.py +1 -1
  141. mistralai_gcp/sdk.py +12 -10
  142. mistralai_gcp/sdkconfiguration.py +0 -7
  143. mistralai_gcp/types/basemodel.py +3 -3
  144. mistralai_gcp/utils/__init__.py +143 -45
  145. mistralai_gcp/utils/datetimes.py +23 -0
  146. mistralai_gcp/utils/enums.py +67 -27
  147. mistralai_gcp/utils/eventstreaming.py +10 -0
  148. mistralai_gcp/utils/forms.py +49 -28
  149. mistralai_gcp/utils/serializers.py +33 -3
  150. mistralai_gcp/utils/unmarshal_json_response.py +24 -0
  151. {mistralai-1.9.11.dist-info → mistralai-1.10.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,39 +1,36 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mistralai
3
- Version: 1.9.11
3
+ Version: 1.10.1
4
4
  Summary: Python Client SDK for the Mistral AI API.
5
- License-File: LICENSE
5
+ Project-URL: Repository, https://github.com/mistralai/client-python.git
6
6
  Author: Mistral
7
- Requires-Python: >=3.9
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.9
10
- Classifier: Programming Language :: Python :: 3.10
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Classifier: Programming Language :: Python :: 3.13
14
- Classifier: Programming Language :: Python :: 3.14
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: eval-type-backport>=0.2.0
10
+ Requires-Dist: httpx>=0.28.1
11
+ Requires-Dist: invoke<3.0.0,>=2.2.0
12
+ Requires-Dist: opentelemetry-api<2.0.0,>=1.33.1
13
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http<2.0.0,>=1.37.0
14
+ Requires-Dist: opentelemetry-sdk<2.0.0,>=1.33.1
15
+ Requires-Dist: opentelemetry-semantic-conventions<0.60,>=0.59b0
16
+ Requires-Dist: pydantic>=2.10.3
17
+ Requires-Dist: python-dateutil>=2.8.2
18
+ Requires-Dist: pyyaml<7.0.0,>=6.0.2
19
+ Requires-Dist: typing-inspection>=0.4.0
15
20
  Provides-Extra: agents
21
+ Requires-Dist: authlib<2.0,>=1.5.2; extra == 'agents'
22
+ Requires-Dist: griffe<2.0,>=1.7.3; extra == 'agents'
23
+ Requires-Dist: mcp<2.0,>=1.0; extra == 'agents'
16
24
  Provides-Extra: gcp
17
- Requires-Dist: authlib (>=1.5.2,<2.0) ; extra == "agents"
18
- Requires-Dist: eval-type-backport (>=0.2.0)
19
- Requires-Dist: google-auth (>=2.27.0) ; extra == "gcp"
20
- Requires-Dist: griffe (>=1.7.3,<2.0) ; extra == "agents"
21
- Requires-Dist: httpx (>=0.28.1)
22
- Requires-Dist: invoke (>=2.2.0,<3.0.0)
23
- Requires-Dist: mcp (>=1.0,<2.0) ; (python_version >= "3.10") and (extra == "agents")
24
- Requires-Dist: pydantic (>=2.10.3)
25
- Requires-Dist: python-dateutil (>=2.8.2)
26
- Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
27
- Requires-Dist: requests (>=2.32.3) ; extra == "gcp"
28
- Requires-Dist: typing-inspection (>=0.4.0)
29
- Project-URL: Repository, https://github.com/mistralai/client-python.git
25
+ Requires-Dist: google-auth>=2.27.0; extra == 'gcp'
26
+ Requires-Dist: requests>=2.32.3; extra == 'gcp'
30
27
  Description-Content-Type: text/markdown
31
28
 
32
29
  # Mistral Python Client
33
30
 
34
31
  ## Migration warning
35
32
 
36
- This documentation is for Mistral AI SDK v1. You can find more details on how to migrate from v0 to v1 [here](https://github.com/mistralai/client-python/blob/master/MIGRATION.md)
33
+ This documentation is for Mistral AI SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
37
34
 
38
35
  ## API Key Setup
39
36
 
@@ -59,25 +56,25 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
59
56
  <!-- Start Table of Contents [toc] -->
60
57
  ## Table of Contents
61
58
  <!-- $toc-max-depth=2 -->
62
- * [Mistral Python Client](https://github.com/mistralai/client-python/blob/master/#mistral-python-client)
63
- * [Migration warning](https://github.com/mistralai/client-python/blob/master/#migration-warning)
64
- * [API Key Setup](https://github.com/mistralai/client-python/blob/master/#api-key-setup)
65
- * [SDK Installation](https://github.com/mistralai/client-python/blob/master/#sdk-installation)
66
- * [SDK Example Usage](https://github.com/mistralai/client-python/blob/master/#sdk-example-usage)
67
- * [Providers' SDKs Example Usage](https://github.com/mistralai/client-python/blob/master/#providers-sdks-example-usage)
68
- * [Available Resources and Operations](https://github.com/mistralai/client-python/blob/master/#available-resources-and-operations)
69
- * [Server-sent event streaming](https://github.com/mistralai/client-python/blob/master/#server-sent-event-streaming)
70
- * [File uploads](https://github.com/mistralai/client-python/blob/master/#file-uploads)
71
- * [Retries](https://github.com/mistralai/client-python/blob/master/#retries)
72
- * [Error Handling](https://github.com/mistralai/client-python/blob/master/#error-handling)
73
- * [Server Selection](https://github.com/mistralai/client-python/blob/master/#server-selection)
74
- * [Custom HTTP Client](https://github.com/mistralai/client-python/blob/master/#custom-http-client)
75
- * [Authentication](https://github.com/mistralai/client-python/blob/master/#authentication)
76
- * [Resource Management](https://github.com/mistralai/client-python/blob/master/#resource-management)
77
- * [Debugging](https://github.com/mistralai/client-python/blob/master/#debugging)
78
- * [IDE Support](https://github.com/mistralai/client-python/blob/master/#ide-support)
79
- * [Development](https://github.com/mistralai/client-python/blob/master/#development)
80
- * [Contributions](https://github.com/mistralai/client-python/blob/master/#contributions)
59
+ * [Mistral Python Client](#mistral-python-client)
60
+ * [Migration warning](#migration-warning)
61
+ * [API Key Setup](#api-key-setup)
62
+ * [SDK Installation](#sdk-installation)
63
+ * [SDK Example Usage](#sdk-example-usage)
64
+ * [Providers' SDKs Example Usage](#providers-sdks-example-usage)
65
+ * [Available Resources and Operations](#available-resources-and-operations)
66
+ * [Server-sent event streaming](#server-sent-event-streaming)
67
+ * [File uploads](#file-uploads)
68
+ * [Retries](#retries)
69
+ * [Error Handling](#error-handling)
70
+ * [Server Selection](#server-selection)
71
+ * [Custom HTTP Client](#custom-http-client)
72
+ * [Authentication](#authentication)
73
+ * [Resource Management](#resource-management)
74
+ * [Debugging](#debugging)
75
+ * [IDE Support](#ide-support)
76
+ * [Development](#development)
77
+ * [Contributions](#contributions)
81
78
 
82
79
  <!-- End Table of Contents [toc] -->
83
80
 
@@ -156,8 +153,7 @@ installing the package:
156
153
  pip install "mistralai[agents]"
157
154
  ```
158
155
 
159
- > Note: Because of some of our dependencies, these features are only available for python version higher or equal to
160
- > 3.10.
156
+ > Note: These features require Python 3.10+ (the SDK minimum).
161
157
 
162
158
  <!-- Start SDK Example Usage [usage] -->
163
159
  ## SDK Example Usage
@@ -176,12 +172,14 @@ with Mistral(
176
172
  api_key=os.getenv("MISTRAL_API_KEY", ""),
177
173
  ) as mistral:
178
174
 
179
- res = mistral.chat.complete(model="mistral-small-latest", messages=[
175
+ res = mistral.chat.complete(model="mistral-large-latest", messages=[
180
176
  {
181
177
  "content": "Who is the best French painter? Answer in one short sentence.",
182
178
  "role": "user",
183
179
  },
184
- ], stream=False)
180
+ ], stream=False, response_format={
181
+ "type": "text",
182
+ })
185
183
 
186
184
  # Handle response
187
185
  print(res)
@@ -202,12 +200,14 @@ async def main():
202
200
  api_key=os.getenv("MISTRAL_API_KEY", ""),
203
201
  ) as mistral:
204
202
 
205
- res = await mistral.chat.complete_async(model="mistral-small-latest", messages=[
203
+ res = await mistral.chat.complete_async(model="mistral-large-latest", messages=[
206
204
  {
207
205
  "content": "Who is the best French painter? Answer in one short sentence.",
208
206
  "role": "user",
209
207
  },
210
- ], stream=False)
208
+ ], stream=False, response_format={
209
+ "type": "text",
210
+ })
211
211
 
212
212
  # Handle response
213
213
  print(res)
@@ -283,7 +283,9 @@ with Mistral(
283
283
  "content": "Who is the best French painter? Answer in one short sentence.",
284
284
  "role": "user",
285
285
  },
286
- ], agent_id="<id>", stream=False)
286
+ ], agent_id="<id>", stream=False, response_format={
287
+ "type": "text",
288
+ })
287
289
 
288
290
  # Handle response
289
291
  print(res)
@@ -309,7 +311,9 @@ async def main():
309
311
  "content": "Who is the best French painter? Answer in one short sentence.",
310
312
  "role": "user",
311
313
  },
312
- ], agent_id="<id>", stream=False)
314
+ ], agent_id="<id>", stream=False, response_format={
315
+ "type": "text",
316
+ })
313
317
 
314
318
  # Handle response
315
319
  print(res)
@@ -370,7 +374,7 @@ asyncio.run(main())
370
374
 
371
375
  ### More examples
372
376
 
373
- You can run the examples in the `examples/` directory using `poetry run` or by entering the virtual environment using `poetry shell`.
377
+ You can run the examples in the `examples/` directory using `uv run`.
374
378
 
375
379
 
376
380
  ## Providers' SDKs Example Usage
@@ -382,7 +386,7 @@ You can run the examples in the `examples/` directory using `poetry run` or by e
382
386
  Before you begin, ensure you have `AZUREAI_ENDPOINT` and an `AZURE_API_KEY`. To obtain these, you will need to deploy Mistral on Azure AI.
383
387
  See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/).
384
388
 
385
- Here's a basic example to get you started. You can also run [the example in the `examples` directory](https://github.com/mistralai/client-python/blob/master//examples/azure).
389
+ Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure).
386
390
 
387
391
  ```python
388
392
  import asyncio
@@ -410,7 +414,7 @@ async def main() -> None:
410
414
 
411
415
  asyncio.run(main())
412
416
  ```
413
- The documentation for the Azure SDK is available [here](https://github.com/mistralai/client-python/blob/master/packages/mistralai_azure/README.md).
417
+ The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md).
414
418
 
415
419
  ### Google Cloud
416
420
 
@@ -459,7 +463,7 @@ async def main() -> None:
459
463
  asyncio.run(main())
460
464
  ```
461
465
 
462
- The documentation for the GCP SDK is available [here](https://github.com/mistralai/client-python/blob/master/packages/mistralai_gcp/README.md).
466
+ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md).
463
467
 
464
468
 
465
469
  <!-- Start Available Resources and Operations [operations] -->
@@ -468,134 +472,136 @@ The documentation for the GCP SDK is available [here](https://github.com/mistral
468
472
  <details open>
469
473
  <summary>Available methods</summary>
470
474
 
471
- ### [agents](https://github.com/mistralai/client-python/blob/master/docs/sdks/agents/README.md)
475
+ ### [agents](docs/sdks/agents/README.md)
472
476
 
473
- * [complete](https://github.com/mistralai/client-python/blob/master/docs/sdks/agents/README.md#complete) - Agents Completion
474
- * [stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/agents/README.md#stream) - Stream Agents completion
477
+ * [complete](docs/sdks/agents/README.md#complete) - Agents Completion
478
+ * [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion
475
479
 
476
- ### [audio](https://github.com/mistralai/client-python/blob/master/docs/sdks/audio/README.md)
480
+ ### [audio](docs/sdks/audio/README.md)
477
481
 
478
482
 
479
- #### [audio.transcriptions](https://github.com/mistralai/client-python/blob/master/docs/sdks/transcriptions/README.md)
483
+ #### [audio.transcriptions](docs/sdks/transcriptions/README.md)
480
484
 
481
- * [complete](https://github.com/mistralai/client-python/blob/master/docs/sdks/transcriptions/README.md#complete) - Create Transcription
482
- * [stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/transcriptions/README.md#stream) - Create streaming transcription (SSE)
485
+ * [complete](docs/sdks/transcriptions/README.md#complete) - Create Transcription
486
+ * [stream](docs/sdks/transcriptions/README.md#stream) - Create Streaming Transcription (SSE)
483
487
 
484
- ### [batch](https://github.com/mistralai/client-python/blob/master/docs/sdks/batch/README.md)
488
+ ### [batch](docs/sdks/batch/README.md)
485
489
 
486
490
 
487
- #### [batch.jobs](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md)
491
+ #### [batch.jobs](docs/sdks/mistraljobs/README.md)
488
492
 
489
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#list) - Get Batch Jobs
490
- * [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#create) - Create Batch Job
491
- * [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#get) - Get Batch Job
492
- * [cancel](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistraljobs/README.md#cancel) - Cancel Batch Job
493
+ * [list](docs/sdks/mistraljobs/README.md#list) - Get Batch Jobs
494
+ * [create](docs/sdks/mistraljobs/README.md#create) - Create Batch Job
495
+ * [get](docs/sdks/mistraljobs/README.md#get) - Get Batch Job
496
+ * [cancel](docs/sdks/mistraljobs/README.md#cancel) - Cancel Batch Job
493
497
 
494
- ### [beta](https://github.com/mistralai/client-python/blob/master/docs/sdks/beta/README.md)
498
+ ### [beta](docs/sdks/beta/README.md)
495
499
 
496
500
 
497
- #### [beta.agents](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistralagents/README.md)
501
+ #### [beta.agents](docs/sdks/mistralagents/README.md)
498
502
 
499
- * [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistralagents/README.md#create) - Create a agent that can be used within a conversation.
500
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistralagents/README.md#list) - List agent entities.
501
- * [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistralagents/README.md#get) - Retrieve an agent entity.
502
- * [update](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistralagents/README.md#update) - Update an agent entity.
503
- * [update_version](https://github.com/mistralai/client-python/blob/master/docs/sdks/mistralagents/README.md#update_version) - Update an agent version.
503
+ * [create](docs/sdks/mistralagents/README.md#create) - Create a agent that can be used within a conversation.
504
+ * [list](docs/sdks/mistralagents/README.md#list) - List agent entities.
505
+ * [get](docs/sdks/mistralagents/README.md#get) - Retrieve an agent entity.
506
+ * [update](docs/sdks/mistralagents/README.md#update) - Update an agent entity.
507
+ * [delete](docs/sdks/mistralagents/README.md#delete) - Delete an agent entity.
508
+ * [update_version](docs/sdks/mistralagents/README.md#update_version) - Update an agent version.
504
509
 
505
- #### [beta.conversations](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md)
510
+ #### [beta.conversations](docs/sdks/conversations/README.md)
506
511
 
507
- * [start](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#start) - Create a conversation and append entries to it.
508
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#list) - List all created conversations.
509
- * [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#get) - Retrieve a conversation information.
510
- * [append](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#append) - Append new entries to an existing conversation.
511
- * [get_history](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#get_history) - Retrieve all entries in a conversation.
512
- * [get_messages](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#get_messages) - Retrieve all messages in a conversation.
513
- * [restart](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#restart) - Restart a conversation starting from a given entry.
514
- * [start_stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#start_stream) - Create a conversation and append entries to it.
515
- * [append_stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#append_stream) - Append new entries to an existing conversation.
516
- * [restart_stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/conversations/README.md#restart_stream) - Restart a conversation starting from a given entry.
512
+ * [start](docs/sdks/conversations/README.md#start) - Create a conversation and append entries to it.
513
+ * [list](docs/sdks/conversations/README.md#list) - List all created conversations.
514
+ * [get](docs/sdks/conversations/README.md#get) - Retrieve a conversation information.
515
+ * [delete](docs/sdks/conversations/README.md#delete) - Delete a conversation.
516
+ * [append](docs/sdks/conversations/README.md#append) - Append new entries to an existing conversation.
517
+ * [get_history](docs/sdks/conversations/README.md#get_history) - Retrieve all entries in a conversation.
518
+ * [get_messages](docs/sdks/conversations/README.md#get_messages) - Retrieve all messages in a conversation.
519
+ * [restart](docs/sdks/conversations/README.md#restart) - Restart a conversation starting from a given entry.
520
+ * [start_stream](docs/sdks/conversations/README.md#start_stream) - Create a conversation and append entries to it.
521
+ * [append_stream](docs/sdks/conversations/README.md#append_stream) - Append new entries to an existing conversation.
522
+ * [restart_stream](docs/sdks/conversations/README.md#restart_stream) - Restart a conversation starting from a given entry.
517
523
 
518
- #### [beta.libraries](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md)
524
+ #### [beta.libraries](docs/sdks/libraries/README.md)
519
525
 
520
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#list) - List all libraries you have access to.
521
- * [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#create) - Create a new Library.
522
- * [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#get) - Detailed information about a specific Library.
523
- * [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#delete) - Delete a library and all of it's document.
524
- * [update](https://github.com/mistralai/client-python/blob/master/docs/sdks/libraries/README.md#update) - Update a library.
526
+ * [list](docs/sdks/libraries/README.md#list) - List all libraries you have access to.
527
+ * [create](docs/sdks/libraries/README.md#create) - Create a new Library.
528
+ * [get](docs/sdks/libraries/README.md#get) - Detailed information about a specific Library.
529
+ * [delete](docs/sdks/libraries/README.md#delete) - Delete a library and all of it's document.
530
+ * [update](docs/sdks/libraries/README.md#update) - Update a library.
525
531
 
526
- #### [beta.libraries.accesses](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md)
532
+ #### [beta.libraries.accesses](docs/sdks/accesses/README.md)
527
533
 
528
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md#list) - List all of the access to this library.
529
- * [update_or_create](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md#update_or_create) - Create or update an access level.
530
- * [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/accesses/README.md#delete) - Delete an access level.
534
+ * [list](docs/sdks/accesses/README.md#list) - List all of the access to this library.
535
+ * [update_or_create](docs/sdks/accesses/README.md#update_or_create) - Create or update an access level.
536
+ * [delete](docs/sdks/accesses/README.md#delete) - Delete an access level.
531
537
 
532
- #### [beta.libraries.documents](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md)
538
+ #### [beta.libraries.documents](docs/sdks/documents/README.md)
533
539
 
534
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#list) - List document in a given library.
535
- * [upload](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#upload) - Upload a new document.
536
- * [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#get) - Retrieve the metadata of a specific document.
537
- * [update](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#update) - Update the metadata of a specific document.
538
- * [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#delete) - Delete a document.
539
- * [text_content](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#text_content) - Retrieve the text content of a specific document.
540
- * [status](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#status) - Retrieve the processing status of a specific document.
541
- * [get_signed_url](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#get_signed_url) - Retrieve the signed URL of a specific document.
542
- * [extracted_text_signed_url](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#extracted_text_signed_url) - Retrieve the signed URL of text extracted from a given document.
543
- * [reprocess](https://github.com/mistralai/client-python/blob/master/docs/sdks/documents/README.md#reprocess) - Reprocess a document.
540
+ * [list](docs/sdks/documents/README.md#list) - List documents in a given library.
541
+ * [upload](docs/sdks/documents/README.md#upload) - Upload a new document.
542
+ * [get](docs/sdks/documents/README.md#get) - Retrieve the metadata of a specific document.
543
+ * [update](docs/sdks/documents/README.md#update) - Update the metadata of a specific document.
544
+ * [delete](docs/sdks/documents/README.md#delete) - Delete a document.
545
+ * [text_content](docs/sdks/documents/README.md#text_content) - Retrieve the text content of a specific document.
546
+ * [status](docs/sdks/documents/README.md#status) - Retrieve the processing status of a specific document.
547
+ * [get_signed_url](docs/sdks/documents/README.md#get_signed_url) - Retrieve the signed URL of a specific document.
548
+ * [extracted_text_signed_url](docs/sdks/documents/README.md#extracted_text_signed_url) - Retrieve the signed URL of text extracted from a given document.
549
+ * [reprocess](docs/sdks/documents/README.md#reprocess) - Reprocess a document.
544
550
 
545
- ### [chat](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md)
551
+ ### [chat](docs/sdks/chat/README.md)
546
552
 
547
- * [complete](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md#complete) - Chat Completion
548
- * [stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/chat/README.md#stream) - Stream chat completion
553
+ * [complete](docs/sdks/chat/README.md#complete) - Chat Completion
554
+ * [stream](docs/sdks/chat/README.md#stream) - Stream chat completion
549
555
 
550
- ### [classifiers](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md)
556
+ ### [classifiers](docs/sdks/classifiers/README.md)
551
557
 
552
- * [moderate](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md#moderate) - Moderations
553
- * [moderate_chat](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md#moderate_chat) - Chat Moderations
554
- * [classify](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md#classify) - Classifications
555
- * [classify_chat](https://github.com/mistralai/client-python/blob/master/docs/sdks/classifiers/README.md#classify_chat) - Chat Classifications
558
+ * [moderate](docs/sdks/classifiers/README.md#moderate) - Moderations
559
+ * [moderate_chat](docs/sdks/classifiers/README.md#moderate_chat) - Chat Moderations
560
+ * [classify](docs/sdks/classifiers/README.md#classify) - Classifications
561
+ * [classify_chat](docs/sdks/classifiers/README.md#classify_chat) - Chat Classifications
556
562
 
557
- ### [embeddings](https://github.com/mistralai/client-python/blob/master/docs/sdks/embeddings/README.md)
563
+ ### [embeddings](docs/sdks/embeddings/README.md)
558
564
 
559
- * [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/embeddings/README.md#create) - Embeddings
565
+ * [create](docs/sdks/embeddings/README.md#create) - Embeddings
560
566
 
561
- ### [files](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md)
567
+ ### [files](docs/sdks/files/README.md)
562
568
 
563
- * [upload](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#upload) - Upload File
564
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#list) - List Files
565
- * [retrieve](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#retrieve) - Retrieve File
566
- * [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#delete) - Delete File
567
- * [download](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#download) - Download File
568
- * [get_signed_url](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#get_signed_url) - Get Signed Url
569
+ * [upload](docs/sdks/files/README.md#upload) - Upload File
570
+ * [list](docs/sdks/files/README.md#list) - List Files
571
+ * [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File
572
+ * [delete](docs/sdks/files/README.md#delete) - Delete File
573
+ * [download](docs/sdks/files/README.md#download) - Download File
574
+ * [get_signed_url](docs/sdks/files/README.md#get_signed_url) - Get Signed Url
569
575
 
570
- ### [fim](https://github.com/mistralai/client-python/blob/master/docs/sdks/fim/README.md)
576
+ ### [fim](docs/sdks/fim/README.md)
571
577
 
572
- * [complete](https://github.com/mistralai/client-python/blob/master/docs/sdks/fim/README.md#complete) - Fim Completion
573
- * [stream](https://github.com/mistralai/client-python/blob/master/docs/sdks/fim/README.md#stream) - Stream fim completion
578
+ * [complete](docs/sdks/fim/README.md#complete) - Fim Completion
579
+ * [stream](docs/sdks/fim/README.md#stream) - Stream fim completion
574
580
 
575
- ### [fine_tuning](https://github.com/mistralai/client-python/blob/master/docs/sdks/finetuning/README.md)
581
+ ### [fine_tuning](docs/sdks/finetuning/README.md)
576
582
 
577
583
 
578
- #### [fine_tuning.jobs](https://github.com/mistralai/client-python/blob/master/docs/sdks/jobs/README.md)
584
+ #### [fine_tuning.jobs](docs/sdks/jobs/README.md)
579
585
 
580
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs
581
- * [create](https://github.com/mistralai/client-python/blob/master/docs/sdks/jobs/README.md#create) - Create Fine Tuning Job
582
- * [get](https://github.com/mistralai/client-python/blob/master/docs/sdks/jobs/README.md#get) - Get Fine Tuning Job
583
- * [cancel](https://github.com/mistralai/client-python/blob/master/docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job
584
- * [start](https://github.com/mistralai/client-python/blob/master/docs/sdks/jobs/README.md#start) - Start Fine Tuning Job
586
+ * [list](docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs
587
+ * [create](docs/sdks/jobs/README.md#create) - Create Fine Tuning Job
588
+ * [get](docs/sdks/jobs/README.md#get) - Get Fine Tuning Job
589
+ * [cancel](docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job
590
+ * [start](docs/sdks/jobs/README.md#start) - Start Fine Tuning Job
585
591
 
586
592
 
587
- ### [models](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md)
593
+ ### [models](docs/sdks/models/README.md)
588
594
 
589
- * [list](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#list) - List Models
590
- * [retrieve](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#retrieve) - Retrieve Model
591
- * [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#delete) - Delete Model
592
- * [update](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#update) - Update Fine Tuned Model
593
- * [archive](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#archive) - Archive Fine Tuned Model
594
- * [unarchive](https://github.com/mistralai/client-python/blob/master/docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model
595
+ * [list](docs/sdks/models/README.md#list) - List Models
596
+ * [retrieve](docs/sdks/models/README.md#retrieve) - Retrieve Model
597
+ * [delete](docs/sdks/models/README.md#delete) - Delete Model
598
+ * [update](docs/sdks/models/README.md#update) - Update Fine Tuned Model
599
+ * [archive](docs/sdks/models/README.md#archive) - Archive Fine Tuned Model
600
+ * [unarchive](docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model
595
601
 
596
- ### [ocr](https://github.com/mistralai/client-python/blob/master/docs/sdks/ocr/README.md)
602
+ ### [ocr](docs/sdks/ocr/README.md)
597
603
 
598
- * [process](https://github.com/mistralai/client-python/blob/master/docs/sdks/ocr/README.md#process) - OCR
604
+ * [process](docs/sdks/ocr/README.md#process) - OCR
599
605
 
600
606
  </details>
601
607
  <!-- End Available Resources and Operations [operations] -->
@@ -628,7 +634,11 @@ with Mistral(
628
634
  "tool_call_id": "<id>",
629
635
  "result": "<value>",
630
636
  },
631
- ], stream=True)
637
+ ], stream=True, completion_args={
638
+ "response_format": {
639
+ "type": "text",
640
+ },
641
+ })
632
642
 
633
643
  with res as event_stream:
634
644
  for event in event_stream:
@@ -719,7 +729,7 @@ with Mistral(
719
729
  <!-- Start Error Handling [errors] -->
720
730
  ## Error Handling
721
731
 
722
- [`MistralError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/mistralerror.py) is the base class for all HTTP error responses. It has the following properties:
732
+ [`MistralError`](./src/mistralai/models/mistralerror.py) is the base class for all HTTP error responses. It has the following properties:
723
733
 
724
734
  | Property | Type | Description |
725
735
  | ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
@@ -728,7 +738,7 @@ with Mistral(
728
738
  | `err.headers` | `httpx.Headers` | HTTP response headers |
729
739
  | `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
730
740
  | `err.raw_response` | `httpx.Response` | Raw HTTP response |
731
- | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/mistralai/client-python/blob/master/#error-classes). |
741
+ | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
732
742
 
733
743
  ### Example
734
744
  ```python
@@ -743,7 +753,7 @@ with Mistral(
743
753
  res = None
744
754
  try:
745
755
 
746
- res = mistral.models.list()
756
+ res = mistral.models.retrieve(model_id="ft:open-mistral-7b:587a6b29:20240514:7e773925")
747
757
 
748
758
  # Handle response
749
759
  print(res)
@@ -764,7 +774,7 @@ with Mistral(
764
774
 
765
775
  ### Error Classes
766
776
  **Primary error:**
767
- * [`MistralError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/mistralerror.py): The base class for HTTP error responses.
777
+ * [`MistralError`](./src/mistralai/models/mistralerror.py): The base class for HTTP error responses.
768
778
 
769
779
  <details><summary>Less common errors (6)</summary>
770
780
 
@@ -776,13 +786,13 @@ with Mistral(
776
786
  * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
777
787
 
778
788
 
779
- **Inherit from [`MistralError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/mistralerror.py)**:
780
- * [`HTTPValidationError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 47 of 68 methods.*
781
- * [`ResponseValidationError`](https://github.com/mistralai/client-python/blob/master/./src/mistralai/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
789
+ **Inherit from [`MistralError`](./src/mistralai/models/mistralerror.py)**:
790
+ * [`HTTPValidationError`](./src/mistralai/models/httpvalidationerror.py): Validation Error. Status code `422`. Applicable to 48 of 70 methods.*
791
+ * [`ResponseValidationError`](./src/mistralai/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
782
792
 
783
793
  </details>
784
794
 
785
- \* Check [the method documentation](https://github.com/mistralai/client-python/blob/master/#available-resources-and-operations) to see if the error is applicable.
795
+ \* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
786
796
  <!-- End Error Handling [errors] -->
787
797
 
788
798
  <!-- Start Server Selection [server] -->