mistralai 0.5.5a50__tar.gz → 1.0.0__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 (240) hide show
  1. {mistralai-0.5.5a50 → mistralai-1.0.0}/PKG-INFO +136 -67
  2. {mistralai-0.5.5a50 → mistralai-1.0.0}/README.md +135 -66
  3. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/basesdk.py +42 -4
  4. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/chat.py +15 -20
  5. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/__init__.py +3 -3
  6. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py +4 -9
  7. mistralai-1.0.0/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +22 -0
  8. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py +7 -12
  9. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py +7 -12
  10. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py +4 -9
  11. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py +4 -9
  12. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py +9 -3
  13. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py +1 -1
  14. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py +4 -9
  15. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/sdk.py +7 -2
  16. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py +5 -4
  17. {mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp → mistralai-1.0.0/packages/mistralai_azure/src/mistralai_azure}/types/basemodel.py +10 -6
  18. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py +4 -0
  19. {mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp → mistralai-1.0.0/packages/mistralai_azure/src/mistralai_azure}/utils/eventstreaming.py +8 -9
  20. mistralai-1.0.0/packages/mistralai_azure/src/mistralai_azure/utils/logger.py +16 -0
  21. {mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp → mistralai-1.0.0/packages/mistralai_azure/src/mistralai_azure}/utils/retries.py +2 -2
  22. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py +42 -4
  23. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/chat.py +12 -17
  24. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/fim.py +12 -13
  25. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py +3 -3
  26. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py +4 -9
  27. mistralai-1.0.0/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +22 -0
  28. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py +9 -14
  29. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py +9 -14
  30. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py +4 -9
  31. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py +4 -9
  32. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py +11 -16
  33. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py +11 -16
  34. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py +9 -3
  35. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py +1 -1
  36. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py +4 -9
  37. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/sdk.py +9 -0
  38. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py +5 -4
  39. {mistralai-0.5.5a50/src/mistralai → mistralai-1.0.0/packages/mistralai_gcp/src/mistralai_gcp}/types/basemodel.py +10 -6
  40. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py +4 -0
  41. {mistralai-0.5.5a50/src/mistralai → mistralai-1.0.0/packages/mistralai_gcp/src/mistralai_gcp}/utils/eventstreaming.py +8 -9
  42. mistralai-1.0.0/packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py +16 -0
  43. {mistralai-0.5.5a50/src/mistralai → mistralai-1.0.0/packages/mistralai_gcp/src/mistralai_gcp}/utils/retries.py +2 -2
  44. {mistralai-0.5.5a50 → mistralai-1.0.0}/pyproject.toml +1 -1
  45. mistralai-1.0.0/src/mistralai/agents.py +434 -0
  46. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/basesdk.py +43 -6
  47. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/chat.py +29 -34
  48. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/client.py +1 -1
  49. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/embeddings.py +4 -4
  50. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/files.py +10 -10
  51. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/fim.py +17 -18
  52. mistralai-1.0.0/src/mistralai/fine_tuning.py +16 -0
  53. mistralai-0.5.5a50/src/mistralai/fine_tuning.py → mistralai-1.0.0/src/mistralai/jobs.py +43 -54
  54. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/__init__.py +6 -4
  55. mistralai-1.0.0/src/mistralai/models/agentscompletionrequest.py +96 -0
  56. mistralai-1.0.0/src/mistralai/models/agentscompletionstreamrequest.py +92 -0
  57. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/assistantmessage.py +4 -9
  58. mistralai-1.0.0/src/mistralai/models/chatcompletionchoice.py +22 -0
  59. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/chatcompletionrequest.py +11 -16
  60. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/chatcompletionstreamrequest.py +11 -16
  61. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/completionresponsestreamchoice.py +4 -9
  62. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/delete_model_v1_models_model_id_deleteop.py +2 -0
  63. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/deltamessage.py +4 -9
  64. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/detailedjobout.py +4 -9
  65. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/embeddingrequest.py +4 -9
  66. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/eventout.py +4 -9
  67. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/fileschema.py +4 -9
  68. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/fimcompletionrequest.py +11 -16
  69. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/fimcompletionstreamrequest.py +11 -16
  70. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/ftmodelout.py +4 -9
  71. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/functioncall.py +9 -3
  72. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/githubrepositoryin.py +4 -9
  73. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/githubrepositoryout.py +4 -9
  74. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/httpvalidationerror.py +1 -1
  75. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobin.py +4 -9
  76. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobmetadataout.py +4 -9
  77. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobout.py +4 -9
  78. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +2 -0
  79. mistralai-1.0.0/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +15 -0
  80. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +4 -9
  81. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +2 -0
  82. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +2 -0
  83. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/legacyjobmetadataout.py +4 -9
  84. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/metricout.py +4 -9
  85. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/modelcard.py +4 -9
  86. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/retrieve_model_v1_models_model_id_getop.py +2 -0
  87. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/retrievefileout.py +4 -9
  88. mistralai-1.0.0/src/mistralai/models/security.py +16 -0
  89. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/toolmessage.py +4 -9
  90. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/trainingparameters.py +4 -9
  91. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/trainingparametersin.py +4 -9
  92. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/updateftmodelin.py +4 -9
  93. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/uploadfileout.py +4 -9
  94. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/wandbintegration.py +4 -9
  95. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/wandbintegrationout.py +4 -9
  96. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models_.py +24 -24
  97. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/sdk.py +14 -6
  98. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/sdkconfiguration.py +5 -4
  99. {mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure → mistralai-1.0.0/src/mistralai}/types/basemodel.py +10 -6
  100. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/__init__.py +4 -0
  101. {mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure → mistralai-1.0.0/src/mistralai}/utils/eventstreaming.py +8 -9
  102. mistralai-1.0.0/src/mistralai/utils/logger.py +16 -0
  103. {mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure → mistralai-1.0.0/src/mistralai}/utils/retries.py +2 -2
  104. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/security.py +5 -2
  105. mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +0 -33
  106. mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +0 -33
  107. mistralai-0.5.5a50/src/mistralai/models/chatcompletionchoice.py +0 -33
  108. mistralai-0.5.5a50/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +0 -73
  109. mistralai-0.5.5a50/src/mistralai/models/security.py +0 -16
  110. {mistralai-0.5.5a50 → mistralai-1.0.0}/LICENSE +0 -0
  111. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/__init__.py +0 -0
  112. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py +0 -0
  113. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py +0 -0
  114. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py +0 -0
  115. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py +0 -0
  116. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py +0 -0
  117. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/httpclient.py +0 -0
  118. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py +0 -0
  119. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py +0 -0
  120. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py +0 -0
  121. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py +0 -0
  122. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/function.py +0 -0
  123. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py +0 -0
  124. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py +0 -0
  125. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/security.py +0 -0
  126. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py +0 -0
  127. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py +0 -0
  128. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/tool.py +0 -0
  129. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py +0 -0
  130. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py +0 -0
  131. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py +0 -0
  132. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py +0 -0
  133. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/py.typed +0 -0
  134. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/types/__init__.py +0 -0
  135. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py +0 -0
  136. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/enums.py +0 -0
  137. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/forms.py +0 -0
  138. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/headers.py +0 -0
  139. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/metadata.py +0 -0
  140. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py +0 -0
  141. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py +0 -0
  142. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/security.py +0 -0
  143. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py +0 -0
  144. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/url.py +0 -0
  145. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_azure/src/mistralai_azure/utils/values.py +0 -0
  146. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/__init__.py +0 -0
  147. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py +0 -0
  148. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py +0 -0
  149. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py +0 -0
  150. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py +0 -0
  151. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py +0 -0
  152. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/httpclient.py +0 -0
  153. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py +0 -0
  154. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py +0 -0
  155. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py +0 -0
  156. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py +0 -0
  157. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py +0 -0
  158. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/function.py +0 -0
  159. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py +0 -0
  160. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py +0 -0
  161. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/security.py +0 -0
  162. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py +0 -0
  163. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py +0 -0
  164. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py +0 -0
  165. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py +0 -0
  166. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py +0 -0
  167. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py +0 -0
  168. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py +0 -0
  169. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/py.typed +0 -0
  170. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py +0 -0
  171. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py +0 -0
  172. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py +0 -0
  173. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py +0 -0
  174. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py +0 -0
  175. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py +0 -0
  176. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py +0 -0
  177. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py +0 -0
  178. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py +0 -0
  179. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py +0 -0
  180. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/url.py +0 -0
  181. {mistralai-0.5.5a50 → mistralai-1.0.0}/packages/mistralai_gcp/src/mistralai_gcp/utils/values.py +0 -0
  182. {mistralai-0.5.5a50 → mistralai-1.0.0}/py.typed +0 -0
  183. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/__init__.py +0 -0
  184. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/_hooks/__init__.py +0 -0
  185. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/_hooks/custom_user_agent.py +0 -0
  186. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/_hooks/deprecation_warning.py +0 -0
  187. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/_hooks/registration.py +0 -0
  188. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/_hooks/sdkhooks.py +0 -0
  189. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/_hooks/types.py +0 -0
  190. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/async_client.py +0 -0
  191. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/httpclient.py +0 -0
  192. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/archiveftmodelout.py +0 -0
  193. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/chatcompletionresponse.py +0 -0
  194. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/checkpointout.py +0 -0
  195. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/completionchunk.py +0 -0
  196. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/completionevent.py +0 -0
  197. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/contentchunk.py +0 -0
  198. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/deletefileout.py +0 -0
  199. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/deletemodelout.py +0 -0
  200. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/embeddingresponse.py +0 -0
  201. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/embeddingresponsedata.py +0 -0
  202. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/files_api_routes_delete_fileop.py +0 -0
  203. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/files_api_routes_retrieve_fileop.py +0 -0
  204. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/files_api_routes_upload_fileop.py +0 -0
  205. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/fimcompletionresponse.py +0 -0
  206. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/finetuneablemodel.py +0 -0
  207. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/ftmodelcapabilitiesout.py +0 -0
  208. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/function.py +0 -0
  209. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py +0 -0
  210. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py +0 -0
  211. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py +0 -0
  212. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/jobsout.py +0 -0
  213. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/listfilesout.py +0 -0
  214. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/modelcapabilities.py +0 -0
  215. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/modellist.py +0 -0
  216. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/responseformat.py +0 -0
  217. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/sampletype.py +0 -0
  218. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/sdkerror.py +0 -0
  219. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/source.py +0 -0
  220. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/systemmessage.py +0 -0
  221. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/textchunk.py +0 -0
  222. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/tool.py +0 -0
  223. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/toolcall.py +0 -0
  224. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/trainingfile.py +0 -0
  225. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/unarchiveftmodelout.py +0 -0
  226. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/usageinfo.py +0 -0
  227. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/usermessage.py +0 -0
  228. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/models/validationerror.py +0 -0
  229. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/py.typed +0 -0
  230. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/types/__init__.py +0 -0
  231. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/annotations.py +0 -0
  232. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/enums.py +0 -0
  233. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/forms.py +0 -0
  234. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/headers.py +0 -0
  235. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/metadata.py +0 -0
  236. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/queryparams.py +0 -0
  237. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/requestbodies.py +0 -0
  238. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/serializers.py +0 -0
  239. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/url.py +0 -0
  240. {mistralai-0.5.5a50 → mistralai-1.0.0}/src/mistralai/utils/values.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mistralai
3
- Version: 0.5.5a50
3
+ Version: 1.0.0
4
4
  Summary: Python Client SDK for the Mistral AI API.
5
5
  Author: Mistral
6
6
  Requires-Python: >=3.8,<4.0
@@ -20,16 +20,26 @@ Requires-Dist: requests (>=2.32.3,<3.0.0) ; extra == "gcp"
20
20
  Requires-Dist: typing-inspect (>=0.9.0,<0.10.0)
21
21
  Description-Content-Type: text/markdown
22
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>
23
+ # Mistral Python Client
28
24
 
29
25
  ## Migration warning
30
26
 
31
- TODO: provide more details
32
- This documentation is for Mistralai SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
27
+ This documentation is for Mistral AI SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
28
+
29
+ ## API Key Setup
30
+
31
+ Before you begin, you will need a Mistral AI API key.
32
+
33
+ 1. Get your own Mistral API Key: <https://docs.mistral.ai/#api-access>
34
+ 2. Set your Mistral API Key as an environment variable. You only need to do this once.
35
+
36
+ ```bash
37
+ # set Mistral API Key (using zsh for example)
38
+ $ echo 'export MISTRAL_API_KEY=[your_key_here]' >> ~/.zshenv
39
+
40
+ # reload the environment (or just quit and open a new terminal)
41
+ $ source ~/.zshenv
42
+ ```
33
43
 
34
44
  <!-- Start SDK Installation [installation] -->
35
45
  ## SDK Installation
@@ -62,12 +72,12 @@ s = Mistral(
62
72
  )
63
73
 
64
74
 
65
- res = s.chat.create(messages=[
75
+ res = s.chat.complete(model="mistral-small-latest", messages=[
66
76
  {
67
77
  "content": "Who is the best French painter? Answer in one short sentence.",
68
78
  "role": "user",
69
79
  },
70
- ], model="mistral-small-latest")
80
+ ])
71
81
 
72
82
  if res is not None:
73
83
  # handle response
@@ -87,12 +97,12 @@ async def main():
87
97
  s = Mistral(
88
98
  api_key=os.getenv("MISTRAL_API_KEY", ""),
89
99
  )
90
- res = await s.chat.create_async(messages=[
100
+ res = await s.chat.complete_async(model="mistral-small-latest", messages=[
91
101
  {
92
102
  "content": "Who is the best French painter? Answer in one short sentence.",
93
103
  "role": "user",
94
104
  },
95
- ], model="mistral-small-latest")
105
+ ])
96
106
  if res is not None:
97
107
  # handle response
98
108
  pass
@@ -145,19 +155,78 @@ async def main():
145
155
  # handle response
146
156
  pass
147
157
 
158
+ asyncio.run(main())
159
+ ```
160
+
161
+ ### Create Agents Completions
162
+
163
+ This example shows how to create agents completions.
164
+
165
+ ```python
166
+ # Synchronous Example
167
+ from mistralai import Mistral
168
+ import os
169
+
170
+ s = Mistral(
171
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
172
+ )
173
+
174
+
175
+ res = s.agents.complete(messages=[
176
+ {
177
+ "content": "Who is the best French painter? Answer in one short sentence.",
178
+ "role": "user",
179
+ },
180
+ ], agent_id="<value>")
181
+
182
+ if res is not None:
183
+ # handle response
184
+ pass
185
+ ```
186
+
187
+ </br>
188
+
189
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
190
+ ```python
191
+ # Asynchronous Example
192
+ import asyncio
193
+ from mistralai import Mistral
194
+ import os
195
+
196
+ async def main():
197
+ s = Mistral(
198
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
199
+ )
200
+ res = await s.agents.complete_async(messages=[
201
+ {
202
+ "content": "Who is the best French painter? Answer in one short sentence.",
203
+ "role": "user",
204
+ },
205
+ ], agent_id="<value>")
206
+ if res is not None:
207
+ # handle response
208
+ pass
209
+
148
210
  asyncio.run(main())
149
211
  ```
150
212
  <!-- End SDK Example Usage [usage] -->
151
213
 
152
- ### Azure AI
153
214
 
154
- TODO ADJUST LINKS
215
+ ### More examples
216
+
217
+ You can run the examples in the `examples/` directory using `poetry run` or by entering the virtual environment using `poetry shell`.
218
+
219
+
220
+ ## Providers' SDKs Example Usage
221
+
222
+ ### Azure AI
155
223
 
156
224
  **Prerequisites**
225
+
157
226
  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.
158
227
  See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/).
159
228
 
160
- Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure.py).
229
+ Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure).
161
230
 
162
231
  ```python
163
232
  import asyncio
@@ -167,35 +236,32 @@ from mistralai_azure import MistralAzure
167
236
 
168
237
  client = MistralAzure(
169
238
  azure_api_key=os.getenv("AZURE_API_KEY", ""),
170
- azure_endpoint="your_azure_endpoint"
239
+ azure_endpoint=os.getenv("AZURE_ENDPOINT", "")
171
240
  )
172
241
 
173
242
  async def main() -> None:
174
- res = await client.chat.create_async(
175
- request={
176
- "max_tokens": 100,
177
- "temperature": 0.5,
178
- "messages": [
179
- {
180
- "content": "Hello there!",
181
- "role": "user"
182
- }
183
- ]
184
- }
243
+ res = await client.chat.complete_async(
244
+ max_tokens= 100,
245
+ temperature= 0.5,
246
+ messages= [
247
+ {
248
+ "content": "Hello there!",
249
+ "role": "user"
250
+ }
251
+ ]
185
252
  )
186
253
  print(res)
187
254
 
188
255
  asyncio.run(main())
189
256
  ```
190
- The documentation for the Azure SDK is available [GCP](packages/mistralai-azure/README.md).
257
+ The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md).
191
258
 
192
259
  ### Google Cloud
193
260
 
194
- TODO ADJUST LINKS
195
261
 
196
262
  **Prerequisites**
197
263
 
198
- 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/google/).
264
+ 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/).
199
265
 
200
266
  To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running
201
267
 
@@ -223,23 +289,21 @@ client = MistralGoogleCloud()
223
289
 
224
290
 
225
291
  async def main() -> None:
226
- res = await client.chat.create_async(
227
- request={
228
- "model": "mistral-small-2402",
229
- "messages": [
230
- {
231
- "content": "Hello there!",
232
- "role": "user"
233
- }
234
- ]
235
- }
292
+ res = await client.chat.complete_async(
293
+ model= "mistral-small-2402",
294
+ messages= [
295
+ {
296
+ "content": "Hello there!",
297
+ "role": "user"
298
+ }
299
+ ]
236
300
  )
237
301
  print(res)
238
302
 
239
303
  asyncio.run(main())
240
304
  ```
241
305
 
242
- The documentation for the GCP SDK is available [GCP](packages/mistralai_gcp/README.md).
306
+ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md).
243
307
 
244
308
 
245
309
  <!-- Start Available Resources and Operations [operations] -->
@@ -261,24 +325,30 @@ The documentation for the GCP SDK is available [GCP](packages/mistralai_gcp/READ
261
325
  * [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File
262
326
  * [delete](docs/sdks/files/README.md#delete) - Delete File
263
327
 
264
- ### [fine_tuning](docs/sdks/finetuning/README.md)
265
328
 
266
- * [list_jobs](docs/sdks/finetuning/README.md#list_jobs) - Get Fine Tuning Jobs
267
- * [create_job](docs/sdks/finetuning/README.md#create_job) - Create Fine Tuning Job
268
- * [get_job](docs/sdks/finetuning/README.md#get_job) - Get Fine Tuning Job
269
- * [cancel_job](docs/sdks/finetuning/README.md#cancel_job) - Cancel Fine Tuning Job
270
- * [start_job](docs/sdks/finetuning/README.md#start_job) - Start Fine Tuning Job
329
+ ### [fine_tuning.jobs](docs/sdks/jobs/README.md)
330
+
331
+ * [list](docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs
332
+ * [create](docs/sdks/jobs/README.md#create) - Create Fine Tuning Job
333
+ * [get](docs/sdks/jobs/README.md#get) - Get Fine Tuning Job
334
+ * [cancel](docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job
335
+ * [start](docs/sdks/jobs/README.md#start) - Start Fine Tuning Job
271
336
 
272
337
  ### [chat](docs/sdks/chat/README.md)
273
338
 
274
- * [create](docs/sdks/chat/README.md#create) - Chat Completion
339
+ * [complete](docs/sdks/chat/README.md#complete) - Chat Completion
275
340
  * [stream](docs/sdks/chat/README.md#stream) - Stream chat completion
276
341
 
277
342
  ### [fim](docs/sdks/fim/README.md)
278
343
 
279
- * [create](docs/sdks/fim/README.md#create) - Fim Completion
344
+ * [complete](docs/sdks/fim/README.md#complete) - Fim Completion
280
345
  * [stream](docs/sdks/fim/README.md#stream) - Stream fim completion
281
346
 
347
+ ### [agents](docs/sdks/agents/README.md)
348
+
349
+ * [complete](docs/sdks/agents/README.md#complete) - Agents Completion
350
+ * [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion
351
+
282
352
  ### [embeddings](docs/sdks/embeddings/README.md)
283
353
 
284
354
  * [create](docs/sdks/embeddings/README.md#create) - Embeddings
@@ -302,12 +372,12 @@ s = Mistral(
302
372
  )
303
373
 
304
374
 
305
- res = s.chat.stream(messages=[
375
+ res = s.chat.stream(model="mistral-small-latest", messages=[
306
376
  {
307
377
  "content": "Who is the best French painter? Answer in one short sentence.",
308
378
  "role": "user",
309
379
  },
310
- ], model="mistral-small-latest")
380
+ ])
311
381
 
312
382
  if res is not None:
313
383
  for event in res:
@@ -577,11 +647,11 @@ s = Mistral(async_client=CustomClient(httpx.AsyncClient()))
577
647
 
578
648
  This SDK supports the following security scheme globally:
579
649
 
580
- | Name | Type | Scheme |
581
- | ----------- | ----------- | ----------- |
582
- | `api_key` | http | HTTP Bearer |
650
+ | Name | Type | Scheme | Environment Variable |
651
+ | -------------------- | -------------------- | -------------------- | -------------------- |
652
+ | `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` |
583
653
 
584
- To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example:
654
+ To authenticate with the API the `null` parameter must be set when initializing the SDK client instance. For example:
585
655
  ```python
586
656
  from mistralai import Mistral
587
657
  import os
@@ -599,28 +669,27 @@ if res is not None:
599
669
 
600
670
  ```
601
671
  <!-- End Authentication [security] -->
602
- ## Providers Support
603
672
 
604
- We also provide provider specific SDK for:
673
+ <!-- Start Debugging [debug] -->
674
+ ## Debugging
675
+
676
+ To emit debug logs for SDK requests and responses you can pass a logger object directly into your SDK object.
605
677
 
606
- - [GCP](packages/mistralai_gcp/README.md)
607
- - [Azure](packages/mistralai_azure/README.md)
678
+ ```python
679
+ from mistralai import Mistral
680
+ import logging
608
681
 
682
+ logging.basicConfig(level=logging.DEBUG)
683
+ s = Mistral(debug_logger=logging.getLogger("mistralai"))
684
+ ```
685
+ <!-- End Debugging [debug] -->
609
686
 
610
687
  <!-- Placeholder for Future Speakeasy SDK Sections -->
611
688
 
612
689
  # Development
613
690
 
614
- ## Maturity
615
-
616
- This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
617
- to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
618
- looking for the latest version.
619
-
620
691
  ## Contributions
621
692
 
622
693
  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.
623
694
  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.
624
695
 
625
- ### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
626
-
@@ -1,13 +1,23 @@
1
- # mistralai
2
-
3
- <div align="left">
4
- <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>
5
- </div>
1
+ # Mistral Python Client
6
2
 
7
3
  ## Migration warning
8
4
 
9
- TODO: provide more details
10
- This documentation is for Mistralai SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
5
+ This documentation is for Mistral AI SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
6
+
7
+ ## API Key Setup
8
+
9
+ Before you begin, you will need a Mistral AI API key.
10
+
11
+ 1. Get your own Mistral API Key: <https://docs.mistral.ai/#api-access>
12
+ 2. Set your Mistral API Key as an environment variable. You only need to do this once.
13
+
14
+ ```bash
15
+ # set Mistral API Key (using zsh for example)
16
+ $ echo 'export MISTRAL_API_KEY=[your_key_here]' >> ~/.zshenv
17
+
18
+ # reload the environment (or just quit and open a new terminal)
19
+ $ source ~/.zshenv
20
+ ```
11
21
 
12
22
  <!-- Start SDK Installation [installation] -->
13
23
  ## SDK Installation
@@ -40,12 +50,12 @@ s = Mistral(
40
50
  )
41
51
 
42
52
 
43
- res = s.chat.create(messages=[
53
+ res = s.chat.complete(model="mistral-small-latest", messages=[
44
54
  {
45
55
  "content": "Who is the best French painter? Answer in one short sentence.",
46
56
  "role": "user",
47
57
  },
48
- ], model="mistral-small-latest")
58
+ ])
49
59
 
50
60
  if res is not None:
51
61
  # handle response
@@ -65,12 +75,12 @@ async def main():
65
75
  s = Mistral(
66
76
  api_key=os.getenv("MISTRAL_API_KEY", ""),
67
77
  )
68
- res = await s.chat.create_async(messages=[
78
+ res = await s.chat.complete_async(model="mistral-small-latest", messages=[
69
79
  {
70
80
  "content": "Who is the best French painter? Answer in one short sentence.",
71
81
  "role": "user",
72
82
  },
73
- ], model="mistral-small-latest")
83
+ ])
74
84
  if res is not None:
75
85
  # handle response
76
86
  pass
@@ -123,19 +133,78 @@ async def main():
123
133
  # handle response
124
134
  pass
125
135
 
136
+ asyncio.run(main())
137
+ ```
138
+
139
+ ### Create Agents Completions
140
+
141
+ This example shows how to create agents completions.
142
+
143
+ ```python
144
+ # Synchronous Example
145
+ from mistralai import Mistral
146
+ import os
147
+
148
+ s = Mistral(
149
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
150
+ )
151
+
152
+
153
+ res = s.agents.complete(messages=[
154
+ {
155
+ "content": "Who is the best French painter? Answer in one short sentence.",
156
+ "role": "user",
157
+ },
158
+ ], agent_id="<value>")
159
+
160
+ if res is not None:
161
+ # handle response
162
+ pass
163
+ ```
164
+
165
+ </br>
166
+
167
+ The same SDK client can also be used to make asychronous requests by importing asyncio.
168
+ ```python
169
+ # Asynchronous Example
170
+ import asyncio
171
+ from mistralai import Mistral
172
+ import os
173
+
174
+ async def main():
175
+ s = Mistral(
176
+ api_key=os.getenv("MISTRAL_API_KEY", ""),
177
+ )
178
+ res = await s.agents.complete_async(messages=[
179
+ {
180
+ "content": "Who is the best French painter? Answer in one short sentence.",
181
+ "role": "user",
182
+ },
183
+ ], agent_id="<value>")
184
+ if res is not None:
185
+ # handle response
186
+ pass
187
+
126
188
  asyncio.run(main())
127
189
  ```
128
190
  <!-- End SDK Example Usage [usage] -->
129
191
 
130
- ### Azure AI
131
192
 
132
- TODO ADJUST LINKS
193
+ ### More examples
194
+
195
+ You can run the examples in the `examples/` directory using `poetry run` or by entering the virtual environment using `poetry shell`.
196
+
197
+
198
+ ## Providers' SDKs Example Usage
199
+
200
+ ### Azure AI
133
201
 
134
202
  **Prerequisites**
203
+
135
204
  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.
136
205
  See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/).
137
206
 
138
- Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure.py).
207
+ Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure).
139
208
 
140
209
  ```python
141
210
  import asyncio
@@ -145,35 +214,32 @@ from mistralai_azure import MistralAzure
145
214
 
146
215
  client = MistralAzure(
147
216
  azure_api_key=os.getenv("AZURE_API_KEY", ""),
148
- azure_endpoint="your_azure_endpoint"
217
+ azure_endpoint=os.getenv("AZURE_ENDPOINT", "")
149
218
  )
150
219
 
151
220
  async def main() -> None:
152
- res = await client.chat.create_async(
153
- request={
154
- "max_tokens": 100,
155
- "temperature": 0.5,
156
- "messages": [
157
- {
158
- "content": "Hello there!",
159
- "role": "user"
160
- }
161
- ]
162
- }
221
+ res = await client.chat.complete_async(
222
+ max_tokens= 100,
223
+ temperature= 0.5,
224
+ messages= [
225
+ {
226
+ "content": "Hello there!",
227
+ "role": "user"
228
+ }
229
+ ]
163
230
  )
164
231
  print(res)
165
232
 
166
233
  asyncio.run(main())
167
234
  ```
168
- The documentation for the Azure SDK is available [GCP](packages/mistralai-azure/README.md).
235
+ The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md).
169
236
 
170
237
  ### Google Cloud
171
238
 
172
- TODO ADJUST LINKS
173
239
 
174
240
  **Prerequisites**
175
241
 
176
- 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/google/).
242
+ 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/).
177
243
 
178
244
  To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running
179
245
 
@@ -201,23 +267,21 @@ client = MistralGoogleCloud()
201
267
 
202
268
 
203
269
  async def main() -> None:
204
- res = await client.chat.create_async(
205
- request={
206
- "model": "mistral-small-2402",
207
- "messages": [
208
- {
209
- "content": "Hello there!",
210
- "role": "user"
211
- }
212
- ]
213
- }
270
+ res = await client.chat.complete_async(
271
+ model= "mistral-small-2402",
272
+ messages= [
273
+ {
274
+ "content": "Hello there!",
275
+ "role": "user"
276
+ }
277
+ ]
214
278
  )
215
279
  print(res)
216
280
 
217
281
  asyncio.run(main())
218
282
  ```
219
283
 
220
- The documentation for the GCP SDK is available [GCP](packages/mistralai_gcp/README.md).
284
+ The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md).
221
285
 
222
286
 
223
287
  <!-- Start Available Resources and Operations [operations] -->
@@ -239,24 +303,30 @@ The documentation for the GCP SDK is available [GCP](packages/mistralai_gcp/READ
239
303
  * [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File
240
304
  * [delete](docs/sdks/files/README.md#delete) - Delete File
241
305
 
242
- ### [fine_tuning](docs/sdks/finetuning/README.md)
243
306
 
244
- * [list_jobs](docs/sdks/finetuning/README.md#list_jobs) - Get Fine Tuning Jobs
245
- * [create_job](docs/sdks/finetuning/README.md#create_job) - Create Fine Tuning Job
246
- * [get_job](docs/sdks/finetuning/README.md#get_job) - Get Fine Tuning Job
247
- * [cancel_job](docs/sdks/finetuning/README.md#cancel_job) - Cancel Fine Tuning Job
248
- * [start_job](docs/sdks/finetuning/README.md#start_job) - Start Fine Tuning Job
307
+ ### [fine_tuning.jobs](docs/sdks/jobs/README.md)
308
+
309
+ * [list](docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs
310
+ * [create](docs/sdks/jobs/README.md#create) - Create Fine Tuning Job
311
+ * [get](docs/sdks/jobs/README.md#get) - Get Fine Tuning Job
312
+ * [cancel](docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job
313
+ * [start](docs/sdks/jobs/README.md#start) - Start Fine Tuning Job
249
314
 
250
315
  ### [chat](docs/sdks/chat/README.md)
251
316
 
252
- * [create](docs/sdks/chat/README.md#create) - Chat Completion
317
+ * [complete](docs/sdks/chat/README.md#complete) - Chat Completion
253
318
  * [stream](docs/sdks/chat/README.md#stream) - Stream chat completion
254
319
 
255
320
  ### [fim](docs/sdks/fim/README.md)
256
321
 
257
- * [create](docs/sdks/fim/README.md#create) - Fim Completion
322
+ * [complete](docs/sdks/fim/README.md#complete) - Fim Completion
258
323
  * [stream](docs/sdks/fim/README.md#stream) - Stream fim completion
259
324
 
325
+ ### [agents](docs/sdks/agents/README.md)
326
+
327
+ * [complete](docs/sdks/agents/README.md#complete) - Agents Completion
328
+ * [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion
329
+
260
330
  ### [embeddings](docs/sdks/embeddings/README.md)
261
331
 
262
332
  * [create](docs/sdks/embeddings/README.md#create) - Embeddings
@@ -280,12 +350,12 @@ s = Mistral(
280
350
  )
281
351
 
282
352
 
283
- res = s.chat.stream(messages=[
353
+ res = s.chat.stream(model="mistral-small-latest", messages=[
284
354
  {
285
355
  "content": "Who is the best French painter? Answer in one short sentence.",
286
356
  "role": "user",
287
357
  },
288
- ], model="mistral-small-latest")
358
+ ])
289
359
 
290
360
  if res is not None:
291
361
  for event in res:
@@ -555,11 +625,11 @@ s = Mistral(async_client=CustomClient(httpx.AsyncClient()))
555
625
 
556
626
  This SDK supports the following security scheme globally:
557
627
 
558
- | Name | Type | Scheme |
559
- | ----------- | ----------- | ----------- |
560
- | `api_key` | http | HTTP Bearer |
628
+ | Name | Type | Scheme | Environment Variable |
629
+ | -------------------- | -------------------- | -------------------- | -------------------- |
630
+ | `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` |
561
631
 
562
- To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example:
632
+ To authenticate with the API the `null` parameter must be set when initializing the SDK client instance. For example:
563
633
  ```python
564
634
  from mistralai import Mistral
565
635
  import os
@@ -577,27 +647,26 @@ if res is not None:
577
647
 
578
648
  ```
579
649
  <!-- End Authentication [security] -->
580
- ## Providers Support
581
650
 
582
- We also provide provider specific SDK for:
651
+ <!-- Start Debugging [debug] -->
652
+ ## Debugging
653
+
654
+ To emit debug logs for SDK requests and responses you can pass a logger object directly into your SDK object.
583
655
 
584
- - [GCP](packages/mistralai_gcp/README.md)
585
- - [Azure](packages/mistralai_azure/README.md)
656
+ ```python
657
+ from mistralai import Mistral
658
+ import logging
586
659
 
660
+ logging.basicConfig(level=logging.DEBUG)
661
+ s = Mistral(debug_logger=logging.getLogger("mistralai"))
662
+ ```
663
+ <!-- End Debugging [debug] -->
587
664
 
588
665
  <!-- Placeholder for Future Speakeasy SDK Sections -->
589
666
 
590
667
  # Development
591
668
 
592
- ## Maturity
593
-
594
- This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
595
- to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
596
- looking for the latest version.
597
-
598
669
  ## Contributions
599
670
 
600
671
  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.
601
672
  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.
602
-
603
- ### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)