mistralai 1.2.2__tar.gz → 1.2.4__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-1.2.2 → mistralai-1.2.4}/PKG-INFO +181 -176
- {mistralai-1.2.2 → mistralai-1.2.4}/README-PYPI.md +179 -174
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/_version.py +1 -1
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/chat.py +5 -5
- {mistralai-1.2.2/src/mistralai → mistralai-1.2.4/packages/mistralai_azure/src/mistralai_azure}/httpclient.py +6 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/__init__.py +13 -1
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/assistantmessage.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionrequest.py +23 -11
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionstreamrequest.py +19 -13
- mistralai-1.2.4/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py +22 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/deltamessage.py +5 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/functioncall.py +3 -3
- mistralai-1.2.4/packages/mistralai_azure/src/mistralai_azure/models/referencechunk.py +20 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/systemmessage.py +7 -3
- mistralai-1.2.4/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py +20 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/toolmessage.py +14 -5
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/usermessage.py +5 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/validationerror.py +3 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/sdkconfiguration.py +3 -3
- mistralai-1.2.4/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py +55 -0
- {mistralai-1.2.2/src/mistralai → mistralai-1.2.4/packages/mistralai_azure/src/mistralai_azure}/utils/eventstreaming.py +61 -1
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/_version.py +1 -1
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/chat.py +5 -5
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/fim.py +5 -5
- {mistralai-1.2.2/packages/mistralai_azure/src/mistralai_azure → mistralai-1.2.4/packages/mistralai_gcp/src/mistralai_gcp}/httpclient.py +6 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/__init__.py +13 -1
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/assistantmessage.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionrequest.py +23 -11
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionstreamrequest.py +19 -13
- mistralai-1.2.4/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py +22 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/deltamessage.py +5 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionrequest.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionstreamrequest.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/functioncall.py +3 -3
- mistralai-1.2.4/packages/mistralai_gcp/src/mistralai_gcp/models/referencechunk.py +20 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/systemmessage.py +7 -3
- mistralai-1.2.4/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py +20 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/toolmessage.py +14 -5
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/usermessage.py +5 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/validationerror.py +3 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/sdk.py +5 -4
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/sdkconfiguration.py +3 -3
- mistralai-1.2.4/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py +55 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/eventstreaming.py +61 -1
- {mistralai-1.2.2 → mistralai-1.2.4}/pyproject.toml +3 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/_version.py +1 -1
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/agents.py +5 -5
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/chat.py +5 -5
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/files.py +166 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/fim.py +5 -5
- {mistralai-1.2.2/packages/mistralai_gcp/src/mistralai_gcp → mistralai-1.2.4/src/mistralai}/httpclient.py +6 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/jobs.py +2 -2
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/__init__.py +22 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/agentscompletionrequest.py +23 -11
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/agentscompletionstreamrequest.py +23 -13
- mistralai-1.2.4/src/mistralai/models/apiendpoint.py +17 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/assistantmessage.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/batchjobin.py +4 -2
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/chatclassificationrequest.py +26 -17
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/chatcompletionrequest.py +19 -11
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/chatcompletionstreamrequest.py +23 -13
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/classificationrequest.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/contentchunk.py +9 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/deltamessage.py +5 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/detailedjobout.py +2 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/embeddingrequest.py +3 -3
- mistralai-1.2.4/src/mistralai/models/files_api_routes_get_signed_urlop.py +25 -0
- mistralai-1.2.4/src/mistralai/models/filesignedurl.py +13 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/fimcompletionrequest.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/fimcompletionstreamrequest.py +7 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/functioncall.py +3 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/imageurlchunk.py +9 -14
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobin.py +2 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobout.py +2 -3
- mistralai-1.2.4/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +21 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/modellist.py +4 -2
- mistralai-1.2.4/src/mistralai/models/referencechunk.py +20 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/retrieve_model_v1_models_model_id_getop.py +5 -4
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/systemmessage.py +7 -3
- mistralai-1.2.4/src/mistralai/models/textchunk.py +20 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/toolmessage.py +14 -5
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/usermessage.py +5 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/validationerror.py +3 -3
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/sdk.py +14 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/sdkconfiguration.py +3 -3
- mistralai-1.2.4/src/mistralai/utils/annotations.py +55 -0
- {mistralai-1.2.2/packages/mistralai_azure/src/mistralai_azure → mistralai-1.2.4/src/mistralai}/utils/eventstreaming.py +61 -1
- mistralai-1.2.2/packages/mistralai_azure/src/mistralai_azure/models/contentchunk.py +0 -10
- mistralai-1.2.2/packages/mistralai_azure/src/mistralai_azure/models/textchunk.py +0 -26
- mistralai-1.2.2/packages/mistralai_azure/src/mistralai_azure/utils/annotations.py +0 -30
- mistralai-1.2.2/packages/mistralai_gcp/src/mistralai_gcp/models/contentchunk.py +0 -10
- mistralai-1.2.2/packages/mistralai_gcp/src/mistralai_gcp/models/textchunk.py +0 -26
- mistralai-1.2.2/packages/mistralai_gcp/src/mistralai_gcp/utils/annotations.py +0 -30
- mistralai-1.2.2/src/mistralai/models/apiendpoint.py +0 -9
- mistralai-1.2.2/src/mistralai/models/finetuneablemodel.py +0 -14
- mistralai-1.2.2/src/mistralai/models/jobs_api_routes_fine_tuning_create_fine_tuning_jobop.py +0 -16
- mistralai-1.2.2/src/mistralai/models/textchunk.py +0 -26
- mistralai-1.2.2/src/mistralai/utils/annotations.py +0 -30
- {mistralai-1.2.2 → mistralai-1.2.4}/LICENSE +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/_hooks/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/_hooks/custom_user_agent.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/_hooks/registration.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/_hooks/sdkhooks.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/_hooks/types.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/basesdk.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/chatcompletionresponse.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/completionchunk.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/completionevent.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/completionresponsestreamchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/function.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/functionname.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/httpvalidationerror.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/responseformat.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/responseformats.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/sdkerror.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/security.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/tool.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/toolcall.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/toolchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/toolchoiceenum.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/tooltypes.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/models/usageinfo.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/py.typed +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/sdk.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/types/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/types/basemodel.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/enums.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/forms.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/headers.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/logger.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/metadata.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/queryparams.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/requestbodies.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/retries.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/security.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/serializers.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/url.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_azure/src/mistralai_azure/utils/values.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/custom_user_agent.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/registration.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/sdkhooks.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/_hooks/types.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/basesdk.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/chatcompletionresponse.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/completionchunk.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/completionevent.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/completionresponsestreamchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/fimcompletionresponse.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/function.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/functionname.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/httpvalidationerror.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/responseformat.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/responseformats.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/sdkerror.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/security.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/tool.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/toolcall.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/toolchoiceenum.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/tooltypes.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/models/usageinfo.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/py.typed +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/types/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/types/basemodel.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/enums.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/forms.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/headers.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/logger.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/metadata.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/queryparams.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/requestbodies.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/retries.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/security.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/serializers.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/url.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/packages/mistralai_gcp/src/mistralai_gcp/utils/values.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/py.typed +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/_hooks/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/_hooks/custom_user_agent.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/_hooks/deprecation_warning.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/_hooks/registration.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/_hooks/sdkhooks.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/_hooks/types.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/async_client.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/basesdk.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/batch.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/classifiers.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/client.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/embeddings.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/fine_tuning.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/mistral_jobs.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/archiveftmodelout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/basemodelcard.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/batcherror.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/batchjobout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/batchjobsout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/batchjobstatus.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/chatcompletionchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/chatcompletionresponse.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/checkpointout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/classificationobject.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/classificationresponse.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/completionchunk.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/completionevent.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/completionresponsestreamchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/delete_model_v1_models_model_id_deleteop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/deletefileout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/deletemodelout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/embeddingresponse.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/embeddingresponsedata.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/eventout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/filepurpose.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/files_api_routes_delete_fileop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/files_api_routes_download_fileop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/files_api_routes_list_filesop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/files_api_routes_retrieve_fileop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/files_api_routes_upload_fileop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/fileschema.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/fimcompletionresponse.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/ftmodelcapabilitiesout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/ftmodelcard.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/ftmodelout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/function.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/functionname.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/githubrepositoryin.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/githubrepositoryout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/httpvalidationerror.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/imageurl.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobmetadataout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_batch_cancel_batch_jobop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_batch_get_batch_jobop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_batch_get_batch_jobsop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_fine_tuning_archive_fine_tuned_modelop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_fine_tuning_cancel_fine_tuning_jobop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_fine_tuning_get_fine_tuning_jobsop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_fine_tuning_start_fine_tuning_jobop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobs_api_routes_fine_tuning_update_fine_tuned_modelop.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/jobsout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/legacyjobmetadataout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/listfilesout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/metricout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/modelcapabilities.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/responseformat.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/responseformats.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/retrievefileout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/sampletype.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/sdkerror.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/security.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/source.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/tool.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/toolcall.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/toolchoice.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/toolchoiceenum.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/tooltypes.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/trainingfile.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/trainingparameters.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/trainingparametersin.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/unarchiveftmodelout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/updateftmodelin.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/uploadfileout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/usageinfo.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/wandbintegration.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models/wandbintegrationout.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/models_.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/py.typed +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/types/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/types/basemodel.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/__init__.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/enums.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/forms.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/headers.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/logger.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/metadata.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/queryparams.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/requestbodies.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/retries.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/security.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/serializers.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/url.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/utils/values.py +0 -0
- {mistralai-1.2.2 → mistralai-1.2.4}/src/mistralai/version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mistralai
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.4
|
|
4
4
|
Summary: Python Client SDK for the Mistral AI API.
|
|
5
5
|
Home-page: https://github.com/mistralai/client-python.git
|
|
6
6
|
Author: Mistral
|
|
@@ -18,7 +18,7 @@ Requires-Dist: google-auth (==2.27.0) ; extra == "gcp"
|
|
|
18
18
|
Requires-Dist: httpx (>=0.27.0,<0.28.0)
|
|
19
19
|
Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
|
|
20
20
|
Requires-Dist: pydantic (>=2.9.0,<3.0.0)
|
|
21
|
-
Requires-Dist: python-dateutil (
|
|
21
|
+
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
|
|
22
22
|
Requires-Dist: requests (>=2.32.3,<3.0.0) ; extra == "gcp"
|
|
23
23
|
Requires-Dist: typing-inspect (>=0.9.0,<0.10.0)
|
|
24
24
|
Project-URL: Repository, https://github.com/mistralai/client-python.git
|
|
@@ -53,19 +53,26 @@ Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create yo
|
|
|
53
53
|
|
|
54
54
|
<!-- Start Table of Contents [toc] -->
|
|
55
55
|
## Table of Contents
|
|
56
|
+
<!-- $toc-max-depth=2 -->
|
|
57
|
+
* [Mistral Python Client](https://github.com/mistralai/client-python/blob/master/#mistral-python-client)
|
|
58
|
+
* [Migration warning](https://github.com/mistralai/client-python/blob/master/#migration-warning)
|
|
59
|
+
* [API Key Setup](https://github.com/mistralai/client-python/blob/master/#api-key-setup)
|
|
60
|
+
* [SDK Installation](https://github.com/mistralai/client-python/blob/master/#sdk-installation)
|
|
61
|
+
* [SDK Example Usage](https://github.com/mistralai/client-python/blob/master/#sdk-example-usage)
|
|
62
|
+
* [Providers' SDKs Example Usage](https://github.com/mistralai/client-python/blob/master/#providers-sdks-example-usage)
|
|
63
|
+
* [Available Resources and Operations](https://github.com/mistralai/client-python/blob/master/#available-resources-and-operations)
|
|
64
|
+
* [Server-sent event streaming](https://github.com/mistralai/client-python/blob/master/#server-sent-event-streaming)
|
|
65
|
+
* [File uploads](https://github.com/mistralai/client-python/blob/master/#file-uploads)
|
|
66
|
+
* [Retries](https://github.com/mistralai/client-python/blob/master/#retries)
|
|
67
|
+
* [Error Handling](https://github.com/mistralai/client-python/blob/master/#error-handling)
|
|
68
|
+
* [Server Selection](https://github.com/mistralai/client-python/blob/master/#server-selection)
|
|
69
|
+
* [Custom HTTP Client](https://github.com/mistralai/client-python/blob/master/#custom-http-client)
|
|
70
|
+
* [Authentication](https://github.com/mistralai/client-python/blob/master/#authentication)
|
|
71
|
+
* [Debugging](https://github.com/mistralai/client-python/blob/master/#debugging)
|
|
72
|
+
* [IDE Support](https://github.com/mistralai/client-python/blob/master/#ide-support)
|
|
73
|
+
* [Development](https://github.com/mistralai/client-python/blob/master/#development)
|
|
74
|
+
* [Contributions](https://github.com/mistralai/client-python/blob/master/#contributions)
|
|
56
75
|
|
|
57
|
-
* [SDK Installation](https://github.com/mistralai/client-python/blob/master/#sdk-installation)
|
|
58
|
-
* [IDE Support](https://github.com/mistralai/client-python/blob/master/#ide-support)
|
|
59
|
-
* [SDK Example Usage](https://github.com/mistralai/client-python/blob/master/#sdk-example-usage)
|
|
60
|
-
* [Available Resources and Operations](https://github.com/mistralai/client-python/blob/master/#available-resources-and-operations)
|
|
61
|
-
* [Server-sent event streaming](https://github.com/mistralai/client-python/blob/master/#server-sent-event-streaming)
|
|
62
|
-
* [File uploads](https://github.com/mistralai/client-python/blob/master/#file-uploads)
|
|
63
|
-
* [Retries](https://github.com/mistralai/client-python/blob/master/#retries)
|
|
64
|
-
* [Error Handling](https://github.com/mistralai/client-python/blob/master/#error-handling)
|
|
65
|
-
* [Server Selection](https://github.com/mistralai/client-python/blob/master/#server-selection)
|
|
66
|
-
* [Custom HTTP Client](https://github.com/mistralai/client-python/blob/master/#custom-http-client)
|
|
67
|
-
* [Authentication](https://github.com/mistralai/client-python/blob/master/#authentication)
|
|
68
|
-
* [Debugging](https://github.com/mistralai/client-python/blob/master/#debugging)
|
|
69
76
|
<!-- End Table of Contents [toc] -->
|
|
70
77
|
|
|
71
78
|
<!-- Start SDK Installation [installation] -->
|
|
@@ -102,20 +109,19 @@ This example shows how to create chat completions.
|
|
|
102
109
|
from mistralai import Mistral
|
|
103
110
|
import os
|
|
104
111
|
|
|
105
|
-
|
|
112
|
+
with Mistral(
|
|
106
113
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
])
|
|
114
|
+
) as s:
|
|
115
|
+
res = s.chat.complete(model="mistral-small-latest", messages=[
|
|
116
|
+
{
|
|
117
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
118
|
+
"role": "user",
|
|
119
|
+
},
|
|
120
|
+
])
|
|
115
121
|
|
|
116
|
-
if res is not None:
|
|
117
|
-
|
|
118
|
-
|
|
122
|
+
if res is not None:
|
|
123
|
+
# handle response
|
|
124
|
+
pass
|
|
119
125
|
```
|
|
120
126
|
|
|
121
127
|
</br>
|
|
@@ -128,18 +134,19 @@ from mistralai import Mistral
|
|
|
128
134
|
import os
|
|
129
135
|
|
|
130
136
|
async def main():
|
|
131
|
-
|
|
137
|
+
async with Mistral(
|
|
132
138
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
) as s:
|
|
140
|
+
res = await s.chat.complete_async(model="mistral-small-latest", messages=[
|
|
141
|
+
{
|
|
142
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
143
|
+
"role": "user",
|
|
144
|
+
},
|
|
145
|
+
])
|
|
146
|
+
|
|
147
|
+
if res is not None:
|
|
148
|
+
# handle response
|
|
149
|
+
pass
|
|
143
150
|
|
|
144
151
|
asyncio.run(main())
|
|
145
152
|
```
|
|
@@ -153,18 +160,17 @@ This example shows how to upload a file.
|
|
|
153
160
|
from mistralai import Mistral
|
|
154
161
|
import os
|
|
155
162
|
|
|
156
|
-
|
|
163
|
+
with Mistral(
|
|
157
164
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
})
|
|
165
|
+
) as s:
|
|
166
|
+
res = s.files.upload(file={
|
|
167
|
+
"file_name": "example.file",
|
|
168
|
+
"content": open("example.file", "rb"),
|
|
169
|
+
})
|
|
164
170
|
|
|
165
|
-
if res is not None:
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
if res is not None:
|
|
172
|
+
# handle response
|
|
173
|
+
pass
|
|
168
174
|
```
|
|
169
175
|
|
|
170
176
|
</br>
|
|
@@ -177,16 +183,17 @@ from mistralai import Mistral
|
|
|
177
183
|
import os
|
|
178
184
|
|
|
179
185
|
async def main():
|
|
180
|
-
|
|
186
|
+
async with Mistral(
|
|
181
187
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
) as s:
|
|
189
|
+
res = await s.files.upload_async(file={
|
|
190
|
+
"file_name": "example.file",
|
|
191
|
+
"content": open("example.file", "rb"),
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
if res is not None:
|
|
195
|
+
# handle response
|
|
196
|
+
pass
|
|
190
197
|
|
|
191
198
|
asyncio.run(main())
|
|
192
199
|
```
|
|
@@ -200,20 +207,19 @@ This example shows how to create agents completions.
|
|
|
200
207
|
from mistralai import Mistral
|
|
201
208
|
import os
|
|
202
209
|
|
|
203
|
-
|
|
210
|
+
with Mistral(
|
|
204
211
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
205
|
-
)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
], agent_id="<value>")
|
|
212
|
+
) as s:
|
|
213
|
+
res = s.agents.complete(messages=[
|
|
214
|
+
{
|
|
215
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
216
|
+
"role": "user",
|
|
217
|
+
},
|
|
218
|
+
], agent_id="<value>")
|
|
213
219
|
|
|
214
|
-
if res is not None:
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
if res is not None:
|
|
221
|
+
# handle response
|
|
222
|
+
pass
|
|
217
223
|
```
|
|
218
224
|
|
|
219
225
|
</br>
|
|
@@ -226,18 +232,19 @@ from mistralai import Mistral
|
|
|
226
232
|
import os
|
|
227
233
|
|
|
228
234
|
async def main():
|
|
229
|
-
|
|
235
|
+
async with Mistral(
|
|
230
236
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
231
|
-
)
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
) as s:
|
|
238
|
+
res = await s.agents.complete_async(messages=[
|
|
239
|
+
{
|
|
240
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
241
|
+
"role": "user",
|
|
242
|
+
},
|
|
243
|
+
], agent_id="<value>")
|
|
244
|
+
|
|
245
|
+
if res is not None:
|
|
246
|
+
# handle response
|
|
247
|
+
pass
|
|
241
248
|
|
|
242
249
|
asyncio.run(main())
|
|
243
250
|
```
|
|
@@ -251,18 +258,17 @@ This example shows how to create embedding request.
|
|
|
251
258
|
from mistralai import Mistral
|
|
252
259
|
import os
|
|
253
260
|
|
|
254
|
-
|
|
261
|
+
with Mistral(
|
|
255
262
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
256
|
-
)
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
], model="Wrangler")
|
|
263
|
+
) as s:
|
|
264
|
+
res = s.embeddings.create(inputs=[
|
|
265
|
+
"Embed this sentence.",
|
|
266
|
+
"As well as this one.",
|
|
267
|
+
], model="Wrangler")
|
|
262
268
|
|
|
263
|
-
if res is not None:
|
|
264
|
-
|
|
265
|
-
|
|
269
|
+
if res is not None:
|
|
270
|
+
# handle response
|
|
271
|
+
pass
|
|
266
272
|
```
|
|
267
273
|
|
|
268
274
|
</br>
|
|
@@ -275,16 +281,17 @@ from mistralai import Mistral
|
|
|
275
281
|
import os
|
|
276
282
|
|
|
277
283
|
async def main():
|
|
278
|
-
|
|
284
|
+
async with Mistral(
|
|
279
285
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
280
|
-
)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
) as s:
|
|
287
|
+
res = await s.embeddings.create_async(inputs=[
|
|
288
|
+
"Embed this sentence.",
|
|
289
|
+
"As well as this one.",
|
|
290
|
+
], model="Wrangler")
|
|
291
|
+
|
|
292
|
+
if res is not None:
|
|
293
|
+
# handle response
|
|
294
|
+
pass
|
|
288
295
|
|
|
289
296
|
asyncio.run(main())
|
|
290
297
|
```
|
|
@@ -427,6 +434,7 @@ The documentation for the GCP SDK is available [here](https://github.com/mistral
|
|
|
427
434
|
* [retrieve](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#retrieve) - Retrieve File
|
|
428
435
|
* [delete](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#delete) - Delete File
|
|
429
436
|
* [download](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#download) - Download File
|
|
437
|
+
* [get_signed_url](https://github.com/mistralai/client-python/blob/master/docs/sdks/files/README.md#get_signed_url) - Get Signed Url
|
|
430
438
|
|
|
431
439
|
### [fim](https://github.com/mistralai/client-python/blob/master/docs/sdks/fim/README.md)
|
|
432
440
|
|
|
@@ -464,32 +472,36 @@ The documentation for the GCP SDK is available [here](https://github.com/mistral
|
|
|
464
472
|
operations. These operations will expose the stream as [Generator][generator] that
|
|
465
473
|
can be consumed using a simple `for` loop. The loop will
|
|
466
474
|
terminate when the server no longer has any events to send and closes the
|
|
467
|
-
underlying connection.
|
|
475
|
+
underlying connection.
|
|
476
|
+
|
|
477
|
+
The stream is also a [Context Manager][context-manager] and can be used with the `with` statement and will close the
|
|
478
|
+
underlying connection when the context is exited.
|
|
468
479
|
|
|
469
480
|
```python
|
|
470
481
|
from mistralai import Mistral
|
|
471
482
|
import os
|
|
472
483
|
|
|
473
|
-
|
|
484
|
+
with Mistral(
|
|
474
485
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
475
|
-
)
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
])
|
|
486
|
+
) as s:
|
|
487
|
+
res = s.chat.stream(model="mistral-small-latest", messages=[
|
|
488
|
+
{
|
|
489
|
+
"content": "Who is the best French painter? Answer in one short sentence.",
|
|
490
|
+
"role": "user",
|
|
491
|
+
},
|
|
492
|
+
])
|
|
483
493
|
|
|
484
|
-
if res is not None:
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
494
|
+
if res is not None:
|
|
495
|
+
with res as event_stream:
|
|
496
|
+
for event in event_stream:
|
|
497
|
+
# handle event
|
|
498
|
+
print(event, flush=True)
|
|
488
499
|
|
|
489
500
|
```
|
|
490
501
|
|
|
491
502
|
[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
|
|
492
|
-
[generator]: https://
|
|
503
|
+
[generator]: https://book.pythontips.com/en/latest/generators.html
|
|
504
|
+
[context-manager]: https://book.pythontips.com/en/latest/context_managers.html
|
|
493
505
|
<!-- End Server-sent event streaming [eventstream] -->
|
|
494
506
|
|
|
495
507
|
<!-- Start File uploads [file-upload] -->
|
|
@@ -506,18 +518,17 @@ Certain SDK methods accept file objects as part of a request body or multi-part
|
|
|
506
518
|
from mistralai import Mistral
|
|
507
519
|
import os
|
|
508
520
|
|
|
509
|
-
|
|
521
|
+
with Mistral(
|
|
510
522
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
511
|
-
)
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
})
|
|
523
|
+
) as s:
|
|
524
|
+
res = s.files.upload(file={
|
|
525
|
+
"file_name": "example.file",
|
|
526
|
+
"content": open("example.file", "rb"),
|
|
527
|
+
})
|
|
517
528
|
|
|
518
|
-
if res is not None:
|
|
519
|
-
|
|
520
|
-
|
|
529
|
+
if res is not None:
|
|
530
|
+
# handle response
|
|
531
|
+
pass
|
|
521
532
|
|
|
522
533
|
```
|
|
523
534
|
<!-- End File uploads [file-upload] -->
|
|
@@ -533,16 +544,15 @@ from mistral.utils import BackoffStrategy, RetryConfig
|
|
|
533
544
|
from mistralai import Mistral
|
|
534
545
|
import os
|
|
535
546
|
|
|
536
|
-
|
|
547
|
+
with Mistral(
|
|
537
548
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
538
|
-
)
|
|
549
|
+
) as s:
|
|
550
|
+
res = s.models.list(,
|
|
551
|
+
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
|
|
539
552
|
|
|
540
|
-
res
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
if res is not None:
|
|
544
|
-
# handle response
|
|
545
|
-
pass
|
|
553
|
+
if res is not None:
|
|
554
|
+
# handle response
|
|
555
|
+
pass
|
|
546
556
|
|
|
547
557
|
```
|
|
548
558
|
|
|
@@ -552,16 +562,15 @@ from mistral.utils import BackoffStrategy, RetryConfig
|
|
|
552
562
|
from mistralai import Mistral
|
|
553
563
|
import os
|
|
554
564
|
|
|
555
|
-
|
|
565
|
+
with Mistral(
|
|
556
566
|
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
|
|
557
567
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
558
|
-
)
|
|
559
|
-
|
|
560
|
-
res = s.models.list()
|
|
568
|
+
) as s:
|
|
569
|
+
res = s.models.list()
|
|
561
570
|
|
|
562
|
-
if res is not None:
|
|
563
|
-
|
|
564
|
-
|
|
571
|
+
if res is not None:
|
|
572
|
+
# handle response
|
|
573
|
+
pass
|
|
565
574
|
|
|
566
575
|
```
|
|
567
576
|
<!-- End Retries [retries] -->
|
|
@@ -593,24 +602,23 @@ When custom error responses are specified for an operation, the SDK may also rai
|
|
|
593
602
|
from mistralai import Mistral, models
|
|
594
603
|
import os
|
|
595
604
|
|
|
596
|
-
|
|
605
|
+
with Mistral(
|
|
597
606
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
598
|
-
)
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
raise(e)
|
|
607
|
+
) as s:
|
|
608
|
+
res = None
|
|
609
|
+
try:
|
|
610
|
+
res = s.models.list()
|
|
611
|
+
|
|
612
|
+
if res is not None:
|
|
613
|
+
# handle response
|
|
614
|
+
pass
|
|
615
|
+
|
|
616
|
+
except models.HTTPValidationError as e:
|
|
617
|
+
# handle e.data: models.HTTPValidationErrorData
|
|
618
|
+
raise(e)
|
|
619
|
+
except models.SDKError as e:
|
|
620
|
+
# handle exception
|
|
621
|
+
raise(e)
|
|
614
622
|
```
|
|
615
623
|
<!-- End Error Handling [errors] -->
|
|
616
624
|
|
|
@@ -631,16 +639,15 @@ You can override the default server globally by passing a server name to the `se
|
|
|
631
639
|
from mistralai import Mistral
|
|
632
640
|
import os
|
|
633
641
|
|
|
634
|
-
|
|
642
|
+
with Mistral(
|
|
635
643
|
server="eu",
|
|
636
644
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
637
|
-
)
|
|
638
|
-
|
|
639
|
-
res = s.models.list()
|
|
645
|
+
) as s:
|
|
646
|
+
res = s.models.list()
|
|
640
647
|
|
|
641
|
-
if res is not None:
|
|
642
|
-
|
|
643
|
-
|
|
648
|
+
if res is not None:
|
|
649
|
+
# handle response
|
|
650
|
+
pass
|
|
644
651
|
|
|
645
652
|
```
|
|
646
653
|
|
|
@@ -651,16 +658,15 @@ The default server can also be overridden globally by passing a URL to the `serv
|
|
|
651
658
|
from mistralai import Mistral
|
|
652
659
|
import os
|
|
653
660
|
|
|
654
|
-
|
|
661
|
+
with Mistral(
|
|
655
662
|
server_url="https://api.mistral.ai",
|
|
656
663
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
657
|
-
)
|
|
658
|
-
|
|
659
|
-
res = s.models.list()
|
|
664
|
+
) as s:
|
|
665
|
+
res = s.models.list()
|
|
660
666
|
|
|
661
|
-
if res is not None:
|
|
662
|
-
|
|
663
|
-
|
|
667
|
+
if res is not None:
|
|
668
|
+
# handle response
|
|
669
|
+
pass
|
|
664
670
|
|
|
665
671
|
```
|
|
666
672
|
<!-- End Server Selection [server] -->
|
|
@@ -762,15 +768,14 @@ To authenticate with the API the `api_key` parameter must be set when initializi
|
|
|
762
768
|
from mistralai import Mistral
|
|
763
769
|
import os
|
|
764
770
|
|
|
765
|
-
|
|
771
|
+
with Mistral(
|
|
766
772
|
api_key=os.getenv("MISTRAL_API_KEY", ""),
|
|
767
|
-
)
|
|
768
|
-
|
|
769
|
-
res = s.models.list()
|
|
773
|
+
) as s:
|
|
774
|
+
res = s.models.list()
|
|
770
775
|
|
|
771
|
-
if res is not None:
|
|
772
|
-
|
|
773
|
-
|
|
776
|
+
if res is not None:
|
|
777
|
+
# handle response
|
|
778
|
+
pass
|
|
774
779
|
|
|
775
780
|
```
|
|
776
781
|
<!-- End Authentication [security] -->
|