mistralai 0.5.5a50__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.
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/PKG-INFO +113 -53
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/README.md +112 -52
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/basesdk.py +42 -4
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/chat.py +15 -20
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/__init__.py +2 -2
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py +4 -9
- mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +22 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py +7 -12
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py +7 -12
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py +1 -1
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/sdk.py +7 -2
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py +5 -4
- {mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp → mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure}/types/basemodel.py +10 -6
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py +4 -0
- {mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp → mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure}/utils/eventstreaming.py +8 -9
- mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure/utils/logger.py +16 -0
- {mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp → mistralai-1.0.0rc2/packages/mistralai_azure/src/mistralai_azure}/utils/retries.py +2 -2
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py +42 -4
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/chat.py +12 -17
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/fim.py +12 -13
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py +2 -2
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py +4 -9
- mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +22 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py +9 -14
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py +9 -14
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py +11 -16
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py +11 -16
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py +1 -1
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/sdk.py +9 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py +5 -4
- {mistralai-0.5.5a50/src/mistralai → mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp}/types/basemodel.py +10 -6
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py +4 -0
- {mistralai-0.5.5a50/src/mistralai → mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp}/utils/eventstreaming.py +8 -9
- mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py +16 -0
- {mistralai-0.5.5a50/src/mistralai → mistralai-1.0.0rc2/packages/mistralai_gcp/src/mistralai_gcp}/utils/retries.py +2 -2
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/pyproject.toml +1 -1
- mistralai-1.0.0rc2/src/mistralai/agents.py +434 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/basesdk.py +43 -6
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/chat.py +29 -34
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/embeddings.py +4 -4
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/files.py +10 -10
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/fim.py +17 -18
- mistralai-1.0.0rc2/src/mistralai/fine_tuning.py +16 -0
- mistralai-0.5.5a50/src/mistralai/fine_tuning.py → mistralai-1.0.0rc2/src/mistralai/jobs.py +23 -24
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/__init__.py +4 -2
- mistralai-1.0.0rc2/src/mistralai/models/agentscompletionrequest.py +96 -0
- mistralai-1.0.0rc2/src/mistralai/models/agentscompletionstreamrequest.py +92 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/assistantmessage.py +4 -9
- mistralai-1.0.0rc2/src/mistralai/models/chatcompletionchoice.py +22 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/chatcompletionrequest.py +11 -16
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/chatcompletionstreamrequest.py +11 -16
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/completionresponsestreamchoice.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/deltamessage.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/detailedjobout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/embeddingrequest.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/eventout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/fileschema.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/fimcompletionrequest.py +11 -16
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/fimcompletionstreamrequest.py +11 -16
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/ftmodelout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/githubrepositoryin.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/githubrepositoryout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/httpvalidationerror.py +1 -1
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobin.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobmetadataout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/legacyjobmetadataout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/metricout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/modelcard.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/retrievefileout.py +4 -9
- mistralai-1.0.0rc2/src/mistralai/models/security.py +16 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/toolmessage.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/trainingparameters.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/trainingparametersin.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/updateftmodelin.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/uploadfileout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/wandbintegration.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/wandbintegrationout.py +4 -9
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models_.py +14 -14
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/sdk.py +14 -6
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/sdkconfiguration.py +5 -4
- {mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure → mistralai-1.0.0rc2/src/mistralai}/types/basemodel.py +10 -6
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/__init__.py +4 -0
- {mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure → mistralai-1.0.0rc2/src/mistralai}/utils/eventstreaming.py +8 -9
- mistralai-1.0.0rc2/src/mistralai/utils/logger.py +16 -0
- {mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure → mistralai-1.0.0rc2/src/mistralai}/utils/retries.py +2 -2
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/security.py +5 -2
- mistralai-0.5.5a50/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +0 -33
- mistralai-0.5.5a50/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +0 -33
- mistralai-0.5.5a50/src/mistralai/models/chatcompletionchoice.py +0 -33
- mistralai-0.5.5a50/src/mistralai/models/security.py +0 -16
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/LICENSE +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/httpclient.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/function.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/security.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/tool.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/py.typed +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/types/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/enums.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/forms.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/headers.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/metadata.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/security.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/url.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_azure/src/mistralai_azure/utils/values.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/httpclient.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/function.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/security.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/py.typed +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/url.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/packages/mistralai_gcp/src/mistralai_gcp/utils/values.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/py.typed +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/_hooks/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/_hooks/custom_user_agent.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/_hooks/deprecation_warning.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/_hooks/registration.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/_hooks/sdkhooks.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/_hooks/types.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/async_client.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/client.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/httpclient.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/archiveftmodelout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/chatcompletionresponse.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/checkpointout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/completionchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/completionevent.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/contentchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/delete_model_v1_models_model_id_deleteop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/deletefileout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/deletemodelout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/embeddingresponse.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/embeddingresponsedata.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/files_api_routes_delete_fileop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/files_api_routes_retrieve_fileop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/files_api_routes_upload_fileop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/fimcompletionresponse.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/finetuneablemodel.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/ftmodelcapabilitiesout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/function.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/functioncall.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/jobsout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/listfilesout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/modelcapabilities.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/modellist.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/responseformat.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/retrieve_model_v1_models_model_id_getop.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/sampletype.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/sdkerror.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/source.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/systemmessage.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/textchunk.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/tool.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/toolcall.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/trainingfile.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/unarchiveftmodelout.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/usageinfo.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/usermessage.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/models/validationerror.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/py.typed +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/types/__init__.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/annotations.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/enums.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/forms.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/headers.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/metadata.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/queryparams.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/requestbodies.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/serializers.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/url.py +0 -0
- {mistralai-0.5.5a50 → mistralai-1.0.0rc2}/src/mistralai/utils/values.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mistralai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0rc2
|
|
4
4
|
Summary: Python Client SDK for the Mistral AI API.
|
|
5
5
|
Author: Mistral
|
|
6
6
|
Requires-Python: >=3.8,<4.0
|
|
@@ -28,7 +28,6 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
|
|
29
29
|
## Migration warning
|
|
30
30
|
|
|
31
|
-
TODO: provide more details
|
|
32
31
|
This documentation is for Mistralai SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
|
|
33
32
|
|
|
34
33
|
<!-- Start SDK Installation [installation] -->
|
|
@@ -62,12 +61,12 @@ s = Mistral(
|
|
|
62
61
|
)
|
|
63
62
|
|
|
64
63
|
|
|
65
|
-
res = s.chat.
|
|
64
|
+
res = s.chat.complete(model="mistral-small-latest", messages=[
|
|
66
65
|
{
|
|
67
66
|
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
68
67
|
"role": "user",
|
|
69
68
|
},
|
|
70
|
-
]
|
|
69
|
+
])
|
|
71
70
|
|
|
72
71
|
if res is not None:
|
|
73
72
|
# handle response
|
|
@@ -87,12 +86,12 @@ async def main():
|
|
|
87
86
|
s = Mistral(
|
|
88
87
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
89
88
|
)
|
|
90
|
-
res = await s.chat.
|
|
89
|
+
res = await s.chat.complete_async(model="mistral-small-latest", messages=[
|
|
91
90
|
{
|
|
92
91
|
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
93
92
|
"role": "user",
|
|
94
93
|
},
|
|
95
|
-
]
|
|
94
|
+
])
|
|
96
95
|
if res is not None:
|
|
97
96
|
# handle response
|
|
98
97
|
pass
|
|
@@ -145,19 +144,72 @@ async def main():
|
|
|
145
144
|
# handle response
|
|
146
145
|
pass
|
|
147
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
|
+
|
|
148
199
|
asyncio.run(main())
|
|
149
200
|
```
|
|
150
201
|
<!-- End SDK Example Usage [usage] -->
|
|
151
202
|
|
|
152
|
-
|
|
203
|
+
## Providers' SDKs Example Usage
|
|
153
204
|
|
|
154
|
-
|
|
205
|
+
### Azure AI
|
|
155
206
|
|
|
156
207
|
**Prerequisites**
|
|
208
|
+
|
|
157
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.
|
|
158
210
|
See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/).
|
|
159
211
|
|
|
160
|
-
Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure
|
|
212
|
+
Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure).
|
|
161
213
|
|
|
162
214
|
```python
|
|
163
215
|
import asyncio
|
|
@@ -167,35 +219,32 @@ from mistralai_azure import MistralAzure
|
|
|
167
219
|
|
|
168
220
|
client = MistralAzure(
|
|
169
221
|
azure_api_key=os.getenv("AZURE_API_KEY", ""),
|
|
170
|
-
azure_endpoint="
|
|
222
|
+
azure_endpoint=os.getenv("AZURE_ENDPOINT", "")
|
|
171
223
|
)
|
|
172
224
|
|
|
173
225
|
async def main() -> None:
|
|
174
|
-
res = await client.chat.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
]
|
|
184
|
-
}
|
|
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
|
+
]
|
|
185
235
|
)
|
|
186
236
|
print(res)
|
|
187
237
|
|
|
188
238
|
asyncio.run(main())
|
|
189
239
|
```
|
|
190
|
-
The documentation for the Azure SDK is available [
|
|
240
|
+
The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md).
|
|
191
241
|
|
|
192
242
|
### Google Cloud
|
|
193
243
|
|
|
194
|
-
TODO ADJUST LINKS
|
|
195
244
|
|
|
196
245
|
**Prerequisites**
|
|
197
246
|
|
|
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/
|
|
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/).
|
|
199
248
|
|
|
200
249
|
To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running
|
|
201
250
|
|
|
@@ -223,23 +272,21 @@ client = MistralGoogleCloud()
|
|
|
223
272
|
|
|
224
273
|
|
|
225
274
|
async def main() -> None:
|
|
226
|
-
res = await client.chat.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
]
|
|
235
|
-
}
|
|
275
|
+
res = await client.chat.complete_async(
|
|
276
|
+
model= "mistral-small-2402",
|
|
277
|
+
messages= [
|
|
278
|
+
{
|
|
279
|
+
"content": "Hello there!",
|
|
280
|
+
"role": "user"
|
|
281
|
+
}
|
|
282
|
+
]
|
|
236
283
|
)
|
|
237
284
|
print(res)
|
|
238
285
|
|
|
239
286
|
asyncio.run(main())
|
|
240
287
|
```
|
|
241
288
|
|
|
242
|
-
The documentation for the GCP SDK is available [
|
|
289
|
+
The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md).
|
|
243
290
|
|
|
244
291
|
|
|
245
292
|
<!-- Start Available Resources and Operations [operations] -->
|
|
@@ -261,24 +308,30 @@ The documentation for the GCP SDK is available [GCP](packages/mistralai_gcp/READ
|
|
|
261
308
|
* [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File
|
|
262
309
|
* [delete](docs/sdks/files/README.md#delete) - Delete File
|
|
263
310
|
|
|
264
|
-
### [fine_tuning](docs/sdks/finetuning/README.md)
|
|
265
311
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
* [
|
|
269
|
-
* [
|
|
270
|
-
* [
|
|
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
|
|
271
319
|
|
|
272
320
|
### [chat](docs/sdks/chat/README.md)
|
|
273
321
|
|
|
274
|
-
* [
|
|
322
|
+
* [complete](docs/sdks/chat/README.md#complete) - Chat Completion
|
|
275
323
|
* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion
|
|
276
324
|
|
|
277
325
|
### [fim](docs/sdks/fim/README.md)
|
|
278
326
|
|
|
279
|
-
* [
|
|
327
|
+
* [complete](docs/sdks/fim/README.md#complete) - Fim Completion
|
|
280
328
|
* [stream](docs/sdks/fim/README.md#stream) - Stream fim completion
|
|
281
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
|
+
|
|
282
335
|
### [embeddings](docs/sdks/embeddings/README.md)
|
|
283
336
|
|
|
284
337
|
* [create](docs/sdks/embeddings/README.md#create) - Embeddings
|
|
@@ -302,12 +355,12 @@ s = Mistral(
|
|
|
302
355
|
)
|
|
303
356
|
|
|
304
357
|
|
|
305
|
-
res = s.chat.stream(messages=[
|
|
358
|
+
res = s.chat.stream(model="mistral-small-latest", messages=[
|
|
306
359
|
{
|
|
307
360
|
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
308
361
|
"role": "user",
|
|
309
362
|
},
|
|
310
|
-
]
|
|
363
|
+
])
|
|
311
364
|
|
|
312
365
|
if res is not None:
|
|
313
366
|
for event in res:
|
|
@@ -577,11 +630,11 @@ s = Mistral(async_client=CustomClient(httpx.AsyncClient()))
|
|
|
577
630
|
|
|
578
631
|
This SDK supports the following security scheme globally:
|
|
579
632
|
|
|
580
|
-
| Name
|
|
581
|
-
|
|
|
582
|
-
| `api_key`
|
|
633
|
+
| Name | Type | Scheme | Environment Variable |
|
|
634
|
+
| -------------------- | -------------------- | -------------------- | -------------------- |
|
|
635
|
+
| `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` |
|
|
583
636
|
|
|
584
|
-
To authenticate with the API the `
|
|
637
|
+
To authenticate with the API the `null` parameter must be set when initializing the SDK client instance. For example:
|
|
585
638
|
```python
|
|
586
639
|
from mistralai import Mistral
|
|
587
640
|
import os
|
|
@@ -599,13 +652,20 @@ if res is not None:
|
|
|
599
652
|
|
|
600
653
|
```
|
|
601
654
|
<!-- End Authentication [security] -->
|
|
602
|
-
## Providers Support
|
|
603
655
|
|
|
604
|
-
|
|
656
|
+
<!-- Start Debugging [debug] -->
|
|
657
|
+
## Debugging
|
|
605
658
|
|
|
606
|
-
|
|
607
|
-
- [Azure](packages/mistralai_azure/README.md)
|
|
659
|
+
To emit debug logs for SDK requests and responses you can pass a logger object directly into your SDK object.
|
|
608
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] -->
|
|
609
669
|
|
|
610
670
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
611
671
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
## Migration warning
|
|
8
8
|
|
|
9
|
-
TODO: provide more details
|
|
10
9
|
This documentation is for Mistralai SDK v1. You can find more details on how to migrate from v0 to v1 [here](MIGRATION.md)
|
|
11
10
|
|
|
12
11
|
<!-- Start SDK Installation [installation] -->
|
|
@@ -40,12 +39,12 @@ s = Mistral(
|
|
|
40
39
|
)
|
|
41
40
|
|
|
42
41
|
|
|
43
|
-
res = s.chat.
|
|
42
|
+
res = s.chat.complete(model="mistral-small-latest", messages=[
|
|
44
43
|
{
|
|
45
44
|
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
46
45
|
"role": "user",
|
|
47
46
|
},
|
|
48
|
-
]
|
|
47
|
+
])
|
|
49
48
|
|
|
50
49
|
if res is not None:
|
|
51
50
|
# handle response
|
|
@@ -65,12 +64,12 @@ async def main():
|
|
|
65
64
|
s = Mistral(
|
|
66
65
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
67
66
|
)
|
|
68
|
-
res = await s.chat.
|
|
67
|
+
res = await s.chat.complete_async(model="mistral-small-latest", messages=[
|
|
69
68
|
{
|
|
70
69
|
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
71
70
|
"role": "user",
|
|
72
71
|
},
|
|
73
|
-
]
|
|
72
|
+
])
|
|
74
73
|
if res is not None:
|
|
75
74
|
# handle response
|
|
76
75
|
pass
|
|
@@ -123,19 +122,72 @@ async def main():
|
|
|
123
122
|
# handle response
|
|
124
123
|
pass
|
|
125
124
|
|
|
125
|
+
asyncio.run(main())
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Create Agents Completions
|
|
129
|
+
|
|
130
|
+
This example shows how to create agents completions.
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
# Synchronous Example
|
|
134
|
+
from mistralai import Mistral
|
|
135
|
+
import os
|
|
136
|
+
|
|
137
|
+
s = Mistral(
|
|
138
|
+
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
res = s.agents.complete(messages=[
|
|
143
|
+
{
|
|
144
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
145
|
+
"role": "user",
|
|
146
|
+
},
|
|
147
|
+
], agent_id="<value>")
|
|
148
|
+
|
|
149
|
+
if res is not None:
|
|
150
|
+
# handle response
|
|
151
|
+
pass
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
</br>
|
|
155
|
+
|
|
156
|
+
The same SDK client can also be used to make asychronous requests by importing asyncio.
|
|
157
|
+
```python
|
|
158
|
+
# Asynchronous Example
|
|
159
|
+
import asyncio
|
|
160
|
+
from mistralai import Mistral
|
|
161
|
+
import os
|
|
162
|
+
|
|
163
|
+
async def main():
|
|
164
|
+
s = Mistral(
|
|
165
|
+
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
166
|
+
)
|
|
167
|
+
res = await s.agents.complete_async(messages=[
|
|
168
|
+
{
|
|
169
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
170
|
+
"role": "user",
|
|
171
|
+
},
|
|
172
|
+
], agent_id="<value>")
|
|
173
|
+
if res is not None:
|
|
174
|
+
# handle response
|
|
175
|
+
pass
|
|
176
|
+
|
|
126
177
|
asyncio.run(main())
|
|
127
178
|
```
|
|
128
179
|
<!-- End SDK Example Usage [usage] -->
|
|
129
180
|
|
|
130
|
-
|
|
181
|
+
## Providers' SDKs Example Usage
|
|
131
182
|
|
|
132
|
-
|
|
183
|
+
### Azure AI
|
|
133
184
|
|
|
134
185
|
**Prerequisites**
|
|
186
|
+
|
|
135
187
|
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
188
|
See [instructions for deploying Mistral on Azure AI here](https://docs.mistral.ai/deployment/cloud/azure/).
|
|
137
189
|
|
|
138
|
-
Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure
|
|
190
|
+
Here's a basic example to get you started. You can also run [the example in the `examples` directory](/examples/azure).
|
|
139
191
|
|
|
140
192
|
```python
|
|
141
193
|
import asyncio
|
|
@@ -145,35 +197,32 @@ from mistralai_azure import MistralAzure
|
|
|
145
197
|
|
|
146
198
|
client = MistralAzure(
|
|
147
199
|
azure_api_key=os.getenv("AZURE_API_KEY", ""),
|
|
148
|
-
azure_endpoint="
|
|
200
|
+
azure_endpoint=os.getenv("AZURE_ENDPOINT", "")
|
|
149
201
|
)
|
|
150
202
|
|
|
151
203
|
async def main() -> None:
|
|
152
|
-
res = await client.chat.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
]
|
|
162
|
-
}
|
|
204
|
+
res = await client.chat.complete_async(
|
|
205
|
+
max_tokens= 100,
|
|
206
|
+
temperature= 0.5,
|
|
207
|
+
messages= [
|
|
208
|
+
{
|
|
209
|
+
"content": "Hello there!",
|
|
210
|
+
"role": "user"
|
|
211
|
+
}
|
|
212
|
+
]
|
|
163
213
|
)
|
|
164
214
|
print(res)
|
|
165
215
|
|
|
166
216
|
asyncio.run(main())
|
|
167
217
|
```
|
|
168
|
-
The documentation for the Azure SDK is available [
|
|
218
|
+
The documentation for the Azure SDK is available [here](packages/mistralai_azure/README.md).
|
|
169
219
|
|
|
170
220
|
### Google Cloud
|
|
171
221
|
|
|
172
|
-
TODO ADJUST LINKS
|
|
173
222
|
|
|
174
223
|
**Prerequisites**
|
|
175
224
|
|
|
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/
|
|
225
|
+
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
226
|
|
|
178
227
|
To run this locally you will also need to ensure you are authenticated with Google Cloud. You can do this by running
|
|
179
228
|
|
|
@@ -201,23 +250,21 @@ client = MistralGoogleCloud()
|
|
|
201
250
|
|
|
202
251
|
|
|
203
252
|
async def main() -> None:
|
|
204
|
-
res = await client.chat.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
]
|
|
213
|
-
}
|
|
253
|
+
res = await client.chat.complete_async(
|
|
254
|
+
model= "mistral-small-2402",
|
|
255
|
+
messages= [
|
|
256
|
+
{
|
|
257
|
+
"content": "Hello there!",
|
|
258
|
+
"role": "user"
|
|
259
|
+
}
|
|
260
|
+
]
|
|
214
261
|
)
|
|
215
262
|
print(res)
|
|
216
263
|
|
|
217
264
|
asyncio.run(main())
|
|
218
265
|
```
|
|
219
266
|
|
|
220
|
-
The documentation for the GCP SDK is available [
|
|
267
|
+
The documentation for the GCP SDK is available [here](packages/mistralai_gcp/README.md).
|
|
221
268
|
|
|
222
269
|
|
|
223
270
|
<!-- Start Available Resources and Operations [operations] -->
|
|
@@ -239,24 +286,30 @@ The documentation for the GCP SDK is available [GCP](packages/mistralai_gcp/READ
|
|
|
239
286
|
* [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File
|
|
240
287
|
* [delete](docs/sdks/files/README.md#delete) - Delete File
|
|
241
288
|
|
|
242
|
-
### [fine_tuning](docs/sdks/finetuning/README.md)
|
|
243
289
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* [
|
|
247
|
-
* [
|
|
248
|
-
* [
|
|
290
|
+
### [fine_tuning.jobs](docs/sdks/jobs/README.md)
|
|
291
|
+
|
|
292
|
+
* [list](docs/sdks/jobs/README.md#list) - Get Fine Tuning Jobs
|
|
293
|
+
* [create](docs/sdks/jobs/README.md#create) - Create Fine Tuning Job
|
|
294
|
+
* [get](docs/sdks/jobs/README.md#get) - Get Fine Tuning Job
|
|
295
|
+
* [cancel](docs/sdks/jobs/README.md#cancel) - Cancel Fine Tuning Job
|
|
296
|
+
* [start](docs/sdks/jobs/README.md#start) - Start Fine Tuning Job
|
|
249
297
|
|
|
250
298
|
### [chat](docs/sdks/chat/README.md)
|
|
251
299
|
|
|
252
|
-
* [
|
|
300
|
+
* [complete](docs/sdks/chat/README.md#complete) - Chat Completion
|
|
253
301
|
* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion
|
|
254
302
|
|
|
255
303
|
### [fim](docs/sdks/fim/README.md)
|
|
256
304
|
|
|
257
|
-
* [
|
|
305
|
+
* [complete](docs/sdks/fim/README.md#complete) - Fim Completion
|
|
258
306
|
* [stream](docs/sdks/fim/README.md#stream) - Stream fim completion
|
|
259
307
|
|
|
308
|
+
### [agents](docs/sdks/agents/README.md)
|
|
309
|
+
|
|
310
|
+
* [complete](docs/sdks/agents/README.md#complete) - Chat Completion
|
|
311
|
+
* [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion
|
|
312
|
+
|
|
260
313
|
### [embeddings](docs/sdks/embeddings/README.md)
|
|
261
314
|
|
|
262
315
|
* [create](docs/sdks/embeddings/README.md#create) - Embeddings
|
|
@@ -280,12 +333,12 @@ s = Mistral(
|
|
|
280
333
|
)
|
|
281
334
|
|
|
282
335
|
|
|
283
|
-
res = s.chat.stream(messages=[
|
|
336
|
+
res = s.chat.stream(model="mistral-small-latest", messages=[
|
|
284
337
|
{
|
|
285
338
|
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
286
339
|
"role": "user",
|
|
287
340
|
},
|
|
288
|
-
]
|
|
341
|
+
])
|
|
289
342
|
|
|
290
343
|
if res is not None:
|
|
291
344
|
for event in res:
|
|
@@ -555,11 +608,11 @@ s = Mistral(async_client=CustomClient(httpx.AsyncClient()))
|
|
|
555
608
|
|
|
556
609
|
This SDK supports the following security scheme globally:
|
|
557
610
|
|
|
558
|
-
| Name
|
|
559
|
-
|
|
|
560
|
-
| `api_key`
|
|
611
|
+
| Name | Type | Scheme | Environment Variable |
|
|
612
|
+
| -------------------- | -------------------- | -------------------- | -------------------- |
|
|
613
|
+
| `api_key` | http | HTTP Bearer | `MISTRAL_API_KEY` |
|
|
561
614
|
|
|
562
|
-
To authenticate with the API the `
|
|
615
|
+
To authenticate with the API the `null` parameter must be set when initializing the SDK client instance. For example:
|
|
563
616
|
```python
|
|
564
617
|
from mistralai import Mistral
|
|
565
618
|
import os
|
|
@@ -577,13 +630,20 @@ if res is not None:
|
|
|
577
630
|
|
|
578
631
|
```
|
|
579
632
|
<!-- End Authentication [security] -->
|
|
580
|
-
## Providers Support
|
|
581
633
|
|
|
582
|
-
|
|
634
|
+
<!-- Start Debugging [debug] -->
|
|
635
|
+
## Debugging
|
|
583
636
|
|
|
584
|
-
|
|
585
|
-
- [Azure](packages/mistralai_azure/README.md)
|
|
637
|
+
To emit debug logs for SDK requests and responses you can pass a logger object directly into your SDK object.
|
|
586
638
|
|
|
639
|
+
```python
|
|
640
|
+
from mistralai import Mistral
|
|
641
|
+
import logging
|
|
642
|
+
|
|
643
|
+
logging.basicConfig(level=logging.DEBUG)
|
|
644
|
+
s = Mistral(debug_logger=logging.getLogger("mistralai"))
|
|
645
|
+
```
|
|
646
|
+
<!-- End Debugging [debug] -->
|
|
587
647
|
|
|
588
648
|
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
589
649
|
|