@mistralai/mistralai 0.5.0 → 1.0.0-rc.2
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.
- package/.devcontainer/README.md +35 -0
- package/LICENSE +1 -1
- package/README.md +429 -92
- package/docs/sdks/chat/README.md +114 -0
- package/docs/sdks/embeddings/README.md +56 -0
- package/docs/sdks/files/README.md +191 -0
- package/docs/sdks/fim/README.md +106 -0
- package/docs/sdks/finetuning/README.md +235 -0
- package/docs/sdks/mistral/README.md +9 -0
- package/docs/sdks/models/README.md +280 -0
- package/examples/README.md +29 -0
- package/examples/src/async_chat_no_streaming.ts +15 -0
- package/examples/src/async_chat_streaming.ts +27 -0
- package/examples/src/async_embeddings.ts +20 -0
- package/examples/src/async_files.ts +28 -0
- package/examples/src/async_function_calling.ts +147 -0
- package/examples/src/async_jobs.ts +44 -0
- package/examples/src/async_json_format.ts +16 -0
- package/examples/src/async_list_models.ts +14 -0
- package/examples/src/azure/async_chat_no_streaming.ts +27 -0
- package/examples/src/gcp/async_chat_no_streaming.ts +23 -0
- package/examples/test.ts +35 -0
- package/hooks/custom_user_agent.d.ts +5 -0
- package/hooks/custom_user_agent.d.ts.map +1 -0
- package/hooks/custom_user_agent.js +13 -0
- package/hooks/custom_user_agent.js.map +1 -0
- package/hooks/deprecation_warning.d.ts +5 -0
- package/hooks/deprecation_warning.d.ts.map +1 -0
- package/hooks/deprecation_warning.js +17 -0
- package/hooks/deprecation_warning.js.map +1 -0
- package/hooks/hooks.d.ts +24 -0
- package/hooks/hooks.d.ts.map +1 -0
- package/hooks/hooks.js +68 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/hooks/index.js +22 -0
- package/hooks/index.js.map +1 -0
- package/hooks/registration.d.ts +3 -0
- package/hooks/registration.d.ts.map +1 -0
- package/hooks/registration.js +20 -0
- package/hooks/registration.js.map +1 -0
- package/hooks/types.d.ts +72 -0
- package/hooks/types.d.ts.map +1 -0
- package/hooks/types.js +6 -0
- package/hooks/types.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +22 -0
- package/index.js.map +1 -0
- package/lib/base64.d.ts +10 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +61 -0
- package/lib/base64.js.map +1 -0
- package/lib/config.d.ts +38 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +37 -0
- package/lib/config.js.map +1 -0
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +49 -0
- package/lib/dlv.js.map +1 -0
- package/lib/encodings.d.ts +51 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +343 -0
- package/lib/encodings.js.map +1 -0
- package/lib/env.d.ts +14 -0
- package/lib/env.d.ts.map +1 -0
- package/lib/env.js +57 -0
- package/lib/env.js.map +1 -0
- package/lib/event-streams.d.ts +17 -0
- package/lib/event-streams.d.ts.map +1 -0
- package/lib/event-streams.js +212 -0
- package/lib/event-streams.js.map +1 -0
- package/lib/http.d.ts +108 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +350 -0
- package/lib/http.js.map +1 -0
- package/lib/is-plain-object.d.ts +2 -0
- package/lib/is-plain-object.d.ts.map +1 -0
- package/lib/is-plain-object.js +41 -0
- package/lib/is-plain-object.js.map +1 -0
- package/lib/primitives.d.ts +16 -0
- package/lib/primitives.d.ts.map +1 -0
- package/lib/primitives.js +29 -0
- package/lib/primitives.js.map +1 -0
- package/lib/retries.d.ts +18 -0
- package/lib/retries.d.ts.map +1 -0
- package/lib/retries.js +156 -0
- package/lib/retries.js.map +1 -0
- package/lib/schemas.d.ts +11 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +44 -0
- package/lib/schemas.js.map +1 -0
- package/lib/sdks.d.ts +61 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +132 -0
- package/lib/sdks.js.map +1 -0
- package/lib/security.d.ts +58 -0
- package/lib/security.d.ts.map +1 -0
- package/lib/security.js +124 -0
- package/lib/security.js.map +1 -0
- package/lib/url.d.ts +5 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/url.js +25 -0
- package/lib/url.js.map +1 -0
- package/models/components/archiveftmodelout.d.ts +29 -0
- package/models/components/archiveftmodelout.d.ts.map +1 -0
- package/models/components/archiveftmodelout.js +54 -0
- package/models/components/archiveftmodelout.js.map +1 -0
- package/models/components/assistantmessage.d.ts +58 -0
- package/models/components/assistantmessage.d.ts.map +1 -0
- package/models/components/assistantmessage.js +88 -0
- package/models/components/assistantmessage.js.map +1 -0
- package/models/components/chatcompletionchoice.d.ts +119 -0
- package/models/components/chatcompletionchoice.d.ts.map +1 -0
- package/models/components/chatcompletionchoice.js +132 -0
- package/models/components/chatcompletionchoice.js.map +1 -0
- package/models/components/chatcompletionrequest.d.ts +187 -0
- package/models/components/chatcompletionrequest.d.ts.map +1 -0
- package/models/components/chatcompletionrequest.js +181 -0
- package/models/components/chatcompletionrequest.js.map +1 -0
- package/models/components/chatcompletionresponse.d.ts +37 -0
- package/models/components/chatcompletionresponse.d.ts.map +1 -0
- package/models/components/chatcompletionresponse.js +62 -0
- package/models/components/chatcompletionresponse.js.map +1 -0
- package/models/components/chatcompletionstreamrequest.d.ts +184 -0
- package/models/components/chatcompletionstreamrequest.d.ts.map +1 -0
- package/models/components/chatcompletionstreamrequest.js +175 -0
- package/models/components/chatcompletionstreamrequest.js.map +1 -0
- package/models/components/checkpointout.d.ts +39 -0
- package/models/components/checkpointout.d.ts.map +1 -0
- package/models/components/checkpointout.js +70 -0
- package/models/components/checkpointout.js.map +1 -0
- package/models/components/completionchunk.d.ts +37 -0
- package/models/components/completionchunk.d.ts.map +1 -0
- package/models/components/completionchunk.js +62 -0
- package/models/components/completionchunk.js.map +1 -0
- package/models/components/completionevent.d.ts +26 -0
- package/models/components/completionevent.d.ts.map +1 -0
- package/models/components/completionevent.js +65 -0
- package/models/components/completionevent.js.map +1 -0
- package/models/components/completionresponsestreamchoice.d.ts +62 -0
- package/models/components/completionresponsestreamchoice.d.ts.map +1 -0
- package/models/components/completionresponsestreamchoice.js +89 -0
- package/models/components/completionresponsestreamchoice.js.map +1 -0
- package/models/components/contentchunk.d.ts +27 -0
- package/models/components/contentchunk.d.ts.map +1 -0
- package/models/components/contentchunk.js +52 -0
- package/models/components/contentchunk.js.map +1 -0
- package/models/components/deletefileout.d.ts +38 -0
- package/models/components/deletefileout.d.ts.map +1 -0
- package/models/components/deletefileout.js +54 -0
- package/models/components/deletefileout.js.map +1 -0
- package/models/components/deletemodelout.d.ts +38 -0
- package/models/components/deletemodelout.d.ts.map +1 -0
- package/models/components/deletemodelout.js +54 -0
- package/models/components/deletemodelout.js.map +1 -0
- package/models/components/deltamessage.d.ts +30 -0
- package/models/components/deltamessage.d.ts.map +1 -0
- package/models/components/deltamessage.js +68 -0
- package/models/components/deltamessage.js.map +1 -0
- package/models/components/detailedjobout.d.ts +124 -0
- package/models/components/detailedjobout.d.ts.map +1 -0
- package/models/components/detailedjobout.js +147 -0
- package/models/components/detailedjobout.js.map +1 -0
- package/models/components/embeddingrequest.d.ts +60 -0
- package/models/components/embeddingrequest.d.ts.map +1 -0
- package/models/components/embeddingrequest.js +90 -0
- package/models/components/embeddingrequest.js.map +1 -0
- package/models/components/embeddingresponse.d.ts +35 -0
- package/models/components/embeddingresponse.d.ts.map +1 -0
- package/models/components/embeddingresponse.js +60 -0
- package/models/components/embeddingresponse.js.map +1 -0
- package/models/components/embeddingresponsedata.d.ts +29 -0
- package/models/components/embeddingresponsedata.d.ts.map +1 -0
- package/models/components/embeddingresponsedata.js +54 -0
- package/models/components/embeddingresponsedata.js.map +1 -0
- package/models/components/eventout.d.ts +39 -0
- package/models/components/eventout.d.ts.map +1 -0
- package/models/components/eventout.js +67 -0
- package/models/components/eventout.js.map +1 -0
- package/models/components/fileschema.d.ts +61 -0
- package/models/components/fileschema.d.ts.map +1 -0
- package/models/components/fileschema.js +85 -0
- package/models/components/fileschema.js.map +1 -0
- package/models/components/fimcompletionrequest.d.ts +99 -0
- package/models/components/fimcompletionrequest.d.ts.map +1 -0
- package/models/components/fimcompletionrequest.js +102 -0
- package/models/components/fimcompletionrequest.js.map +1 -0
- package/models/components/fimcompletionresponse.d.ts +37 -0
- package/models/components/fimcompletionresponse.d.ts.map +1 -0
- package/models/components/fimcompletionresponse.js +62 -0
- package/models/components/fimcompletionresponse.js.map +1 -0
- package/models/components/fimcompletionstreamrequest.d.ts +96 -0
- package/models/components/fimcompletionstreamrequest.d.ts.map +1 -0
- package/models/components/fimcompletionstreamrequest.js +102 -0
- package/models/components/fimcompletionstreamrequest.js.map +1 -0
- package/models/components/finetuneablemodel.d.ts +43 -0
- package/models/components/finetuneablemodel.d.ts.map +1 -0
- package/models/components/finetuneablemodel.js +56 -0
- package/models/components/finetuneablemodel.js.map +1 -0
- package/models/components/ftmodelcapabilitiesout.d.ts +31 -0
- package/models/components/ftmodelcapabilitiesout.d.ts.map +1 -0
- package/models/components/ftmodelcapabilitiesout.js +75 -0
- package/models/components/ftmodelcapabilitiesout.js.map +1 -0
- package/models/components/ftmodelout.d.ts +48 -0
- package/models/components/ftmodelout.d.ts.map +1 -0
- package/models/components/ftmodelout.js +88 -0
- package/models/components/ftmodelout.js.map +1 -0
- package/models/components/function.d.ts +33 -0
- package/models/components/function.d.ts.map +1 -0
- package/models/components/function.js +54 -0
- package/models/components/function.js.map +1 -0
- package/models/components/functioncall.d.ts +27 -0
- package/models/components/functioncall.d.ts.map +1 -0
- package/models/components/functioncall.js +52 -0
- package/models/components/functioncall.js.map +1 -0
- package/models/components/githubrepositoryin.d.ts +35 -0
- package/models/components/githubrepositoryin.d.ts.map +1 -0
- package/models/components/githubrepositoryin.js +60 -0
- package/models/components/githubrepositoryin.js.map +1 -0
- package/models/components/githubrepositoryout.d.ts +35 -0
- package/models/components/githubrepositoryout.d.ts.map +1 -0
- package/models/components/githubrepositoryout.js +73 -0
- package/models/components/githubrepositoryout.js.map +1 -0
- package/models/components/index.d.ts +62 -0
- package/models/components/index.d.ts.map +1 -0
- package/models/components/index.js +81 -0
- package/models/components/index.js.map +1 -0
- package/models/components/jobin.d.ts +62 -0
- package/models/components/jobin.d.ts.map +1 -0
- package/models/components/jobin.js +86 -0
- package/models/components/jobin.js.map +1 -0
- package/models/components/jobmetadataout.d.ts +37 -0
- package/models/components/jobmetadataout.d.ts.map +1 -0
- package/models/components/jobmetadataout.js +85 -0
- package/models/components/jobmetadataout.js.map +1 -0
- package/models/components/jobout.d.ts +157 -0
- package/models/components/jobout.d.ts.map +1 -0
- package/models/components/jobout.js +144 -0
- package/models/components/jobout.js.map +1 -0
- package/models/components/jobsout.d.ts +30 -0
- package/models/components/jobsout.d.ts.map +1 -0
- package/models/components/jobsout.js +55 -0
- package/models/components/jobsout.js.map +1 -0
- package/models/components/legacyjobmetadataout.d.ts +71 -0
- package/models/components/legacyjobmetadataout.d.ts.map +1 -0
- package/models/components/legacyjobmetadataout.js +97 -0
- package/models/components/legacyjobmetadataout.js.map +1 -0
- package/models/components/listfilesout.d.ts +28 -0
- package/models/components/listfilesout.d.ts.map +1 -0
- package/models/components/listfilesout.js +53 -0
- package/models/components/listfilesout.js.map +1 -0
- package/models/components/metricout.d.ts +32 -0
- package/models/components/metricout.d.ts.map +1 -0
- package/models/components/metricout.js +71 -0
- package/models/components/metricout.js.map +1 -0
- package/models/components/modelcapabilities.d.ts +31 -0
- package/models/components/modelcapabilities.d.ts.map +1 -0
- package/models/components/modelcapabilities.js +75 -0
- package/models/components/modelcapabilities.js.map +1 -0
- package/models/components/modelcard.d.ts +48 -0
- package/models/components/modelcard.d.ts.map +1 -0
- package/models/components/modelcard.js +93 -0
- package/models/components/modelcard.js.map +1 -0
- package/models/components/modellist.d.ts +28 -0
- package/models/components/modellist.d.ts.map +1 -0
- package/models/components/modellist.js +53 -0
- package/models/components/modellist.js.map +1 -0
- package/models/components/responseformat.d.ts +57 -0
- package/models/components/responseformat.d.ts.map +1 -0
- package/models/components/responseformat.js +72 -0
- package/models/components/responseformat.js.map +1 -0
- package/models/components/retrievefileout.d.ts +61 -0
- package/models/components/retrievefileout.d.ts.map +1 -0
- package/models/components/retrievefileout.js +85 -0
- package/models/components/retrievefileout.js.map +1 -0
- package/models/components/sampletype.d.ts +28 -0
- package/models/components/sampletype.d.ts.map +1 -0
- package/models/components/sampletype.js +50 -0
- package/models/components/sampletype.js.map +1 -0
- package/models/components/security.d.ts +25 -0
- package/models/components/security.d.ts.map +1 -0
- package/models/components/security.js +63 -0
- package/models/components/security.js.map +1 -0
- package/models/components/source.d.ts +28 -0
- package/models/components/source.d.ts.map +1 -0
- package/models/components/source.js +50 -0
- package/models/components/source.js.map +1 -0
- package/models/components/systemmessage.d.ts +70 -0
- package/models/components/systemmessage.d.ts.map +1 -0
- package/models/components/systemmessage.js +92 -0
- package/models/components/systemmessage.js.map +1 -0
- package/models/components/textchunk.d.ts +27 -0
- package/models/components/textchunk.d.ts.map +1 -0
- package/models/components/textchunk.js +52 -0
- package/models/components/textchunk.js.map +1 -0
- package/models/components/tool.d.ts +28 -0
- package/models/components/tool.d.ts.map +1 -0
- package/models/components/tool.js +53 -0
- package/models/components/tool.js.map +1 -0
- package/models/components/toolcall.d.ts +30 -0
- package/models/components/toolcall.d.ts.map +1 -0
- package/models/components/toolcall.js +55 -0
- package/models/components/toolcall.js.map +1 -0
- package/models/components/toolmessage.d.ts +54 -0
- package/models/components/toolmessage.d.ts.map +1 -0
- package/models/components/toolmessage.js +87 -0
- package/models/components/toolmessage.js.map +1 -0
- package/models/components/trainingfile.d.ts +27 -0
- package/models/components/trainingfile.d.ts.map +1 -0
- package/models/components/trainingfile.js +65 -0
- package/models/components/trainingfile.js.map +1 -0
- package/models/components/trainingparameters.d.ts +31 -0
- package/models/components/trainingparameters.d.ts.map +1 -0
- package/models/components/trainingparameters.js +73 -0
- package/models/components/trainingparameters.js.map +1 -0
- package/models/components/trainingparametersin.d.ts +40 -0
- package/models/components/trainingparametersin.d.ts.map +1 -0
- package/models/components/trainingparametersin.js +73 -0
- package/models/components/trainingparametersin.js.map +1 -0
- package/models/components/unarchiveftmodelout.d.ts +29 -0
- package/models/components/unarchiveftmodelout.d.ts.map +1 -0
- package/models/components/unarchiveftmodelout.js +54 -0
- package/models/components/unarchiveftmodelout.js.map +1 -0
- package/models/components/updateftmodelin.d.ts +27 -0
- package/models/components/updateftmodelin.d.ts.map +1 -0
- package/models/components/updateftmodelin.js +52 -0
- package/models/components/updateftmodelin.js.map +1 -0
- package/models/components/uploadfileout.d.ts +61 -0
- package/models/components/uploadfileout.d.ts.map +1 -0
- package/models/components/uploadfileout.js +85 -0
- package/models/components/uploadfileout.js.map +1 -0
- package/models/components/usageinfo.d.ts +29 -0
- package/models/components/usageinfo.d.ts.map +1 -0
- package/models/components/usageinfo.js +71 -0
- package/models/components/usageinfo.js.map +1 -0
- package/models/components/usermessage.d.ts +70 -0
- package/models/components/usermessage.d.ts.map +1 -0
- package/models/components/usermessage.js +86 -0
- package/models/components/usermessage.js.map +1 -0
- package/models/components/validationerror.d.ts +48 -0
- package/models/components/validationerror.d.ts.map +1 -0
- package/models/components/validationerror.js +75 -0
- package/models/components/validationerror.js.map +1 -0
- package/models/components/wandbintegration.d.ts +42 -0
- package/models/components/wandbintegration.d.ts.map +1 -0
- package/models/components/wandbintegration.js +73 -0
- package/models/components/wandbintegration.js.map +1 -0
- package/models/components/wandbintegrationout.d.ts +37 -0
- package/models/components/wandbintegrationout.d.ts.map +1 -0
- package/models/components/wandbintegrationout.js +69 -0
- package/models/components/wandbintegrationout.js.map +1 -0
- package/models/errors/httpvalidationerror.d.ts +38 -0
- package/models/errors/httpvalidationerror.d.ts.map +1 -0
- package/models/errors/httpvalidationerror.js +75 -0
- package/models/errors/httpvalidationerror.js.map +1 -0
- package/models/errors/index.d.ts +4 -0
- package/models/errors/index.d.ts.map +1 -0
- package/models/errors/index.js +23 -0
- package/models/errors/index.js.map +1 -0
- package/models/errors/sdkerror.d.ts +8 -0
- package/models/errors/sdkerror.d.ts.map +1 -0
- package/models/errors/sdkerror.js +21 -0
- package/models/errors/sdkerror.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +17 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/models/errors/sdkvalidationerror.js +107 -0
- package/models/errors/sdkvalidationerror.js.map +1 -0
- package/models/operations/deletemodelv1modelsmodeliddelete.d.ts +25 -0
- package/models/operations/deletemodelv1modelsmodeliddelete.d.ts.map +1 -0
- package/models/operations/deletemodelv1modelsmodeliddelete.js +63 -0
- package/models/operations/deletemodelv1modelsmodeliddelete.js.map +1 -0
- package/models/operations/filesapiroutesdeletefile.d.ts +25 -0
- package/models/operations/filesapiroutesdeletefile.d.ts.map +1 -0
- package/models/operations/filesapiroutesdeletefile.js +63 -0
- package/models/operations/filesapiroutesdeletefile.js.map +1 -0
- package/models/operations/filesapiroutesretrievefile.d.ts +25 -0
- package/models/operations/filesapiroutesretrievefile.d.ts.map +1 -0
- package/models/operations/filesapiroutesretrievefile.js +63 -0
- package/models/operations/filesapiroutesretrievefile.js.map +1 -0
- package/models/operations/filesapiroutesuploadfile.d.ts +65 -0
- package/models/operations/filesapiroutesuploadfile.d.ts.map +1 -0
- package/models/operations/filesapiroutesuploadfile.js +75 -0
- package/models/operations/filesapiroutesuploadfile.js.map +1 -0
- package/models/operations/index.d.ts +14 -0
- package/models/operations/index.d.ts.map +1 -0
- package/models/operations/index.js +33 -0
- package/models/operations/index.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuningarchivefinetunedmodel.d.ts +25 -0
- package/models/operations/jobsapiroutesfinetuningarchivefinetunedmodel.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuningarchivefinetunedmodel.js +63 -0
- package/models/operations/jobsapiroutesfinetuningarchivefinetunedmodel.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuningcancelfinetuningjob.d.ts +28 -0
- package/models/operations/jobsapiroutesfinetuningcancelfinetuningjob.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuningcancelfinetuningjob.js +63 -0
- package/models/operations/jobsapiroutesfinetuningcancelfinetuningjob.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuningcreatefinetuningjob.d.ts +59 -0
- package/models/operations/jobsapiroutesfinetuningcreatefinetuningjob.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuningcreatefinetuningjob.js +83 -0
- package/models/operations/jobsapiroutesfinetuningcreatefinetuningjob.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjob.d.ts +28 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjob.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjob.js +63 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjob.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.d.ts +124 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.js +122 -0
- package/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuningstartfinetuningjob.d.ts +25 -0
- package/models/operations/jobsapiroutesfinetuningstartfinetuningjob.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuningstartfinetuningjob.js +63 -0
- package/models/operations/jobsapiroutesfinetuningstartfinetuningjob.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuningunarchivefinetunedmodel.d.ts +25 -0
- package/models/operations/jobsapiroutesfinetuningunarchivefinetunedmodel.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuningunarchivefinetunedmodel.js +63 -0
- package/models/operations/jobsapiroutesfinetuningunarchivefinetunedmodel.js.map +1 -0
- package/models/operations/jobsapiroutesfinetuningupdatefinetunedmodel.d.ts +28 -0
- package/models/operations/jobsapiroutesfinetuningupdatefinetunedmodel.d.ts.map +1 -0
- package/models/operations/jobsapiroutesfinetuningupdatefinetunedmodel.js +68 -0
- package/models/operations/jobsapiroutesfinetuningupdatefinetunedmodel.js.map +1 -0
- package/models/operations/retrievemodelv1modelsmodelidget.d.ts +25 -0
- package/models/operations/retrievemodelv1modelsmodelidget.d.ts.map +1 -0
- package/models/operations/retrievemodelv1modelsmodelidget.js +63 -0
- package/models/operations/retrievemodelv1modelsmodelidget.js.map +1 -0
- package/package.json +22 -23
- package/packages/mistralai-azure/LICENSE +201 -0
- package/packages/mistralai-azure/README.md +459 -0
- package/packages/mistralai-azure/docs/sdks/chat/README.md +114 -0
- package/packages/mistralai-azure/docs/sdks/mistralazure/README.md +9 -0
- package/packages/mistralai-azure/src/hooks/custom_user_agent.ts +11 -0
- package/packages/mistralai-azure/src/hooks/hooks.ts +103 -0
- package/packages/mistralai-azure/src/hooks/index.ts +6 -0
- package/packages/mistralai-azure/src/hooks/registration.ts +15 -0
- package/packages/mistralai-azure/src/hooks/types.ts +89 -0
- package/packages/mistralai-azure/src/index.ts +6 -0
- package/packages/mistralai-azure/src/lib/base64.ts +37 -0
- package/packages/mistralai-azure/src/lib/config.ts +59 -0
- package/packages/mistralai-azure/src/lib/dlv.ts +53 -0
- package/packages/mistralai-azure/src/lib/encodings.ts +449 -0
- package/packages/mistralai-azure/src/lib/env.ts +37 -0
- package/packages/mistralai-azure/src/lib/event-streams.ts +253 -0
- package/packages/mistralai-azure/src/lib/http.ts +513 -0
- package/packages/mistralai-azure/src/lib/is-plain-object.ts +43 -0
- package/packages/mistralai-azure/src/lib/primitives.ts +40 -0
- package/packages/mistralai-azure/src/lib/retries.ts +226 -0
- package/packages/mistralai-azure/src/lib/schemas.ts +56 -0
- package/packages/mistralai-azure/src/lib/sdks.ts +210 -0
- package/packages/mistralai-azure/src/lib/security.ts +193 -0
- package/packages/mistralai-azure/src/lib/url.ts +33 -0
- package/packages/mistralai-azure/src/models/components/assistantmessage.ts +100 -0
- package/packages/mistralai-azure/src/models/components/chatcompletionchoice.ts +219 -0
- package/packages/mistralai-azure/src/models/components/chatcompletionrequest.ts +349 -0
- package/packages/mistralai-azure/src/models/components/chatcompletionresponse.ts +77 -0
- package/packages/mistralai-azure/src/models/components/chatcompletionstreamrequest.ts +335 -0
- package/packages/mistralai-azure/src/models/components/completionchunk.ts +74 -0
- package/packages/mistralai-azure/src/models/components/completionevent.ts +61 -0
- package/packages/mistralai-azure/src/models/components/completionresponsestreamchoice.ts +100 -0
- package/packages/mistralai-azure/src/models/components/contentchunk.ts +45 -0
- package/packages/mistralai-azure/src/models/components/deltamessage.ts +68 -0
- package/packages/mistralai-azure/src/models/components/function.ts +46 -0
- package/packages/mistralai-azure/src/models/components/functioncall.ts +45 -0
- package/packages/mistralai-azure/src/models/components/index.ts +26 -0
- package/packages/mistralai-azure/src/models/components/responseformat.ts +74 -0
- package/packages/mistralai-azure/src/models/components/security.ts +50 -0
- package/packages/mistralai-azure/src/models/components/systemmessage.ts +105 -0
- package/packages/mistralai-azure/src/models/components/textchunk.ts +42 -0
- package/packages/mistralai-azure/src/models/components/tool.ts +47 -0
- package/packages/mistralai-azure/src/models/components/toolcall.ts +52 -0
- package/packages/mistralai-azure/src/models/components/toolmessage.ts +91 -0
- package/packages/mistralai-azure/src/models/components/usageinfo.ts +62 -0
- package/packages/mistralai-azure/src/models/components/usermessage.ts +108 -0
- package/packages/mistralai-azure/src/models/components/validationerror.ts +80 -0
- package/packages/mistralai-azure/src/models/errors/httpvalidationerror.ts +83 -0
- package/packages/mistralai-azure/src/models/errors/index.ts +7 -0
- package/packages/mistralai-azure/src/models/errors/sdkerror.ts +25 -0
- package/packages/mistralai-azure/src/models/errors/sdkvalidationerror.ts +95 -0
- package/packages/mistralai-azure/src/sdk/chat.ts +197 -0
- package/packages/mistralai-azure/src/sdk/index.ts +5 -0
- package/packages/mistralai-azure/src/sdk/sdk.ts +57 -0
- package/packages/mistralai-azure/src/types/blobs.ts +31 -0
- package/packages/mistralai-azure/src/types/enums.ts +16 -0
- package/packages/mistralai-azure/src/types/index.ts +10 -0
- package/packages/mistralai-azure/src/types/operations.ts +25 -0
- package/packages/mistralai-azure/src/types/rfcdate.ts +54 -0
- package/packages/mistralai-gcp/LICENSE +201 -0
- package/packages/mistralai-gcp/README.md +465 -0
- package/packages/mistralai-gcp/docs/sdks/chat/README.md +114 -0
- package/packages/mistralai-gcp/docs/sdks/fim/README.md +58 -0
- package/packages/mistralai-gcp/docs/sdks/mistralgcp/README.md +9 -0
- package/packages/mistralai-gcp/src/hooks/custom_user_agent.ts +11 -0
- package/packages/mistralai-gcp/src/hooks/hooks.ts +103 -0
- package/packages/mistralai-gcp/src/hooks/index.ts +6 -0
- package/packages/mistralai-gcp/src/hooks/registration.ts +16 -0
- package/packages/mistralai-gcp/src/hooks/types.ts +89 -0
- package/packages/mistralai-gcp/src/index.ts +6 -0
- package/packages/mistralai-gcp/src/lib/base64.ts +37 -0
- package/packages/mistralai-gcp/src/lib/config.ts +59 -0
- package/packages/mistralai-gcp/src/lib/dlv.ts +53 -0
- package/packages/mistralai-gcp/src/lib/encodings.ts +449 -0
- package/packages/mistralai-gcp/src/lib/event-streams.ts +253 -0
- package/packages/mistralai-gcp/src/lib/http.ts +513 -0
- package/packages/mistralai-gcp/src/lib/is-plain-object.ts +43 -0
- package/packages/mistralai-gcp/src/lib/primitives.ts +40 -0
- package/packages/mistralai-gcp/src/lib/retries.ts +226 -0
- package/packages/mistralai-gcp/src/lib/schemas.ts +56 -0
- package/packages/mistralai-gcp/src/lib/sdks.ts +210 -0
- package/packages/mistralai-gcp/src/lib/security.ts +192 -0
- package/packages/mistralai-gcp/src/lib/url.ts +33 -0
- package/packages/mistralai-gcp/src/models/components/assistantmessage.ts +100 -0
- package/packages/mistralai-gcp/src/models/components/chatcompletionchoice.ts +219 -0
- package/packages/mistralai-gcp/src/models/components/chatcompletionrequest.ts +340 -0
- package/packages/mistralai-gcp/src/models/components/chatcompletionresponse.ts +77 -0
- package/packages/mistralai-gcp/src/models/components/chatcompletionstreamrequest.ts +326 -0
- package/packages/mistralai-gcp/src/models/components/completionchunk.ts +74 -0
- package/packages/mistralai-gcp/src/models/components/completionevent.ts +61 -0
- package/packages/mistralai-gcp/src/models/components/completionresponsestreamchoice.ts +100 -0
- package/packages/mistralai-gcp/src/models/components/contentchunk.ts +45 -0
- package/packages/mistralai-gcp/src/models/components/deltamessage.ts +68 -0
- package/packages/mistralai-gcp/src/models/components/fimcompletionrequest.ts +169 -0
- package/packages/mistralai-gcp/src/models/components/fimcompletionresponse.ts +77 -0
- package/packages/mistralai-gcp/src/models/components/fimcompletionstreamrequest.ts +166 -0
- package/packages/mistralai-gcp/src/models/components/function.ts +46 -0
- package/packages/mistralai-gcp/src/models/components/functioncall.ts +45 -0
- package/packages/mistralai-gcp/src/models/components/index.ts +29 -0
- package/packages/mistralai-gcp/src/models/components/responseformat.ts +74 -0
- package/packages/mistralai-gcp/src/models/components/security.ts +50 -0
- package/packages/mistralai-gcp/src/models/components/systemmessage.ts +105 -0
- package/packages/mistralai-gcp/src/models/components/textchunk.ts +42 -0
- package/packages/mistralai-gcp/src/models/components/tool.ts +47 -0
- package/packages/mistralai-gcp/src/models/components/toolcall.ts +52 -0
- package/packages/mistralai-gcp/src/models/components/toolmessage.ts +91 -0
- package/packages/mistralai-gcp/src/models/components/usageinfo.ts +62 -0
- package/packages/mistralai-gcp/src/models/components/usermessage.ts +108 -0
- package/packages/mistralai-gcp/src/models/components/validationerror.ts +80 -0
- package/packages/mistralai-gcp/src/models/errors/httpvalidationerror.ts +83 -0
- package/packages/mistralai-gcp/src/models/errors/index.ts +7 -0
- package/packages/mistralai-gcp/src/models/errors/sdkerror.ts +25 -0
- package/packages/mistralai-gcp/src/models/errors/sdkvalidationerror.ts +95 -0
- package/packages/mistralai-gcp/src/sdk/chat.ts +197 -0
- package/packages/mistralai-gcp/src/sdk/fim.ts +197 -0
- package/packages/mistralai-gcp/src/sdk/index.ts +5 -0
- package/packages/mistralai-gcp/src/sdk/sdk.ts +148 -0
- package/packages/mistralai-gcp/src/types/blobs.ts +31 -0
- package/packages/mistralai-gcp/src/types/enums.ts +16 -0
- package/packages/mistralai-gcp/src/types/index.ts +10 -0
- package/packages/mistralai-gcp/src/types/operations.ts +25 -0
- package/packages/mistralai-gcp/src/types/rfcdate.ts +54 -0
- package/sdk/chat.d.ts +23 -0
- package/sdk/chat.d.ts.map +1 -0
- package/sdk/chat.js +170 -0
- package/sdk/chat.js.map +1 -0
- package/sdk/embeddings.d.ts +15 -0
- package/sdk/embeddings.d.ts.map +1 -0
- package/sdk/embeddings.js +111 -0
- package/sdk/embeddings.js.map +1 -0
- package/sdk/files.d.ts +41 -0
- package/sdk/files.d.ts.map +1 -0
- package/sdk/files.js +260 -0
- package/sdk/files.js.map +1 -0
- package/sdk/fim.d.ts +23 -0
- package/sdk/fim.d.ts.map +1 -0
- package/sdk/fim.js +170 -0
- package/sdk/fim.js.map +1 -0
- package/sdk/finetuning.d.ts +44 -0
- package/sdk/finetuning.d.ts.map +1 -0
- package/sdk/finetuning.js +313 -0
- package/sdk/finetuning.js.map +1 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.d.ts.map +1 -0
- package/sdk/index.js +21 -0
- package/sdk/index.js.map +1 -0
- package/sdk/models.d.ts +51 -0
- package/sdk/models.d.ts.map +1 -0
- package/sdk/models.js +366 -0
- package/sdk/models.js.map +1 -0
- package/sdk/oldclient.d.ts +4 -0
- package/sdk/oldclient.d.ts.map +1 -0
- package/sdk/oldclient.js +10 -0
- package/sdk/oldclient.js.map +1 -0
- package/sdk/sdk.d.ts +25 -0
- package/sdk/sdk.d.ts.map +1 -0
- package/sdk/sdk.js +64 -0
- package/sdk/sdk.js.map +1 -0
- package/src/hooks/custom_user_agent.ts +11 -0
- package/src/hooks/deprecation_warning.ts +19 -0
- package/src/hooks/hooks.ts +103 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/registration.ts +22 -0
- package/src/hooks/types.ts +89 -0
- package/src/index.ts +6 -0
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +59 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +449 -0
- package/src/lib/env.ts +37 -0
- package/src/lib/event-streams.ts +253 -0
- package/src/lib/http.ts +513 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/primitives.ts +40 -0
- package/src/lib/retries.ts +226 -0
- package/src/lib/schemas.ts +56 -0
- package/src/lib/sdks.ts +210 -0
- package/src/lib/security.ts +193 -0
- package/src/lib/url.ts +33 -0
- package/src/models/components/archiveftmodelout.ts +50 -0
- package/src/models/components/assistantmessage.ts +100 -0
- package/src/models/components/chatcompletionchoice.ts +217 -0
- package/src/models/components/chatcompletionrequest.ts +338 -0
- package/src/models/components/chatcompletionresponse.ts +77 -0
- package/src/models/components/chatcompletionstreamrequest.ts +348 -0
- package/src/models/components/checkpointout.ts +79 -0
- package/src/models/components/completionchunk.ts +74 -0
- package/src/models/components/completionevent.ts +61 -0
- package/src/models/components/completionresponsestreamchoice.ts +104 -0
- package/src/models/components/contentchunk.ts +45 -0
- package/src/models/components/deletefileout.ts +59 -0
- package/src/models/components/deletemodelout.ts +59 -0
- package/src/models/components/deltamessage.ts +68 -0
- package/src/models/components/detailedjobout.ts +221 -0
- package/src/models/components/embeddingrequest.ts +106 -0
- package/src/models/components/embeddingresponse.ts +70 -0
- package/src/models/components/embeddingresponsedata.ts +53 -0
- package/src/models/components/eventout.ts +64 -0
- package/src/models/components/fileschema.ts +106 -0
- package/src/models/components/fimcompletionrequest.ts +169 -0
- package/src/models/components/fimcompletionresponse.ts +77 -0
- package/src/models/components/fimcompletionstreamrequest.ts +166 -0
- package/src/models/components/finetuneablemodel.ts +40 -0
- package/src/models/components/ftmodelcapabilitiesout.ts +76 -0
- package/src/models/components/ftmodelout.ts +102 -0
- package/src/models/components/function.ts +46 -0
- package/src/models/components/functioncall.ts +45 -0
- package/src/models/components/githubrepositoryin.ts +65 -0
- package/src/models/components/githubrepositoryout.ts +78 -0
- package/src/models/components/index.ts +65 -0
- package/src/models/components/jobin.ts +129 -0
- package/src/models/components/jobmetadataout.ts +88 -0
- package/src/models/components/jobout.ts +234 -0
- package/src/models/components/jobsout.ts +46 -0
- package/src/models/components/legacyjobmetadataout.ts +138 -0
- package/src/models/components/listfilesout.ts +51 -0
- package/src/models/components/metricout.ts +65 -0
- package/src/models/components/modelcapabilities.ts +73 -0
- package/src/models/components/modelcard.ts +109 -0
- package/src/models/components/modellist.ts +48 -0
- package/src/models/components/responseformat.ts +74 -0
- package/src/models/components/retrievefileout.ts +110 -0
- package/src/models/components/sampletype.ts +31 -0
- package/src/models/components/security.ts +50 -0
- package/src/models/components/source.ts +29 -0
- package/src/models/components/systemmessage.ts +105 -0
- package/src/models/components/textchunk.ts +42 -0
- package/src/models/components/tool.ts +47 -0
- package/src/models/components/toolcall.ts +52 -0
- package/src/models/components/toolmessage.ts +91 -0
- package/src/models/components/trainingfile.ts +58 -0
- package/src/models/components/trainingparameters.ts +74 -0
- package/src/models/components/trainingparametersin.ts +83 -0
- package/src/models/components/unarchiveftmodelout.ts +53 -0
- package/src/models/components/updateftmodelin.ts +46 -0
- package/src/models/components/uploadfileout.ts +110 -0
- package/src/models/components/usageinfo.ts +62 -0
- package/src/models/components/usermessage.ts +108 -0
- package/src/models/components/validationerror.ts +80 -0
- package/src/models/components/wandbintegration.ts +81 -0
- package/src/models/components/wandbintegrationout.ts +76 -0
- package/src/models/errors/httpvalidationerror.ts +83 -0
- package/src/models/errors/index.ts +7 -0
- package/src/models/errors/sdkerror.ts +25 -0
- package/src/models/errors/sdkvalidationerror.ts +95 -0
- package/src/models/operations/deletemodelv1modelsmodeliddelete.ts +58 -0
- package/src/models/operations/filesapiroutesdeletefile.ts +58 -0
- package/src/models/operations/filesapiroutesretrievefile.ts +58 -0
- package/src/models/operations/filesapiroutesuploadfile.ts +100 -0
- package/src/models/operations/index.ts +17 -0
- package/src/models/operations/jobsapiroutesfinetuningarchivefinetunedmodel.ts +59 -0
- package/src/models/operations/jobsapiroutesfinetuningcancelfinetuningjob.ts +61 -0
- package/src/models/operations/jobsapiroutesfinetuningcreatefinetuningjob.ts +113 -0
- package/src/models/operations/jobsapiroutesfinetuninggetfinetuningjob.ts +61 -0
- package/src/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.ts +170 -0
- package/src/models/operations/jobsapiroutesfinetuningstartfinetuningjob.ts +58 -0
- package/src/models/operations/jobsapiroutesfinetuningunarchivefinetunedmodel.ts +60 -0
- package/src/models/operations/jobsapiroutesfinetuningupdatefinetunedmodel.ts +65 -0
- package/src/models/operations/retrievemodelv1modelsmodelidget.ts +58 -0
- package/src/sdk/chat.ts +197 -0
- package/src/sdk/embeddings.ts +112 -0
- package/src/sdk/files.ts +319 -0
- package/src/sdk/fim.ts +197 -0
- package/src/sdk/finetuning.ts +422 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/models.ts +480 -0
- package/src/sdk/oldclient.ts +5 -0
- package/src/sdk/sdk.ts +72 -0
- package/src/types/blobs.ts +31 -0
- package/src/types/enums.ts +16 -0
- package/src/types/index.ts +10 -0
- package/src/types/operations.ts +25 -0
- package/src/types/rfcdate.ts +54 -0
- package/types/blobs.d.ts +4 -0
- package/types/blobs.d.ts.map +1 -0
- package/types/blobs.js +52 -0
- package/types/blobs.js.map +1 -0
- package/types/enums.d.ts +12 -0
- package/types/enums.d.ts.map +1 -0
- package/types/enums.js +10 -0
- package/types/enums.js.map +1 -0
- package/types/index.d.ts +7 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +16 -0
- package/types/index.js.map +1 -0
- package/types/operations.d.ts +11 -0
- package/types/operations.d.ts.map +1 -0
- package/types/operations.js +18 -0
- package/types/operations.js.map +1 -0
- package/types/rfcdate.d.ts +21 -0
- package/types/rfcdate.d.ts.map +1 -0
- package/types/rfcdate.js +46 -0
- package/types/rfcdate.js.map +1 -0
- package/.eslintrc.yml +0 -14
- package/.github/workflows/build_publish.yaml +0 -77
- package/examples/chat-react/README.md +0 -32
- package/examples/chat-react/package-lock.json +0 -29373
- package/examples/chat-react/package.json +0 -28
- package/examples/chat-react/public/favicon.ico +0 -0
- package/examples/chat-react/public/index.html +0 -25
- package/examples/chat-react/src/App.js +0 -66
- package/examples/chat-react/src/index.js +0 -10
- package/examples/chat_no_streaming.js +0 -12
- package/examples/chat_with_streaming.js +0 -18
- package/examples/embeddings.js +0 -17
- package/examples/file.jsonl +0 -3
- package/examples/files.js +0 -27
- package/examples/function_calling.js +0 -140
- package/examples/jobs.js +0 -39
- package/examples/json_format.js +0 -13
- package/examples/list_models.js +0 -11
- package/examples/package-lock.json +0 -33
- package/examples/package.json +0 -10
- package/examples/typescript/chat_with_streaming.ts +0 -24
- package/examples/typescript/package-lock.json +0 -480
- package/examples/typescript/package.json +0 -11
- package/examples/typescript/tsconfig.json +0 -10
- package/src/client.d.ts +0 -201
- package/src/client.js +0 -569
- package/src/files.d.ts +0 -30
- package/src/files.js +0 -65
- package/src/jobs.d.ts +0 -86
- package/src/jobs.js +0 -82
- package/tests/client.test.js +0 -193
- package/tests/files.test.js +0 -65
- package/tests/jobs.test.js +0 -71
- package/tests/utils.js +0 -388
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
<div align="center">
|
|
3
|
+
<a href="https://codespaces.new/mistralai/mistral-ts-client.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
|
|
4
|
+
</div>
|
|
5
|
+
<br>
|
|
6
|
+
|
|
7
|
+
> **Remember to shutdown a GitHub Codespace when it is not in use!**
|
|
8
|
+
|
|
9
|
+
# Dev Containers Quick Start
|
|
10
|
+
|
|
11
|
+
The default location for usage snippets is the `samples` directory.
|
|
12
|
+
|
|
13
|
+
## Running a Usage Sample
|
|
14
|
+
|
|
15
|
+
A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
ts-node root.ts
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Generating Additional Usage Samples
|
|
22
|
+
|
|
23
|
+
The speakeasy CLI allows you to generate more usage snippets. Here's how:
|
|
24
|
+
|
|
25
|
+
- To generate a sample for a specific operation by providing an operation ID, use:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
speakeasy generate usage -s registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi -l typescript -i {INPUT_OPERATION_ID} -o ./samples
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- To generate samples for an entire namespace (like a tag or group name), use:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
speakeasy generate usage -s registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi -l typescript -n {INPUT_TAG_NAME} -o ./samples
|
|
35
|
+
```
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2024 Mistral AI
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,166 +1,503 @@
|
|
|
1
|
-
|
|
1
|
+
# mistralai
|
|
2
2
|
|
|
3
|
-
|
|
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>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<!-- Start SDK Installation [installation] -->
|
|
8
|
+
## SDK Installation
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
### NPM
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
```bash
|
|
13
|
+
npm add @mistralai/mistralai
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### PNPM
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add @mistralai/mistralai
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Bun
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
bun add @mistralai/mistralai
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Yarn
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
yarn add @mistralai/mistralai zod
|
|
32
|
+
|
|
33
|
+
# Note that Yarn does not install peer dependencies automatically. You will need
|
|
34
|
+
# to install zod as shown above.
|
|
35
|
+
```
|
|
36
|
+
<!-- End SDK Installation [installation] -->
|
|
37
|
+
|
|
38
|
+
<!-- Start Requirements [requirements] -->
|
|
39
|
+
## Requirements
|
|
10
40
|
|
|
11
|
-
|
|
41
|
+
For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
42
|
+
<!-- End Requirements [requirements] -->
|
|
12
43
|
|
|
13
|
-
|
|
44
|
+
<!-- Start SDK Example Usage [usage] -->
|
|
45
|
+
## SDK Example Usage
|
|
14
46
|
|
|
15
|
-
|
|
47
|
+
### Create Chat Completions
|
|
16
48
|
|
|
17
|
-
|
|
49
|
+
This example shows how to create chat completions.
|
|
18
50
|
|
|
19
51
|
```typescript
|
|
20
|
-
import
|
|
52
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
21
53
|
|
|
22
|
-
const
|
|
54
|
+
const mistral = new Mistral({
|
|
55
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
async function run() {
|
|
59
|
+
const result = await mistral.chat.create({
|
|
60
|
+
model: "mistral-small-latest",
|
|
61
|
+
messages: [
|
|
62
|
+
{
|
|
63
|
+
content: "Who is the best French painter? Answer in one short sentence.",
|
|
64
|
+
role: "user",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Handle the result
|
|
70
|
+
console.log(result);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
run();
|
|
23
74
|
|
|
24
|
-
const client = new MistralClient(apiKey);
|
|
25
75
|
```
|
|
26
76
|
|
|
27
|
-
###
|
|
77
|
+
### Upload a file
|
|
78
|
+
|
|
79
|
+
This example shows how to upload a file.
|
|
28
80
|
|
|
29
81
|
```typescript
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
82
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
83
|
+
import { openAsBlob } from "node:fs";
|
|
84
|
+
|
|
85
|
+
const mistral = new Mistral({
|
|
86
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
34
87
|
});
|
|
88
|
+
|
|
89
|
+
async function run() {
|
|
90
|
+
const result = await mistral.files.upload({
|
|
91
|
+
file: await openAsBlob("./sample-file"),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// Handle the result
|
|
95
|
+
console.log(result);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
run();
|
|
99
|
+
|
|
35
100
|
```
|
|
101
|
+
<!-- End SDK Example Usage [usage] -->
|
|
102
|
+
|
|
103
|
+
## Providers' SDKs
|
|
104
|
+
|
|
105
|
+
We have dedicated SDKs for the following providers:
|
|
106
|
+
|
|
107
|
+
- [GCP](/packages/mistralai-gcp/README.md)
|
|
108
|
+
- [Azure](/packages/mistralai-azure/README.md)
|
|
109
|
+
|
|
110
|
+
<!-- Start Available Resources and Operations [operations] -->
|
|
111
|
+
## Available Resources and Operations
|
|
36
112
|
|
|
37
|
-
###
|
|
113
|
+
### [models](docs/sdks/models/README.md)
|
|
114
|
+
|
|
115
|
+
* [list](docs/sdks/models/README.md#list) - List Models
|
|
116
|
+
* [retrieve](docs/sdks/models/README.md#retrieve) - Retrieve Model
|
|
117
|
+
* [delete](docs/sdks/models/README.md#delete) - Delete Model
|
|
118
|
+
* [update](docs/sdks/models/README.md#update) - Update Fine Tuned Model
|
|
119
|
+
* [archive](docs/sdks/models/README.md#archive) - Archive Fine Tuned Model
|
|
120
|
+
* [unarchive](docs/sdks/models/README.md#unarchive) - Unarchive Fine Tuned Model
|
|
121
|
+
|
|
122
|
+
### [files](docs/sdks/files/README.md)
|
|
123
|
+
|
|
124
|
+
* [upload](docs/sdks/files/README.md#upload) - Upload File
|
|
125
|
+
* [list](docs/sdks/files/README.md#list) - List Files
|
|
126
|
+
* [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File
|
|
127
|
+
* [delete](docs/sdks/files/README.md#delete) - Delete File
|
|
128
|
+
|
|
129
|
+
### [fineTuning](docs/sdks/finetuning/README.md)
|
|
130
|
+
|
|
131
|
+
* [listJobs](docs/sdks/finetuning/README.md#listjobs) - Get Fine Tuning Jobs
|
|
132
|
+
* [createJob](docs/sdks/finetuning/README.md#createjob) - Create Fine Tuning Job
|
|
133
|
+
* [getJob](docs/sdks/finetuning/README.md#getjob) - Get Fine Tuning Job
|
|
134
|
+
* [cancelJob](docs/sdks/finetuning/README.md#canceljob) - Cancel Fine Tuning Job
|
|
135
|
+
* [startJob](docs/sdks/finetuning/README.md#startjob) - Start Fine Tuning Job
|
|
136
|
+
|
|
137
|
+
### [chat](docs/sdks/chat/README.md)
|
|
138
|
+
|
|
139
|
+
* [create](docs/sdks/chat/README.md#create) - Chat Completion
|
|
140
|
+
* [stream](docs/sdks/chat/README.md#stream) - Stream chat completion
|
|
141
|
+
|
|
142
|
+
### [fim](docs/sdks/fim/README.md)
|
|
143
|
+
|
|
144
|
+
* [create](docs/sdks/fim/README.md#create) - Fim Completion
|
|
145
|
+
* [stream](docs/sdks/fim/README.md#stream) - Stream fim completion
|
|
146
|
+
|
|
147
|
+
### [embeddings](docs/sdks/embeddings/README.md)
|
|
148
|
+
|
|
149
|
+
* [create](docs/sdks/embeddings/README.md#create) - Embeddings
|
|
150
|
+
<!-- End Available Resources and Operations [operations] -->
|
|
151
|
+
|
|
152
|
+
<!-- Start Server-sent event streaming [eventstream] -->
|
|
153
|
+
## Server-sent event streaming
|
|
154
|
+
|
|
155
|
+
[Server-sent events][mdn-sse] are used to stream content from certain
|
|
156
|
+
operations. These operations will expose the stream as an async iterable that
|
|
157
|
+
can be consumed using a [`for await...of`][mdn-for-await-of] loop. The loop will
|
|
158
|
+
terminate when the server no longer has any events to send and closes the
|
|
159
|
+
underlying connection.
|
|
38
160
|
|
|
39
161
|
```typescript
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
162
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
163
|
+
|
|
164
|
+
const mistral = new Mistral({
|
|
165
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
43
166
|
});
|
|
44
167
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
168
|
+
async function run() {
|
|
169
|
+
const result = await mistral.chat.stream({
|
|
170
|
+
model: "mistral-small-latest",
|
|
171
|
+
messages: [
|
|
172
|
+
{
|
|
173
|
+
content: "Who is the best French painter? Answer in one short sentence.",
|
|
174
|
+
role: "user",
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
for await (const event of result) {
|
|
180
|
+
// Handle the event
|
|
181
|
+
}
|
|
51
182
|
}
|
|
183
|
+
|
|
184
|
+
run();
|
|
185
|
+
|
|
52
186
|
```
|
|
53
187
|
|
|
54
|
-
|
|
188
|
+
[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
|
|
189
|
+
[mdn-for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
|
|
190
|
+
<!-- End Server-sent event streaming [eventstream] -->
|
|
191
|
+
|
|
192
|
+
<!-- Start File uploads [file-upload] -->
|
|
193
|
+
## File uploads
|
|
194
|
+
|
|
195
|
+
Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.
|
|
196
|
+
|
|
197
|
+
> [!TIP]
|
|
198
|
+
>
|
|
199
|
+
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
|
|
200
|
+
>
|
|
201
|
+
> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
|
|
202
|
+
> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
|
|
203
|
+
> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
|
|
204
|
+
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).
|
|
55
205
|
|
|
56
206
|
```typescript
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
207
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
208
|
+
import { openAsBlob } from "node:fs";
|
|
209
|
+
|
|
210
|
+
const mistral = new Mistral({
|
|
211
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
60
212
|
});
|
|
61
213
|
|
|
62
|
-
|
|
214
|
+
async function run() {
|
|
215
|
+
const result = await mistral.files.upload({
|
|
216
|
+
file: await openAsBlob("./sample-file"),
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Handle the result
|
|
220
|
+
console.log(result);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
run();
|
|
224
|
+
|
|
63
225
|
```
|
|
226
|
+
<!-- End File uploads [file-upload] -->
|
|
64
227
|
|
|
65
|
-
|
|
228
|
+
<!-- Start Retries [retries] -->
|
|
229
|
+
## Retries
|
|
66
230
|
|
|
231
|
+
Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
|
|
232
|
+
|
|
233
|
+
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
67
234
|
```typescript
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
235
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
236
|
+
|
|
237
|
+
const mistral = new Mistral({
|
|
238
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
async function run() {
|
|
242
|
+
const result = await mistral.models.list({
|
|
243
|
+
retries: {
|
|
244
|
+
strategy: "backoff",
|
|
245
|
+
backoff: {
|
|
246
|
+
initialInterval: 1,
|
|
247
|
+
maxInterval: 50,
|
|
248
|
+
exponent: 1.1,
|
|
249
|
+
maxElapsedTime: 100,
|
|
250
|
+
},
|
|
251
|
+
retryConnectionErrors: false,
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// Handle the result
|
|
256
|
+
console.log(result);
|
|
71
257
|
}
|
|
72
258
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
259
|
+
run();
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
264
|
+
```typescript
|
|
265
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
266
|
+
|
|
267
|
+
const mistral = new Mistral({
|
|
268
|
+
retryConfig: {
|
|
269
|
+
strategy: "backoff",
|
|
270
|
+
backoff: {
|
|
271
|
+
initialInterval: 1,
|
|
272
|
+
maxInterval: 50,
|
|
273
|
+
exponent: 1.1,
|
|
274
|
+
maxElapsedTime: 100,
|
|
275
|
+
},
|
|
276
|
+
retryConnectionErrors: false,
|
|
277
|
+
},
|
|
278
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
76
279
|
});
|
|
77
280
|
|
|
78
|
-
|
|
281
|
+
async function run() {
|
|
282
|
+
const result = await mistral.models.list();
|
|
283
|
+
|
|
284
|
+
// Handle the result
|
|
285
|
+
console.log(result);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
run();
|
|
289
|
+
|
|
79
290
|
```
|
|
291
|
+
<!-- End Retries [retries] -->
|
|
292
|
+
|
|
293
|
+
<!-- Start Error Handling [errors] -->
|
|
294
|
+
## Error Handling
|
|
295
|
+
|
|
296
|
+
All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.
|
|
297
|
+
|
|
298
|
+
| Error Object | Status Code | Content Type |
|
|
299
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
300
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
301
|
+
| errors.SDKError | 4xx-5xx | */* |
|
|
302
|
+
|
|
303
|
+
Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging.
|
|
80
304
|
|
|
81
|
-
### Files
|
|
82
305
|
|
|
83
306
|
```typescript
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const createdFile = await client.files.create({ file });
|
|
307
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
308
|
+
import { SDKValidationError } from "@mistralai/mistralai/models/errors";
|
|
87
309
|
|
|
88
|
-
|
|
89
|
-
|
|
310
|
+
const mistral = new Mistral({
|
|
311
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
312
|
+
});
|
|
90
313
|
|
|
91
|
-
|
|
92
|
-
|
|
314
|
+
async function run() {
|
|
315
|
+
let result;
|
|
316
|
+
try {
|
|
317
|
+
result = await mistral.models.list();
|
|
318
|
+
} catch (err) {
|
|
319
|
+
switch (true) {
|
|
320
|
+
case err instanceof SDKValidationError: {
|
|
321
|
+
// Validation errors can be pretty-printed
|
|
322
|
+
console.error(err.pretty());
|
|
323
|
+
// Raw value may also be inspected
|
|
324
|
+
console.error(err.rawValue);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
case err instanceof errors.HTTPValidationError: {
|
|
328
|
+
console.error(err); // handle exception
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
default: {
|
|
332
|
+
throw err;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Handle the result
|
|
338
|
+
console.log(result);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
run();
|
|
93
342
|
|
|
94
|
-
// Delete a file
|
|
95
|
-
const deletedFile = await client.files.delete({ fileId: createdFile.id });
|
|
96
343
|
```
|
|
344
|
+
<!-- End Error Handling [errors] -->
|
|
345
|
+
|
|
346
|
+
<!-- Start Server Selection [server] -->
|
|
347
|
+
## Server Selection
|
|
97
348
|
|
|
98
|
-
###
|
|
349
|
+
### Select Server by Name
|
|
350
|
+
|
|
351
|
+
You can override the default server globally by passing a server name to the `server` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:
|
|
352
|
+
|
|
353
|
+
| Name | Server | Variables |
|
|
354
|
+
| ----- | ------ | --------- |
|
|
355
|
+
| `prod` | `https://api.mistral.ai` | None |
|
|
99
356
|
|
|
100
357
|
```typescript
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
hyperparameters: {
|
|
107
|
-
trainingSteps: 10,
|
|
108
|
-
learningRate: 0.0001,
|
|
109
|
-
},
|
|
358
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
359
|
+
|
|
360
|
+
const mistral = new Mistral({
|
|
361
|
+
server: "prod",
|
|
362
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
110
363
|
});
|
|
111
364
|
|
|
112
|
-
|
|
113
|
-
const
|
|
365
|
+
async function run() {
|
|
366
|
+
const result = await mistral.models.list();
|
|
367
|
+
|
|
368
|
+
// Handle the result
|
|
369
|
+
console.log(result);
|
|
370
|
+
}
|
|
114
371
|
|
|
115
|
-
|
|
116
|
-
const retrievedJob = await client.jobs.retrieve({ jobId: createdJob.id });
|
|
372
|
+
run();
|
|
117
373
|
|
|
118
|
-
// Cancel a job
|
|
119
|
-
const canceledJob = await client.jobs.cancel({ jobId: createdJob.id });
|
|
120
374
|
```
|
|
121
375
|
|
|
122
|
-
## Run examples
|
|
123
376
|
|
|
124
|
-
|
|
377
|
+
### Override Server URL Per-Client
|
|
125
378
|
|
|
126
|
-
|
|
127
|
-
cd examples
|
|
128
|
-
npm install .
|
|
129
|
-
```
|
|
379
|
+
The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example:
|
|
130
380
|
|
|
131
|
-
|
|
381
|
+
```typescript
|
|
382
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
132
383
|
|
|
133
|
-
|
|
384
|
+
const mistral = new Mistral({
|
|
385
|
+
serverURL: "https://api.mistral.ai",
|
|
386
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
async function run() {
|
|
390
|
+
const result = await mistral.models.list();
|
|
134
391
|
|
|
135
|
-
|
|
392
|
+
// Handle the result
|
|
393
|
+
console.log(result);
|
|
394
|
+
}
|
|
136
395
|
|
|
137
|
-
|
|
396
|
+
run();
|
|
138
397
|
|
|
139
|
-
```bash
|
|
140
|
-
MISTRAL_API_KEY='your_api_key' node chat_with_streaming.js
|
|
141
398
|
```
|
|
399
|
+
<!-- End Server Selection [server] -->
|
|
142
400
|
|
|
143
|
-
|
|
401
|
+
<!-- Start Custom HTTP Client [http-client] -->
|
|
402
|
+
## Custom HTTP Client
|
|
144
403
|
|
|
145
|
-
|
|
404
|
+
The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
|
|
405
|
+
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
|
|
406
|
+
client is a thin wrapper around `fetch` and provides the ability to attach hooks
|
|
407
|
+
around the request lifecycle that can be used to modify the request or handle
|
|
408
|
+
errors and response.
|
|
146
409
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
410
|
+
The `HTTPClient` constructor takes an optional `fetcher` argument that can be
|
|
411
|
+
used to integrate a third-party HTTP client or when writing tests to mock out
|
|
412
|
+
the HTTP client and feed in fixtures.
|
|
150
413
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
414
|
+
The following example shows how to use the `"beforeRequest"` hook to to add a
|
|
415
|
+
custom header and a timeout to requests and how to use the `"requestError"` hook
|
|
416
|
+
to log errors:
|
|
417
|
+
|
|
418
|
+
```typescript
|
|
419
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
420
|
+
import { HTTPClient } from "@mistralai/mistralai/lib/http";
|
|
154
421
|
|
|
155
|
-
|
|
422
|
+
const httpClient = new HTTPClient({
|
|
423
|
+
// fetcher takes a function that has the same signature as native `fetch`.
|
|
424
|
+
fetcher: (request) => {
|
|
425
|
+
return fetch(request);
|
|
426
|
+
}
|
|
427
|
+
});
|
|
156
428
|
|
|
157
|
-
|
|
158
|
-
|
|
429
|
+
httpClient.addHook("beforeRequest", (request) => {
|
|
430
|
+
const nextRequest = new Request(request, {
|
|
431
|
+
signal: request.signal || AbortSignal.timeout(5000)
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
nextRequest.headers.set("x-custom-header", "custom value");
|
|
435
|
+
|
|
436
|
+
return nextRequest;
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
httpClient.addHook("requestError", (error, request) => {
|
|
440
|
+
console.group("Request Error");
|
|
441
|
+
console.log("Reason:", `${error}`);
|
|
442
|
+
console.log("Endpoint:", `${request.method} ${request.url}`);
|
|
443
|
+
console.groupEnd();
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
const sdk = new Mistral({ httpClient });
|
|
159
447
|
```
|
|
160
|
-
|
|
448
|
+
<!-- End Custom HTTP Client [http-client] -->
|
|
449
|
+
|
|
450
|
+
<!-- Start Authentication [security] -->
|
|
451
|
+
## Authentication
|
|
452
|
+
|
|
453
|
+
### Per-Client Security Schemes
|
|
161
454
|
|
|
455
|
+
This SDK supports the following security scheme globally:
|
|
456
|
+
|
|
457
|
+
| Name | Type | Scheme |
|
|
458
|
+
| ----------- | ----------- | ----------- |
|
|
459
|
+
| `apiKey` | http | HTTP Bearer |
|
|
460
|
+
|
|
461
|
+
To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
|
|
162
462
|
```typescript
|
|
163
|
-
import
|
|
463
|
+
import { Mistral } from "@mistralai/mistralai";
|
|
464
|
+
|
|
465
|
+
const mistral = new Mistral({
|
|
466
|
+
apiKey: process.env.MISTRAL_API_KEY,
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
async function run() {
|
|
470
|
+
const result = await mistral.models.list();
|
|
471
|
+
|
|
472
|
+
// Handle the result
|
|
473
|
+
console.log(result);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
run();
|
|
164
477
|
|
|
165
|
-
const client = new MistralClient();
|
|
166
478
|
```
|
|
479
|
+
<!-- End Authentication [security] -->
|
|
480
|
+
|
|
481
|
+
## Providers Support
|
|
482
|
+
|
|
483
|
+
We also provide provider specific SDK for:
|
|
484
|
+
|
|
485
|
+
- [GCP](packages/mistralai-gcp/README.md)
|
|
486
|
+
- [Azure](packages/mistralai-azure/README.md)
|
|
487
|
+
|
|
488
|
+
<!-- Placeholder for Future Speakeasy SDK Sections -->
|
|
489
|
+
|
|
490
|
+
# Development
|
|
491
|
+
|
|
492
|
+
## Maturity
|
|
493
|
+
|
|
494
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
495
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
496
|
+
looking for the latest version.
|
|
497
|
+
|
|
498
|
+
## Contributions
|
|
499
|
+
|
|
500
|
+
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.
|
|
501
|
+
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.
|
|
502
|
+
|
|
503
|
+
### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
|