mistralai 0.4.2__tar.gz → 1.0.0rc2__tar.gz

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 (254) hide show
  1. {mistralai-0.4.2 → mistralai-1.0.0rc2}/LICENSE +1 -1
  2. mistralai-1.0.0rc2/PKG-INFO +686 -0
  3. mistralai-1.0.0rc2/README.md +663 -0
  4. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/__init__.py +5 -0
  5. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py +5 -0
  6. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py +16 -0
  7. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py +15 -0
  8. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py +57 -0
  9. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py +76 -0
  10. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/basesdk.py +253 -0
  11. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/chat.py +470 -0
  12. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/httpclient.py +78 -0
  13. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/__init__.py +28 -0
  14. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py +53 -0
  15. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +22 -0
  16. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py +109 -0
  17. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py +27 -0
  18. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py +107 -0
  19. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py +27 -0
  20. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py +15 -0
  21. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py +48 -0
  22. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py +17 -0
  23. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py +47 -0
  24. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/function.py +19 -0
  25. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py +16 -0
  26. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py +23 -0
  27. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py +18 -0
  28. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py +22 -0
  29. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/security.py +16 -0
  30. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py +26 -0
  31. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py +17 -0
  32. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/tool.py +18 -0
  33. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py +20 -0
  34. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py +50 -0
  35. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py +18 -0
  36. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py +26 -0
  37. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py +24 -0
  38. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/py.typed +1 -0
  39. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/sdk.py +107 -0
  40. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py +54 -0
  41. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/types/__init__.py +21 -0
  42. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/types/basemodel.py +39 -0
  43. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py +84 -0
  44. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py +19 -0
  45. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/enums.py +34 -0
  46. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/eventstreaming.py +178 -0
  47. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/forms.py +207 -0
  48. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/headers.py +136 -0
  49. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/logger.py +16 -0
  50. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/metadata.py +118 -0
  51. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py +203 -0
  52. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py +66 -0
  53. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/retries.py +216 -0
  54. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/security.py +168 -0
  55. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py +181 -0
  56. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/url.py +150 -0
  57. mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/values.py +128 -0
  58. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/__init__.py +5 -0
  59. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py +5 -0
  60. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py +16 -0
  61. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py +15 -0
  62. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py +57 -0
  63. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py +76 -0
  64. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py +253 -0
  65. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/chat.py +458 -0
  66. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/fim.py +438 -0
  67. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/httpclient.py +78 -0
  68. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py +31 -0
  69. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py +53 -0
  70. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +22 -0
  71. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py +105 -0
  72. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py +27 -0
  73. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py +103 -0
  74. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py +27 -0
  75. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py +15 -0
  76. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py +48 -0
  77. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py +17 -0
  78. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py +47 -0
  79. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py +94 -0
  80. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py +27 -0
  81. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py +92 -0
  82. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/function.py +19 -0
  83. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py +16 -0
  84. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py +23 -0
  85. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py +18 -0
  86. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py +22 -0
  87. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/security.py +16 -0
  88. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py +26 -0
  89. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py +17 -0
  90. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py +18 -0
  91. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py +20 -0
  92. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py +50 -0
  93. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py +18 -0
  94. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py +26 -0
  95. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py +24 -0
  96. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/py.typed +1 -0
  97. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/sdk.py +174 -0
  98. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py +54 -0
  99. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py +21 -0
  100. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/types/basemodel.py +39 -0
  101. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py +84 -0
  102. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py +19 -0
  103. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py +34 -0
  104. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/eventstreaming.py +178 -0
  105. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py +207 -0
  106. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py +136 -0
  107. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py +16 -0
  108. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py +118 -0
  109. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py +203 -0
  110. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py +66 -0
  111. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/retries.py +216 -0
  112. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py +168 -0
  113. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py +181 -0
  114. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/url.py +150 -0
  115. mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/values.py +128 -0
  116. mistralai-1.0.0rc2/py.typed +1 -0
  117. mistralai-1.0.0rc2/pyproject.toml +53 -0
  118. mistralai-1.0.0rc2/src/mistralai/__init__.py +5 -0
  119. mistralai-1.0.0rc2/src/mistralai/_hooks/__init__.py +5 -0
  120. mistralai-1.0.0rc2/src/mistralai/_hooks/custom_user_agent.py +16 -0
  121. mistralai-1.0.0rc2/src/mistralai/_hooks/deprecation_warning.py +26 -0
  122. mistralai-1.0.0rc2/src/mistralai/_hooks/registration.py +17 -0
  123. mistralai-1.0.0rc2/src/mistralai/_hooks/sdkhooks.py +57 -0
  124. mistralai-1.0.0rc2/src/mistralai/_hooks/types.py +76 -0
  125. mistralai-1.0.0rc2/src/mistralai/agents.py +434 -0
  126. mistralai-1.0.0rc2/src/mistralai/async_client.py +15 -0
  127. mistralai-1.0.0rc2/src/mistralai/basesdk.py +253 -0
  128. mistralai-1.0.0rc2/src/mistralai/chat.py +470 -0
  129. mistralai-1.0.0rc2/src/mistralai/client.py +14 -0
  130. mistralai-1.0.0rc2/src/mistralai/embeddings.py +182 -0
  131. mistralai-1.0.0rc2/src/mistralai/files.py +600 -0
  132. mistralai-1.0.0rc2/src/mistralai/fim.py +438 -0
  133. mistralai-1.0.0rc2/src/mistralai/fine_tuning.py +16 -0
  134. mistralai-1.0.0rc2/src/mistralai/httpclient.py +78 -0
  135. mistralai-1.0.0rc2/src/mistralai/jobs.py +854 -0
  136. mistralai-1.0.0rc2/src/mistralai/models/__init__.py +82 -0
  137. mistralai-1.0.0rc2/src/mistralai/models/agentscompletionrequest.py +96 -0
  138. mistralai-1.0.0rc2/src/mistralai/models/agentscompletionstreamrequest.py +92 -0
  139. mistralai-1.0.0rc2/src/mistralai/models/archiveftmodelout.py +19 -0
  140. mistralai-1.0.0rc2/src/mistralai/models/assistantmessage.py +53 -0
  141. mistralai-1.0.0rc2/src/mistralai/models/chatcompletionchoice.py +22 -0
  142. mistralai-1.0.0rc2/src/mistralai/models/chatcompletionrequest.py +109 -0
  143. mistralai-1.0.0rc2/src/mistralai/models/chatcompletionresponse.py +27 -0
  144. mistralai-1.0.0rc2/src/mistralai/models/chatcompletionstreamrequest.py +107 -0
  145. mistralai-1.0.0rc2/src/mistralai/models/checkpointout.py +25 -0
  146. mistralai-1.0.0rc2/src/mistralai/models/completionchunk.py +27 -0
  147. mistralai-1.0.0rc2/src/mistralai/models/completionevent.py +15 -0
  148. mistralai-1.0.0rc2/src/mistralai/models/completionresponsestreamchoice.py +48 -0
  149. mistralai-1.0.0rc2/src/mistralai/models/contentchunk.py +17 -0
  150. mistralai-1.0.0rc2/src/mistralai/models/delete_model_v1_models_model_id_deleteop.py +16 -0
  151. mistralai-1.0.0rc2/src/mistralai/models/deletefileout.py +24 -0
  152. mistralai-1.0.0rc2/src/mistralai/models/deletemodelout.py +25 -0
  153. mistralai-1.0.0rc2/src/mistralai/models/deltamessage.py +47 -0
  154. mistralai-1.0.0rc2/src/mistralai/models/detailedjobout.py +91 -0
  155. mistralai-1.0.0rc2/src/mistralai/models/embeddingrequest.py +61 -0
  156. mistralai-1.0.0rc2/src/mistralai/models/embeddingresponse.py +24 -0
  157. mistralai-1.0.0rc2/src/mistralai/models/embeddingresponsedata.py +19 -0
  158. mistralai-1.0.0rc2/src/mistralai/models/eventout.py +50 -0
  159. mistralai-1.0.0rc2/src/mistralai/models/files_api_routes_delete_fileop.py +16 -0
  160. mistralai-1.0.0rc2/src/mistralai/models/files_api_routes_retrieve_fileop.py +16 -0
  161. mistralai-1.0.0rc2/src/mistralai/models/files_api_routes_upload_fileop.py +51 -0
  162. mistralai-1.0.0rc2/src/mistralai/models/fileschema.py +71 -0
  163. mistralai-1.0.0rc2/src/mistralai/models/fimcompletionrequest.py +94 -0
  164. mistralai-1.0.0rc2/src/mistralai/models/fimcompletionresponse.py +27 -0
  165. mistralai-1.0.0rc2/src/mistralai/models/fimcompletionstreamrequest.py +92 -0
  166. mistralai-1.0.0rc2/src/mistralai/models/finetuneablemodel.py +8 -0
  167. mistralai-1.0.0rc2/src/mistralai/models/ftmodelcapabilitiesout.py +21 -0
  168. mistralai-1.0.0rc2/src/mistralai/models/ftmodelout.py +65 -0
  169. mistralai-1.0.0rc2/src/mistralai/models/function.py +19 -0
  170. mistralai-1.0.0rc2/src/mistralai/models/functioncall.py +16 -0
  171. mistralai-1.0.0rc2/src/mistralai/models/githubrepositoryin.py +52 -0
  172. mistralai-1.0.0rc2/src/mistralai/models/githubrepositoryout.py +52 -0
  173. mistralai-1.0.0rc2/src/mistralai/models/httpvalidationerror.py +23 -0
  174. mistralai-1.0.0rc2/src/mistralai/models/jobin.py +73 -0
  175. mistralai-1.0.0rc2/src/mistralai/models/jobmetadataout.py +54 -0
  176. mistralai-1.0.0rc2/src/mistralai/models/jobout.py +107 -0
  177. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +16 -0
  178. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py +18 -0
  179. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +68 -0
  180. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py +18 -0
  181. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +81 -0
  182. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py +16 -0
  183. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +16 -0
  184. mistralai-1.0.0rc2/src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +19 -0
  185. mistralai-1.0.0rc2/src/mistralai/models/jobsout.py +20 -0
  186. mistralai-1.0.0rc2/src/mistralai/models/legacyjobmetadataout.py +80 -0
  187. mistralai-1.0.0rc2/src/mistralai/models/listfilesout.py +17 -0
  188. mistralai-1.0.0rc2/src/mistralai/models/metricout.py +50 -0
  189. mistralai-1.0.0rc2/src/mistralai/models/modelcapabilities.py +21 -0
  190. mistralai-1.0.0rc2/src/mistralai/models/modelcard.py +66 -0
  191. mistralai-1.0.0rc2/src/mistralai/models/modellist.py +18 -0
  192. mistralai-1.0.0rc2/src/mistralai/models/responseformat.py +18 -0
  193. mistralai-1.0.0rc2/src/mistralai/models/retrieve_model_v1_models_model_id_getop.py +16 -0
  194. mistralai-1.0.0rc2/src/mistralai/models/retrievefileout.py +71 -0
  195. mistralai-1.0.0rc2/src/mistralai/models/sampletype.py +7 -0
  196. mistralai-1.0.0rc2/src/mistralai/models/sdkerror.py +22 -0
  197. mistralai-1.0.0rc2/src/mistralai/models/security.py +16 -0
  198. mistralai-1.0.0rc2/src/mistralai/models/source.py +7 -0
  199. mistralai-1.0.0rc2/src/mistralai/models/systemmessage.py +26 -0
  200. mistralai-1.0.0rc2/src/mistralai/models/textchunk.py +17 -0
  201. mistralai-1.0.0rc2/src/mistralai/models/tool.py +18 -0
  202. mistralai-1.0.0rc2/src/mistralai/models/toolcall.py +20 -0
  203. mistralai-1.0.0rc2/src/mistralai/models/toolmessage.py +50 -0
  204. mistralai-1.0.0rc2/src/mistralai/models/trainingfile.py +17 -0
  205. mistralai-1.0.0rc2/src/mistralai/models/trainingparameters.py +48 -0
  206. mistralai-1.0.0rc2/src/mistralai/models/trainingparametersin.py +56 -0
  207. mistralai-1.0.0rc2/src/mistralai/models/unarchiveftmodelout.py +19 -0
  208. mistralai-1.0.0rc2/src/mistralai/models/updateftmodelin.py +44 -0
  209. mistralai-1.0.0rc2/src/mistralai/models/uploadfileout.py +71 -0
  210. mistralai-1.0.0rc2/src/mistralai/models/usageinfo.py +18 -0
  211. mistralai-1.0.0rc2/src/mistralai/models/usermessage.py +26 -0
  212. mistralai-1.0.0rc2/src/mistralai/models/validationerror.py +24 -0
  213. mistralai-1.0.0rc2/src/mistralai/models/wandbintegration.py +56 -0
  214. mistralai-1.0.0rc2/src/mistralai/models/wandbintegrationout.py +52 -0
  215. mistralai-1.0.0rc2/src/mistralai/models_.py +928 -0
  216. mistralai-1.0.0rc2/src/mistralai/py.typed +1 -0
  217. mistralai-1.0.0rc2/src/mistralai/sdk.py +119 -0
  218. mistralai-1.0.0rc2/src/mistralai/sdkconfiguration.py +54 -0
  219. mistralai-1.0.0rc2/src/mistralai/types/__init__.py +21 -0
  220. mistralai-1.0.0rc2/src/mistralai/types/basemodel.py +39 -0
  221. mistralai-1.0.0rc2/src/mistralai/utils/__init__.py +86 -0
  222. mistralai-1.0.0rc2/src/mistralai/utils/annotations.py +19 -0
  223. mistralai-1.0.0rc2/src/mistralai/utils/enums.py +34 -0
  224. mistralai-1.0.0rc2/src/mistralai/utils/eventstreaming.py +178 -0
  225. mistralai-1.0.0rc2/src/mistralai/utils/forms.py +207 -0
  226. mistralai-1.0.0rc2/src/mistralai/utils/headers.py +136 -0
  227. mistralai-1.0.0rc2/src/mistralai/utils/logger.py +16 -0
  228. mistralai-1.0.0rc2/src/mistralai/utils/metadata.py +118 -0
  229. mistralai-1.0.0rc2/src/mistralai/utils/queryparams.py +203 -0
  230. mistralai-1.0.0rc2/src/mistralai/utils/requestbodies.py +66 -0
  231. mistralai-1.0.0rc2/src/mistralai/utils/retries.py +216 -0
  232. mistralai-1.0.0rc2/src/mistralai/utils/security.py +185 -0
  233. mistralai-1.0.0rc2/src/mistralai/utils/serializers.py +181 -0
  234. mistralai-1.0.0rc2/src/mistralai/utils/url.py +150 -0
  235. mistralai-1.0.0rc2/src/mistralai/utils/values.py +128 -0
  236. mistralai-0.4.2/PKG-INFO +0 -82
  237. mistralai-0.4.2/README.md +0 -62
  238. mistralai-0.4.2/pyproject.toml +0 -42
  239. mistralai-0.4.2/src/mistralai/__init__.py +0 -0
  240. mistralai-0.4.2/src/mistralai/async_client.py +0 -423
  241. mistralai-0.4.2/src/mistralai/client.py +0 -423
  242. mistralai-0.4.2/src/mistralai/client_base.py +0 -211
  243. mistralai-0.4.2/src/mistralai/constants.py +0 -5
  244. mistralai-0.4.2/src/mistralai/exceptions.py +0 -54
  245. mistralai-0.4.2/src/mistralai/files.py +0 -84
  246. mistralai-0.4.2/src/mistralai/jobs.py +0 -172
  247. mistralai-0.4.2/src/mistralai/models/__init__.py +0 -0
  248. mistralai-0.4.2/src/mistralai/models/chat_completion.py +0 -93
  249. mistralai-0.4.2/src/mistralai/models/common.py +0 -9
  250. mistralai-0.4.2/src/mistralai/models/embeddings.py +0 -19
  251. mistralai-0.4.2/src/mistralai/models/files.py +0 -23
  252. mistralai-0.4.2/src/mistralai/models/jobs.py +0 -100
  253. mistralai-0.4.2/src/mistralai/models/models.py +0 -39
  254. mistralai-0.4.2/src/mistralai/py.typed +0 -0
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright [yyyy] [name of copyright owner]
189
+ Copyright 2024 Mistral AI
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -0,0 +1,686 @@
1
+ Metadata-Version: 2.1
2
+ Name: mistralai
3
+ Version: 1.0.0rc2
4
+ Summary: Python Client SDK for the Mistral AI API.
5
+ Author: Mistral
6
+ Requires-Python: >=3.8,<4.0
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.8
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
+ Provides-Extra: gcp
14
+ Requires-Dist: google-auth (>=2.31.0,<3.0.0) ; extra == "gcp"
15
+ Requires-Dist: httpx (>=0.27.0,<0.28.0)
16
+ Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
17
+ Requires-Dist: pydantic (>=2.8.2,<2.9.0)
18
+ Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
19
+ Requires-Dist: requests (>=2.32.3,<3.0.0) ; extra == "gcp"
20
+ Requires-Dist: typing-inspect (>=0.9.0,<0.10.0)
21
+ Description-Content-Type: text/markdown
22
+
23
+ # mistralai
24
+
25
+ <div align="left">
26
+ <a href="https://speakeasyapi.dev/"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
27
+ </div>
28
+
29
+ ## Migration warning
30
+
31
+ This documentation is for Mistralai SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
32
+
33
+ <!-- Start SDK Installation [installation] -->
34
+ ## SDK Installation
35
+
36
+ PIP
37
+ ```bash
38
+ pip install mistralai
39
+ ```
40
+
41
+ Poetry
42
+ ```bash
43
+ poetry add mistralai
44
+ ```
45
+ <!-- End SDK Installation [installation] -->
46
+
47
+ <!-- Start SDK Example Usage [usage] -->
48
+ ## SDK Example Usage
49
+
50
+ ### Create Chat Completions
51
+
52
+ This example shows how to create chat completions.
53
+
54
+ ```python
55
+ # Synchronous Example
56
+ from mistralai import Mistral
57
+ import os
58
+
59
+ s = Mistral(
60
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
61
+ )
62
+
63
+
64
+ res = s.chat.complete(model="mistral-small-latest", messages=[
65
+ {
66
+ "content": "Who is the best French painter? Answer in one short sentence.",
67
+ "role": "user",
68
+ },
69
+ ])
70
+
71
+ if res is not None:
72
+ # handle response
73
+ pass
74
+ ```
75
+
76
+ </br>
77
+
78
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
79
+ ```python
80
+ # Asynchronous Example
81
+ import asyncio
82
+ from mistralai import Mistral
83
+ import os
84
+
85
+ async def main():
86
+ s = Mistral(
87
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
88
+ )
89
+ res = await s.chat.complete_async(model="mistral-small-latest", messages=[
90
+ {
91
+ "content": "Who is the best French painter? Answer in one short sentence.",
92
+ "role": "user",
93
+ },
94
+ ])
95
+ if res is not None:
96
+ # handle response
97
+ pass
98
+
99
+ asyncio.run(main())
100
+ ```
101
+
102
+ ### Upload a file
103
+
104
+ This example shows how to upload a file.
105
+
106
+ ```python
107
+ # Synchronous Example
108
+ from mistralai import Mistral
109
+ import os
110
+
111
+ s = Mistral(
112
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
113
+ )
114
+
115
+
116
+ res = s.files.upload(file={
117
+ "file_name": "your_file_here",
118
+ "content": open("<file_path>", "rb"),
119
+ })
120
+
121
+ if res is not None:
122
+ # handle response
123
+ pass
124
+ ```
125
+
126
+ </br>
127
+
128
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
129
+ ```python
130
+ # Asynchronous Example
131
+ import asyncio
132
+ from mistralai import Mistral
133
+ import os
134
+
135
+ async def main():
136
+ s = Mistral(
137
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
138
+ )
139
+ res = await s.files.upload_async(file={
140
+ "file_name": "your_file_here",
141
+ "content": open("<file_path>", "rb"),
142
+ })
143
+ if res is not None:
144
+ # handle response
145
+ pass
146
+
147
+ asyncio.run(main())
148
+ ```
149
+
150
+ ### Create Agents Completions
151
+
152
+ This example shows how to create agents completions.
153
+
154
+ ```python
155
+ # Synchronous Example
156
+ from mistralai import Mistral
157
+ import os
158
+
159
+ s = Mistral(
160
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
161
+ )
162
+
163
+
164
+ res = s.agents.complete(messages=[
165
+ {
166
+ "content": "Who is the best French painter? Answer in one short sentence.",
167
+ "role": "user",
168
+ },
169
+ ], agent_id="<value>")
170
+
171
+ if res is not None:
172
+ # handle response
173
+ pass
174
+ ```
175
+
176
+ </br>
177
+
178
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
179
+ ```python
180
+ # Asynchronous Example
181
+ import asyncio
182
+ from mistralai import Mistral
183
+ import os
184
+
185
+ async def main():
186
+ s = Mistral(
187
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
188
+ )
189
+ res = await s.agents.complete_async(messages=[
190
+ {
191
+ "content": "Who is the best French painter? Answer in one short sentence.",
192
+ "role": "user",
193
+ },
194
+ ], agent_id="<value>")
195
+ if res is not None:
196
+ # handle response
197
+ pass
198
+
199
+ asyncio.run(main())
200
+ ```
201
+ <!-- End SDK Example Usage [usage] -->
202
+
203
+ ## Providers' SDKs Example Usage
204
+
205
+ ### Azure AI
206
+
207
+ **Prerequisites**
208
+
209
+ 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.
210
+ See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/).
211
+
212
+ Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure).
213
+
214
+ ```python
215
+ import asyncio
216
+ import os
217
+
218
+ from mistralai_azure import MistralAzure
219
+
220
+ client = MistralAzure(
221
+ azure_api_key=os.getenv("AZURE_API_KEY", ""),
222
+ azure_endpoint=os.getenv("AZURE_ENDPOINT", "")
223
+ )
224
+
225
+ async def main() -> None:
226
+ res = await client.chat.complete_async(
227
+ max_tokens= 100,
228
+ temperature= 0.5,
229
+ messages= [
230
+ {
231
+ "content": "Hello there!",
232
+ "role": "user"
233
+ }
234
+ ]
235
+ )
236
+ print(res)
237
+
238
+ asyncio.run(main())
239
+ ```
240
+ The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md).
241
+
242
+ ### Google Cloud
243
+
244
+
245
+ **Prerequisites**
246
+
247
+ Before you begin, you will need to create a Google Cloud project and enable the Mistral API. To do this, follow the instructions [here](https://docs.mistral.ai/deployment/cloud/vertex/).
248
+
249
+ To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running
250
+
251
+ ```bash
252
+ gcloud auth application-default login
253
+ ```
254
+
255
+ **Step 1: Install**
256
+
257
+ Install the extras dependencies specific to Google Cloud:
258
+
259
+ ```bash
260
+ pip install mistralai[gcp]
261
+ ```
262
+
263
+ **Step 2: Example Usage**
264
+
265
+ Here's a basic example to get you started.
266
+
267
+ ```python
268
+ import asyncio
269
+ from mistralai_gcp import MistralGoogleCloud
270
+
271
+ client = MistralGoogleCloud()
272
+
273
+
274
+ async def main() -> None:
275
+ res = await client.chat.complete_async(
276
+ model= "mistral-small-2402",
277
+ messages= [
278
+ {
279
+ "content": "Hello there!",
280
+ "role": "user"
281
+ }
282
+ ]
283
+ )
284
+ print(res)
285
+
286
+ asyncio.run(main())
287
+ ```
288
+
289
+ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md).
290
+
291
+
292
+ <!-- Start Available Resources and Operations [operations] -->
293
+ ## Available Resources and Operations
294
+
295
+ ### [models](docs/sdks/models/README.md)
296
+
297
+ * [list](docs/sdks/models/README.md#list) - List Models
298
+ * [retrieve](docs/sdks/models/README.md#retrieve) - Retrieve Model
299
+ * [delete](docs/sdks/models/README.md#delete) - Delete Model
300
+ * [update](docs/sdks/models/README.md#update) - Update Fine Tuned Model
301
+ * [archive](docs/sdks/models/README.md#archive) - Archive Fine Tuned Model
302
+ * [unarchive](docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model
303
+
304
+ ### [files](docs/sdks/files/README.md)
305
+
306
+ * [upload](docs/sdks/files/README.md#upload) - Upload File
307
+ * [list](docs/sdks/files/README.md#list) - List Files
308
+ * [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File
309
+ * [delete](docs/sdks/files/README.md#delete) - Delete File
310
+
311
+
312
+ ### [fine_tuning.jobs](docs/sdks/jobs/README.md)
313
+
314
+ * [list](docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs
315
+ * [create](docs/sdks/jobs/README.md#create) - Create Fine Tuning Job
316
+ * [get](docs/sdks/jobs/README.md#get) - Get Fine Tuning Job
317
+ * [cancel](docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job
318
+ * [start](docs/sdks/jobs/README.md#start) - Start Fine Tuning Job
319
+
320
+ ### [chat](docs/sdks/chat/README.md)
321
+
322
+ * [complete](docs/sdks/chat/README.md#complete) - Chat Completion
323
+ * [stream](docs/sdks/chat/README.md#stream) - Stream chat completion
324
+
325
+ ### [fim](docs/sdks/fim/README.md)
326
+
327
+ * [complete](docs/sdks/fim/README.md#complete) - Fim Completion
328
+ * [stream](docs/sdks/fim/README.md#stream) - Stream fim completion
329
+
330
+ ### [agents](docs/sdks/agents/README.md)
331
+
332
+ * [complete](docs/sdks/agents/README.md#complete) - Chat Completion
333
+ * [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion
334
+
335
+ ### [embeddings](docs/sdks/embeddings/README.md)
336
+
337
+ * [create](docs/sdks/embeddings/README.md#create) - Embeddings
338
+ <!-- End Available Resources and Operations [operations] -->
339
+
340
+ <!-- Start Server-sent event streaming [eventstream] -->
341
+ ## Server-sent event streaming
342
+
343
+ [Server-sent events][mdn-sse] are used to stream content from certain
344
+ operations. These operations will expose the stream as [Generator][generator] that
345
+ can be consumed using a simple `for` loop. The loop will
346
+ terminate when the server no longer has any events to send and closes the
347
+ underlying connection.
348
+
349
+ ```python
350
+ from mistralai import Mistral
351
+ import os
352
+
353
+ s = Mistral(
354
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
355
+ )
356
+
357
+
358
+ res = s.chat.stream(model="mistral-small-latest", messages=[
359
+ {
360
+ "content": "Who is the best French painter? Answer in one short sentence.",
361
+ "role": "user",
362
+ },
363
+ ])
364
+
365
+ if res is not None:
366
+ for event in res:
367
+ # handle event
368
+ print(event, flush=True)
369
+
370
+ ```
371
+
372
+ [mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
373
+ [generator]: https://wiki.python.org/moin/Generators
374
+ <!-- End Server-sent event streaming [eventstream] -->
375
+
376
+ <!-- Start File uploads [file-upload] -->
377
+ ## File uploads
378
+
379
+ Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
380
+
381
+ > [!TIP]
382
+ >
383
+ > For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files.
384
+ >
385
+
386
+ ```python
387
+ from mistralai import Mistral
388
+ import os
389
+
390
+ s = Mistral(
391
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
392
+ )
393
+
394
+
395
+ res = s.files.upload(file={
396
+ "file_name": "your_file_here",
397
+ "content": open("<file_path>", "rb"),
398
+ })
399
+
400
+ if res is not None:
401
+ # handle response
402
+ pass
403
+
404
+ ```
405
+ <!-- End File uploads [file-upload] -->
406
+
407
+ <!-- Start Retries [retries] -->
408
+ ## Retries
409
+
410
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
411
+
412
+ To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
413
+ ```python
414
+ from mistral.utils import BackoffStrategy, RetryConfig
415
+ from mistralai import Mistral
416
+ import os
417
+
418
+ s = Mistral(
419
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
420
+ )
421
+
422
+
423
+ res = s.models.list(,
424
+ RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
425
+
426
+ if res is not None:
427
+ # handle response
428
+ pass
429
+
430
+ ```
431
+
432
+ If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
433
+ ```python
434
+ from mistral.utils import BackoffStrategy, RetryConfig
435
+ from mistralai import Mistral
436
+ import os
437
+
438
+ s = Mistral(
439
+ retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
440
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
441
+ )
442
+
443
+
444
+ res = s.models.list()
445
+
446
+ if res is not None:
447
+ # handle response
448
+ pass
449
+
450
+ ```
451
+ <!-- End Retries [retries] -->
452
+
453
+ <!-- Start Error Handling [errors] -->
454
+ ## Error Handling
455
+
456
+ Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
457
+
458
+ | Error Object | Status Code | Content Type |
459
+ | -------------------------- | -------------------------- | -------------------------- |
460
+ | models.HTTPValidationError | 422 | application/json |
461
+ | models.SDKError | 4xx-5xx | */* |
462
+
463
+ ### Example
464
+
465
+ ```python
466
+ from mistralai import Mistral, models
467
+ import os
468
+
469
+ s = Mistral(
470
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
471
+ )
472
+
473
+ res = None
474
+ try:
475
+ res = s.models.list()
476
+
477
+ except models.HTTPValidationError as e:
478
+ # handle exception
479
+ raise(e)
480
+ except models.SDKError as e:
481
+ # handle exception
482
+ raise(e)
483
+
484
+ if res is not None:
485
+ # handle response
486
+ pass
487
+
488
+ ```
489
+ <!-- End Error Handling [errors] -->
490
+
491
+ <!-- Start Server Selection [server] -->
492
+ ## Server Selection
493
+
494
+ ### Select Server by Name
495
+
496
+ You can override the default server globally by passing a server name to the `server: str` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
497
+
498
+ | Name | Server | Variables |
499
+ | ----- | ------ | --------- |
500
+ | `prod` | `https://api.mistral.ai` | None |
501
+
502
+ #### Example
503
+
504
+ ```python
505
+ from mistralai import Mistral
506
+ import os
507
+
508
+ s = Mistral(
509
+ server="prod",
510
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
511
+ )
512
+
513
+
514
+ res = s.models.list()
515
+
516
+ if res is not None:
517
+ # handle response
518
+ pass
519
+
520
+ ```
521
+
522
+
523
+ ### Override Server URL Per-Client
524
+
525
+ The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
526
+ ```python
527
+ from mistralai import Mistral
528
+ import os
529
+
530
+ s = Mistral(
531
+ server_url="https://api.mistral.ai",
532
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
533
+ )
534
+
535
+
536
+ res = s.models.list()
537
+
538
+ if res is not None:
539
+ # handle response
540
+ pass
541
+
542
+ ```
543
+ <!-- End Server Selection [server] -->
544
+
545
+ <!-- Start Custom HTTP Client [http-client] -->
546
+ ## Custom HTTP Client
547
+
548
+ The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance.
549
+ Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls.
550
+ This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly.
551
+
552
+ For example, you could specify a header for every request that this sdk makes as follows:
553
+ ```python
554
+ from mistralai import Mistral
555
+ import httpx
556
+
557
+ http_client = httpx.Client(headers={"x-custom-header": "someValue"})
558
+ s = Mistral(client=http_client)
559
+ ```
560
+
561
+ or you could wrap the client with your own custom logic:
562
+ ```python
563
+ from mistralai import Mistral
564
+ from mistralai.httpclient import AsyncHttpClient
565
+ import httpx
566
+
567
+ class CustomClient(AsyncHttpClient):
568
+ client: AsyncHttpClient
569
+
570
+ def __init__(self, client: AsyncHttpClient):
571
+ self.client = client
572
+
573
+ async def send(
574
+ self,
575
+ request: httpx.Request,
576
+ *,
577
+ stream: bool = False,
578
+ auth: Union[
579
+ httpx._types.AuthTypes, httpx._client.UseClientDefault, None
580
+ ] = httpx.USE_CLIENT_DEFAULT,
581
+ follow_redirects: Union[
582
+ bool, httpx._client.UseClientDefault
583
+ ] = httpx.USE_CLIENT_DEFAULT,
584
+ ) -> httpx.Response:
585
+ request.headers["Client-Level-Header"] = "added by client"
586
+
587
+ return await self.client.send(
588
+ request, stream=stream, auth=auth, follow_redirects=follow_redirects
589
+ )
590
+
591
+ def build_request(
592
+ self,
593
+ method: str,
594
+ url: httpx._types.URLTypes,
595
+ *,
596
+ content: Optional[httpx._types.RequestContent] = None,
597
+ data: Optional[httpx._types.RequestData] = None,
598
+ files: Optional[httpx._types.RequestFiles] = None,
599
+ json: Optional[Any] = None,
600
+ params: Optional[httpx._types.QueryParamTypes] = None,
601
+ headers: Optional[httpx._types.HeaderTypes] = None,
602
+ cookies: Optional[httpx._types.CookieTypes] = None,
603
+ timeout: Union[
604
+ httpx._types.TimeoutTypes, httpx._client.UseClientDefault
605
+ ] = httpx.USE_CLIENT_DEFAULT,
606
+ extensions: Optional[httpx._types.RequestExtensions] = None,
607
+ ) -> httpx.Request:
608
+ return self.client.build_request(
609
+ method,
610
+ url,
611
+ content=content,
612
+ data=data,
613
+ files=files,
614
+ json=json,
615
+ params=params,
616
+ headers=headers,
617
+ cookies=cookies,
618
+ timeout=timeout,
619
+ extensions=extensions,
620
+ )
621
+
622
+ s = Mistral(async_client=CustomClient(httpx.AsyncClient()))
623
+ ```
624
+ <!-- End Custom HTTP Client [http-client] -->
625
+
626
+ <!-- Start Authentication [security] -->
627
+ ## Authentication
628
+
629
+ ### Per-Client Security Schemes
630
+
631
+ This SDK supports the following security scheme globally:
632
+
633
+ | Name | Type | Scheme | Environment Variable |
634
+ | -------------------- | -------------------- | -------------------- | -------------------- |
635
+ | `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` |
636
+
637
+ To authenticate with the API the `null` parameter must be set when initializing the SDK client instance. For example:
638
+ ```python
639
+ from mistralai import Mistral
640
+ import os
641
+
642
+ s = Mistral(
643
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
644
+ )
645
+
646
+
647
+ res = s.models.list()
648
+
649
+ if res is not None:
650
+ # handle response
651
+ pass
652
+
653
+ ```
654
+ <!-- End Authentication [security] -->
655
+
656
+ <!-- Start Debugging [debug] -->
657
+ ## Debugging
658
+
659
+ To emit debug logs for SDK requests and responses you can pass a logger object directly into your SDK object.
660
+
661
+ ```python
662
+ from mistralai import Mistral
663
+ import logging
664
+
665
+ logging.basicConfig(level=logging.DEBUG)
666
+ s = Mistral(debug_logger=logging.getLogger("mistralai"))
667
+ ```
668
+ <!-- End Debugging [debug] -->
669
+
670
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
671
+
672
+ # Development
673
+
674
+ ## Maturity
675
+
676
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
677
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
678
+ looking for the latest version.
679
+
680
+ ## Contributions
681
+
682
+ While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
683
+ We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
684
+
685
+ ### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
686
+