├── .devcontainer ├── README.md ├── devcontainer.json └── setup.sh ├── .genignore ├── .gitattributes ├── .github └── workflows │ ├── sdk_generation_mistralai_azure_sdk.yaml │ ├── sdk_generation_mistralai_gcp_sdk.yaml │ ├── sdk_generation_mistralai_sdk.yaml │ ├── sdk_publish_mistralai_azure_sdk.yaml │ ├── sdk_publish_mistralai_gcp_sdk.yaml │ ├── sdk_publish_mistralai_sdk.yaml │ └── test_custom_code.yaml ├── .gitignore ├── .npmignore ├── .speakeasy ├── gen.lock ├── gen.yaml ├── workflow.lock └── workflow.yaml ├── CONTRIBUTING.md ├── FUNCTIONS.md ├── LICENSE ├── README.md ├── RELEASES.md ├── RUNTIMES.md ├── USAGE.md ├── docs ├── lib │ └── utils │ │ └── retryconfig.md ├── models │ ├── components │ │ ├── agent.md │ │ ├── agentconversation.md │ │ ├── agentconversationobject.md │ │ ├── agentcreationrequest.md │ │ ├── agentcreationrequesttools.md │ │ ├── agenthandoffdoneevent.md │ │ ├── agenthandoffdoneeventtype.md │ │ ├── agenthandoffentry.md │ │ ├── agenthandoffentryobject.md │ │ ├── agenthandoffentrytype.md │ │ ├── agenthandoffstartedevent.md │ │ ├── agenthandoffstartedeventtype.md │ │ ├── agentobject.md │ │ ├── agentscompletionrequest.md │ │ ├── agentscompletionrequestmessages.md │ │ ├── agentscompletionrequeststop.md │ │ ├── agentscompletionrequesttoolchoice.md │ │ ├── agentscompletionstreamrequest.md │ │ ├── agentscompletionstreamrequestmessages.md │ │ ├── agentscompletionstreamrequeststop.md │ │ ├── agentscompletionstreamrequesttoolchoice.md │ │ ├── agenttools.md │ │ ├── agentupdaterequest.md │ │ ├── agentupdaterequesttools.md │ │ ├── apiendpoint.md │ │ ├── archiveftmodelout.md │ │ ├── archiveftmodeloutobject.md │ │ ├── arguments.md │ │ ├── assistantmessage.md │ │ ├── assistantmessagecontent.md │ │ ├── assistantmessagerole.md │ │ ├── basemodelcard.md │ │ ├── batcherror.md │ │ ├── batchjobin.md │ │ ├── batchjobout.md │ │ ├── batchjoboutobject.md │ │ ├── batchjobsout.md │ │ ├── batchjobsoutobject.md │ │ ├── batchjobstatus.md │ │ ├── builtinconnectors.md │ │ ├── chatclassificationrequest.md │ │ ├── chatcompletionchoice.md │ │ ├── chatcompletionrequest.md │ │ ├── chatcompletionrequesttoolchoice.md │ │ ├── chatcompletionresponse.md │ │ ├── chatcompletionstreamrequest.md │ │ ├── chatcompletionstreamrequestmessages.md │ │ ├── chatcompletionstreamrequeststop.md │ │ ├── chatcompletionstreamrequesttoolchoice.md │ │ ├── chatmoderationrequest.md │ │ ├── chatmoderationrequestinputs.md │ │ ├── checkpointout.md │ │ ├── classificationrequest.md │ │ ├── classificationrequestinputs.md │ │ ├── classificationresponse.md │ │ ├── classificationtargetresult.md │ │ ├── classifierdetailedjobout.md │ │ ├── classifierdetailedjoboutintegrations.md │ │ ├── classifierdetailedjoboutjobtype.md │ │ ├── classifierdetailedjoboutobject.md │ │ ├── classifierdetailedjoboutstatus.md │ │ ├── classifierftmodelout.md │ │ ├── classifierftmodeloutmodeltype.md │ │ ├── classifierftmodeloutobject.md │ │ ├── classifierjobout.md │ │ ├── classifierjoboutintegrations.md │ │ ├── classifierjoboutjobtype.md │ │ ├── classifierjoboutobject.md │ │ ├── classifierjoboutstatus.md │ │ ├── classifiertargetin.md │ │ ├── classifiertargetout.md │ │ ├── classifiertrainingparameters.md │ │ ├── classifiertrainingparametersin.md │ │ ├── codeinterpretertool.md │ │ ├── codeinterpretertooltype.md │ │ ├── completionargs.md │ │ ├── completionargsstop.md │ │ ├── completionchunk.md │ │ ├── completiondetailedjobout.md │ │ ├── completiondetailedjoboutintegrations.md │ │ ├── completiondetailedjoboutjobtype.md │ │ ├── completiondetailedjoboutobject.md │ │ ├── completiondetailedjoboutrepositories.md │ │ ├── completiondetailedjoboutstatus.md │ │ ├── completionevent.md │ │ ├── completionftmodelout.md │ │ ├── completionftmodeloutobject.md │ │ ├── completionjobout.md │ │ ├── completionjoboutobject.md │ │ ├── completionresponsestreamchoice.md │ │ ├── completionresponsestreamchoicefinishreason.md │ │ ├── completiontrainingparameters.md │ │ ├── completiontrainingparametersin.md │ │ ├── content.md │ │ ├── contentchunk.md │ │ ├── conversationappendrequest.md │ │ ├── conversationappendrequesthandoffexecution.md │ │ ├── conversationappendstreamrequest.md │ │ ├── conversationappendstreamrequesthandoffexecution.md │ │ ├── conversationevents.md │ │ ├── conversationeventsdata.md │ │ ├── conversationhistory.md │ │ ├── conversationhistoryobject.md │ │ ├── conversationinputs.md │ │ ├── conversationmessages.md │ │ ├── conversationmessagesobject.md │ │ ├── conversationrequest.md │ │ ├── conversationresponse.md │ │ ├── conversationresponseobject.md │ │ ├── conversationrestartrequest.md │ │ ├── conversationrestartrequesthandoffexecution.md │ │ ├── conversationrestartstreamrequest.md │ │ ├── conversationrestartstreamrequesthandoffexecution.md │ │ ├── conversationstreamrequest.md │ │ ├── conversationstreamrequesthandoffexecution.md │ │ ├── conversationstreamrequesttools.md │ │ ├── conversationusageinfo.md │ │ ├── data.md │ │ ├── deletefileout.md │ │ ├── deletemodelout.md │ │ ├── deltamessage.md │ │ ├── document.md │ │ ├── documentlibrarytool.md │ │ ├── documentlibrarytooltype.md │ │ ├── documenturlchunk.md │ │ ├── documenturlchunktype.md │ │ ├── embeddingdtype.md │ │ ├── embeddingrequest.md │ │ ├── embeddingrequestinputs.md │ │ ├── embeddingresponse.md │ │ ├── embeddingresponsedata.md │ │ ├── entries.md │ │ ├── eventout.md │ │ ├── filepurpose.md │ │ ├── fileschema.md │ │ ├── filesignedurl.md │ │ ├── fimcompletionrequest.md │ │ ├── fimcompletionrequeststop.md │ │ ├── fimcompletionresponse.md │ │ ├── fimcompletionstreamrequest.md │ │ ├── fimcompletionstreamrequeststop.md │ │ ├── finetuneablemodeltype.md │ │ ├── finishreason.md │ │ ├── ftclassifierlossfunction.md │ │ ├── ftmodelcapabilitiesout.md │ │ ├── ftmodelcard.md │ │ ├── ftmodelcardtype.md │ │ ├── functioncall.md │ │ ├── functioncallentry.md │ │ ├── functioncallentryarguments.md │ │ ├── functioncallentryobject.md │ │ ├── functioncallentrytype.md │ │ ├── functioncallevent.md │ │ ├── functioncalleventtype.md │ │ ├── functionname.md │ │ ├── functionresultentry.md │ │ ├── functionresultentryobject.md │ │ ├── functionresultentrytype.md │ │ ├── functiont.md │ │ ├── functiontool.md │ │ ├── functiontooltype.md │ │ ├── githubrepositoryin.md │ │ ├── githubrepositoryintype.md │ │ ├── githubrepositoryout.md │ │ ├── githubrepositoryouttype.md │ │ ├── handoffexecution.md │ │ ├── hyperparameters.md │ │ ├── imagegenerationtool.md │ │ ├── imagegenerationtooltype.md │ │ ├── imageurl.md │ │ ├── imageurlchunk.md │ │ ├── imageurlchunkimageurl.md │ │ ├── imageurlchunktype.md │ │ ├── inputentries.md │ │ ├── inputs.md │ │ ├── instructrequest.md │ │ ├── instructrequestinputs.md │ │ ├── instructrequestinputsmessages.md │ │ ├── instructrequestmessages.md │ │ ├── integrations.md │ │ ├── jobin.md │ │ ├── jobinintegrations.md │ │ ├── jobinrepositories.md │ │ ├── jobmetadataout.md │ │ ├── jobsout.md │ │ ├── jobsoutdata.md │ │ ├── jobsoutobject.md │ │ ├── jobtype.md │ │ ├── jsonschema.md │ │ ├── legacyjobmetadataout.md │ │ ├── legacyjobmetadataoutobject.md │ │ ├── listfilesout.md │ │ ├── loc.md │ │ ├── messageentries.md │ │ ├── messageinputcontentchunks.md │ │ ├── messageinputentry.md │ │ ├── messageinputentrycontent.md │ │ ├── messageinputentryrole.md │ │ ├── messageinputentrytype.md │ │ ├── messageoutputcontentchunks.md │ │ ├── messageoutputentry.md │ │ ├── messageoutputentrycontent.md │ │ ├── messageoutputentryobject.md │ │ ├── messageoutputentryrole.md │ │ ├── messageoutputentrytype.md │ │ ├── messageoutputevent.md │ │ ├── messageoutputeventcontent.md │ │ ├── messageoutputeventrole.md │ │ ├── messageoutputeventtype.md │ │ ├── messages.md │ │ ├── metricout.md │ │ ├── modelcapabilities.md │ │ ├── modelconversation.md │ │ ├── modelconversationobject.md │ │ ├── modelconversationtools.md │ │ ├── modellist.md │ │ ├── modeltype.md │ │ ├── moderationobject.md │ │ ├── moderationresponse.md │ │ ├── objectt.md │ │ ├── ocrimageobject.md │ │ ├── ocrpagedimensions.md │ │ ├── ocrpageobject.md │ │ ├── ocrrequest.md │ │ ├── ocrresponse.md │ │ ├── ocrusageinfo.md │ │ ├── one.md │ │ ├── outputcontentchunks.md │ │ ├── outputs.md │ │ ├── prediction.md │ │ ├── referencechunk.md │ │ ├── referencechunktype.md │ │ ├── repositories.md │ │ ├── responsedoneevent.md │ │ ├── responsedoneeventtype.md │ │ ├── responseerrorevent.md │ │ ├── responseerroreventtype.md │ │ ├── responseformat.md │ │ ├── responseformats.md │ │ ├── responsestartedevent.md │ │ ├── responsestartedeventtype.md │ │ ├── retrievefileout.md │ │ ├── role.md │ │ ├── sampletype.md │ │ ├── security.md │ │ ├── source.md │ │ ├── ssetypes.md │ │ ├── status.md │ │ ├── stop.md │ │ ├── systemmessage.md │ │ ├── systemmessagecontent.md │ │ ├── textchunk.md │ │ ├── textchunktype.md │ │ ├── tool.md │ │ ├── toolcall.md │ │ ├── toolchoice.md │ │ ├── toolchoiceenum.md │ │ ├── toolexecutiondoneevent.md │ │ ├── toolexecutiondoneeventtype.md │ │ ├── toolexecutionentry.md │ │ ├── toolexecutionentryobject.md │ │ ├── toolexecutionentrytype.md │ │ ├── toolexecutionstartedevent.md │ │ ├── toolexecutionstartedeventtype.md │ │ ├── toolfilechunk.md │ │ ├── toolfilechunktype.md │ │ ├── toolmessage.md │ │ ├── toolmessagecontent.md │ │ ├── toolmessagerole.md │ │ ├── toolreferencechunk.md │ │ ├── toolreferencechunktype.md │ │ ├── tools.md │ │ ├── tooltypes.md │ │ ├── trainingfile.md │ │ ├── two.md │ │ ├── type.md │ │ ├── unarchiveftmodelout.md │ │ ├── unarchiveftmodeloutobject.md │ │ ├── updateftmodelin.md │ │ ├── uploadfileout.md │ │ ├── usageinfo.md │ │ ├── usermessage.md │ │ ├── usermessagecontent.md │ │ ├── usermessagerole.md │ │ ├── validationerror.md │ │ ├── wandbintegration.md │ │ ├── wandbintegrationout.md │ │ ├── wandbintegrationouttype.md │ │ ├── wandbintegrationtype.md │ │ ├── websearchpremiumtool.md │ │ ├── websearchpremiumtooltype.md │ │ ├── websearchtool.md │ │ └── websearchtooltype.md │ ├── errors │ │ └── httpvalidationerror.md │ └── operations │ │ ├── agentsapiv1agentsgetrequest.md │ │ ├── agentsapiv1agentslistrequest.md │ │ ├── agentsapiv1agentsupdaterequest.md │ │ ├── agentsapiv1agentsupdateversionrequest.md │ │ ├── agentsapiv1conversationsappendrequest.md │ │ ├── agentsapiv1conversationsappendstreamrequest.md │ │ ├── agentsapiv1conversationsgetrequest.md │ │ ├── agentsapiv1conversationsgetresponsev1conversationsget.md │ │ ├── agentsapiv1conversationshistoryrequest.md │ │ ├── agentsapiv1conversationslistrequest.md │ │ ├── agentsapiv1conversationsmessagesrequest.md │ │ ├── agentsapiv1conversationsrestartrequest.md │ │ ├── agentsapiv1conversationsrestartstreamrequest.md │ │ ├── deletemodelv1modelsmodeliddeleterequest.md │ │ ├── filesapiroutesdeletefilerequest.md │ │ ├── filesapiroutesdownloadfilerequest.md │ │ ├── filesapiroutesgetsignedurlrequest.md │ │ ├── filesapirouteslistfilesrequest.md │ │ ├── filesapiroutesretrievefilerequest.md │ │ ├── filesapiroutesuploadfilemultipartbodyparams.md │ │ ├── filet.md │ │ ├── jobsapiroutesbatchcancelbatchjobrequest.md │ │ ├── jobsapiroutesbatchgetbatchjobrequest.md │ │ ├── jobsapiroutesbatchgetbatchjobsrequest.md │ │ ├── jobsapiroutesfinetuningarchivefinetunedmodelrequest.md │ │ ├── jobsapiroutesfinetuningcancelfinetuningjobrequest.md │ │ ├── jobsapiroutesfinetuningcancelfinetuningjobresponse.md │ │ ├── jobsapiroutesfinetuningcreatefinetuningjobresponse.md │ │ ├── jobsapiroutesfinetuninggetfinetuningjobrequest.md │ │ ├── jobsapiroutesfinetuninggetfinetuningjobresponse.md │ │ ├── jobsapiroutesfinetuninggetfinetuningjobsrequest.md │ │ ├── jobsapiroutesfinetuningstartfinetuningjobrequest.md │ │ ├── jobsapiroutesfinetuningstartfinetuningjobresponse.md │ │ ├── jobsapiroutesfinetuningunarchivefinetunedmodelrequest.md │ │ ├── jobsapiroutesfinetuningupdatefinetunedmodelrequest.md │ │ ├── jobsapiroutesfinetuningupdatefinetunedmodelresponse.md │ │ ├── one.md │ │ ├── responsebody.md │ │ ├── retrievemodelv1modelsmodelidgetrequest.md │ │ ├── retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md │ │ └── status.md └── sdks │ ├── agents │ └── README.md │ ├── batch │ └── README.md │ ├── beta │ └── README.md │ ├── chat │ └── README.md │ ├── classifiers │ └── README.md │ ├── conversations │ └── README.md │ ├── embeddings │ └── README.md │ ├── files │ └── README.md │ ├── fim │ └── README.md │ ├── finetuning │ └── README.md │ ├── jobs │ └── README.md │ ├── mistral │ └── README.md │ ├── mistralagents │ └── README.md │ ├── mistraljobs │ └── README.md │ ├── models │ └── README.md │ └── ocr │ └── README.md ├── eslint.config.mjs ├── examples ├── .env.template ├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── src │ ├── async_chat_no_streaming.ts │ ├── async_chat_prediction.ts │ ├── async_chat_streaming.ts │ ├── async_chat_with_image_no_streaming.ts │ ├── async_conversation_agent.ts │ ├── async_embeddings.ts │ ├── async_files.ts │ ├── async_function_calling.ts │ ├── async_function_calling_streaming.ts │ ├── async_jobs.ts │ ├── async_json_format.ts │ ├── async_list_models.ts │ ├── async_ocr_process_from_file.ts │ ├── async_ocr_process_from_url.ts │ ├── async_structured_outputs.ts │ ├── azure │ │ └── async_chat_no_streaming.ts │ ├── file.jsonl │ └── gcp │ │ └── async_chat_no_streaming.ts ├── test.ts └── tsconfig.json ├── jsr.json ├── package-lock.json ├── package.json ├── packages ├── mistralai-azure │ ├── .genignore │ ├── .gitattributes │ ├── .gitignore │ ├── .npmignore │ ├── .speakeasy │ │ ├── gen.lock │ │ └── gen.yaml │ ├── CONTRIBUTING.md │ ├── FUNCTIONS.md │ ├── LICENSE │ ├── README.md │ ├── RELEASES.md │ ├── RUNTIMES.md │ ├── USAGE.md │ ├── docs │ │ ├── lib │ │ │ └── utils │ │ │ │ └── retryconfig.md │ │ ├── models │ │ │ ├── components │ │ │ │ ├── arguments.md │ │ │ │ ├── assistantmessage.md │ │ │ │ ├── assistantmessagecontent.md │ │ │ │ ├── assistantmessagerole.md │ │ │ │ ├── chatcompletionchoice.md │ │ │ │ ├── chatcompletionchoicefinishreason.md │ │ │ │ ├── chatcompletionrequest.md │ │ │ │ ├── chatcompletionrequestmessages.md │ │ │ │ ├── chatcompletionrequeststop.md │ │ │ │ ├── chatcompletionrequesttoolchoice.md │ │ │ │ ├── chatcompletionresponse.md │ │ │ │ ├── chatcompletionstreamrequest.md │ │ │ │ ├── chatcompletionstreamrequesttoolchoice.md │ │ │ │ ├── completionchunk.md │ │ │ │ ├── completionevent.md │ │ │ │ ├── completionresponsestreamchoice.md │ │ │ │ ├── content.md │ │ │ │ ├── contentchunk.md │ │ │ │ ├── deltamessage.md │ │ │ │ ├── finishreason.md │ │ │ │ ├── functioncall.md │ │ │ │ ├── functionname.md │ │ │ │ ├── functiont.md │ │ │ │ ├── imageurl.md │ │ │ │ ├── imageurlchunk.md │ │ │ │ ├── imageurlchunkimageurl.md │ │ │ │ ├── imageurlchunktype.md │ │ │ │ ├── jsonschema.md │ │ │ │ ├── loc.md │ │ │ │ ├── messages.md │ │ │ │ ├── prediction.md │ │ │ │ ├── referencechunk.md │ │ │ │ ├── referencechunktype.md │ │ │ │ ├── responseformat.md │ │ │ │ ├── responseformats.md │ │ │ │ ├── role.md │ │ │ │ ├── security.md │ │ │ │ ├── stop.md │ │ │ │ ├── systemmessage.md │ │ │ │ ├── systemmessagecontent.md │ │ │ │ ├── textchunk.md │ │ │ │ ├── tool.md │ │ │ │ ├── toolcall.md │ │ │ │ ├── toolchoice.md │ │ │ │ ├── toolchoiceenum.md │ │ │ │ ├── toolmessage.md │ │ │ │ ├── toolmessagecontent.md │ │ │ │ ├── toolmessagerole.md │ │ │ │ ├── tooltypes.md │ │ │ │ ├── type.md │ │ │ │ ├── usageinfo.md │ │ │ │ ├── usermessage.md │ │ │ │ ├── usermessagecontent.md │ │ │ │ ├── usermessagerole.md │ │ │ │ └── validationerror.md │ │ │ └── errors │ │ │ │ └── httpvalidationerror.md │ │ └── sdks │ │ │ ├── chat │ │ │ └── README.md │ │ │ └── mistralazure │ │ │ └── README.md │ ├── eslint.config.mjs │ ├── jsr.json │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── core.ts │ │ ├── funcs │ │ │ ├── chatComplete.ts │ │ │ └── chatStream.ts │ │ ├── hooks │ │ │ ├── custom_user_agent.ts │ │ │ ├── hooks.ts │ │ │ ├── index.ts │ │ │ ├── registration.ts │ │ │ └── types.ts │ │ ├── index.ts │ │ ├── lib │ │ │ ├── base64.ts │ │ │ ├── config.ts │ │ │ ├── dlv.ts │ │ │ ├── encodings.ts │ │ │ ├── env.ts │ │ │ ├── event-streams.ts │ │ │ ├── files.ts │ │ │ ├── http.ts │ │ │ ├── is-plain-object.ts │ │ │ ├── logger.ts │ │ │ ├── matchers.ts │ │ │ ├── primitives.ts │ │ │ ├── retries.ts │ │ │ ├── schemas.ts │ │ │ ├── sdks.ts │ │ │ ├── security.ts │ │ │ └── url.ts │ │ ├── models │ │ │ ├── components │ │ │ │ ├── assistantmessage.ts │ │ │ │ ├── chatcompletionchoice.ts │ │ │ │ ├── chatcompletionrequest.ts │ │ │ │ ├── chatcompletionresponse.ts │ │ │ │ ├── chatcompletionstreamrequest.ts │ │ │ │ ├── completionchunk.ts │ │ │ │ ├── completionevent.ts │ │ │ │ ├── completionresponsestreamchoice.ts │ │ │ │ ├── contentchunk.ts │ │ │ │ ├── deltamessage.ts │ │ │ │ ├── function.ts │ │ │ │ ├── functioncall.ts │ │ │ │ ├── functionname.ts │ │ │ │ ├── imageurl.ts │ │ │ │ ├── imageurlchunk.ts │ │ │ │ ├── index.ts │ │ │ │ ├── jsonschema.ts │ │ │ │ ├── prediction.ts │ │ │ │ ├── referencechunk.ts │ │ │ │ ├── responseformat.ts │ │ │ │ ├── responseformats.ts │ │ │ │ ├── security.ts │ │ │ │ ├── systemmessage.ts │ │ │ │ ├── textchunk.ts │ │ │ │ ├── tool.ts │ │ │ │ ├── toolcall.ts │ │ │ │ ├── toolchoice.ts │ │ │ │ ├── toolchoiceenum.ts │ │ │ │ ├── toolmessage.ts │ │ │ │ ├── tooltypes.ts │ │ │ │ ├── usageinfo.ts │ │ │ │ ├── usermessage.ts │ │ │ │ └── validationerror.ts │ │ │ └── errors │ │ │ │ ├── httpclienterrors.ts │ │ │ │ ├── httpvalidationerror.ts │ │ │ │ ├── index.ts │ │ │ │ ├── sdkerror.ts │ │ │ │ └── sdkvalidationerror.ts │ │ ├── sdk │ │ │ ├── chat.ts │ │ │ ├── index.ts │ │ │ └── sdk.ts │ │ └── types │ │ │ ├── async.ts │ │ │ ├── blobs.ts │ │ │ ├── constdatetime.ts │ │ │ ├── enums.ts │ │ │ ├── fp.ts │ │ │ ├── index.ts │ │ │ ├── operations.ts │ │ │ ├── rfcdate.ts │ │ │ └── streams.ts │ └── tsconfig.json └── mistralai-gcp │ ├── .genignore │ ├── .gitattributes │ ├── .gitignore │ ├── .npmignore │ ├── .speakeasy │ ├── gen.lock │ └── gen.yaml │ ├── CONTRIBUTING.md │ ├── FUNCTIONS.md │ ├── LICENSE │ ├── README.md │ ├── RELEASES.md │ ├── RUNTIMES.md │ ├── USAGE.md │ ├── docs │ ├── lib │ │ └── utils │ │ │ └── retryconfig.md │ ├── models │ │ ├── components │ │ │ ├── arguments.md │ │ │ ├── assistantmessage.md │ │ │ ├── assistantmessagecontent.md │ │ │ ├── assistantmessagerole.md │ │ │ ├── chatcompletionchoice.md │ │ │ ├── chatcompletionchoicefinishreason.md │ │ │ ├── chatcompletionrequest.md │ │ │ ├── chatcompletionrequestmessages.md │ │ │ ├── chatcompletionrequeststop.md │ │ │ ├── chatcompletionrequesttoolchoice.md │ │ │ ├── chatcompletionresponse.md │ │ │ ├── chatcompletionstreamrequest.md │ │ │ ├── chatcompletionstreamrequesttoolchoice.md │ │ │ ├── completionchunk.md │ │ │ ├── completionevent.md │ │ │ ├── completionresponsestreamchoice.md │ │ │ ├── content.md │ │ │ ├── contentchunk.md │ │ │ ├── deltamessage.md │ │ │ ├── fimcompletionrequest.md │ │ │ ├── fimcompletionrequeststop.md │ │ │ ├── fimcompletionresponse.md │ │ │ ├── fimcompletionstreamrequest.md │ │ │ ├── fimcompletionstreamrequeststop.md │ │ │ ├── finishreason.md │ │ │ ├── functioncall.md │ │ │ ├── functionname.md │ │ │ ├── functiont.md │ │ │ ├── imageurl.md │ │ │ ├── imageurlchunk.md │ │ │ ├── imageurlchunkimageurl.md │ │ │ ├── imageurlchunktype.md │ │ │ ├── jsonschema.md │ │ │ ├── loc.md │ │ │ ├── messages.md │ │ │ ├── prediction.md │ │ │ ├── referencechunk.md │ │ │ ├── referencechunktype.md │ │ │ ├── responseformat.md │ │ │ ├── responseformats.md │ │ │ ├── role.md │ │ │ ├── security.md │ │ │ ├── stop.md │ │ │ ├── systemmessage.md │ │ │ ├── systemmessagecontent.md │ │ │ ├── textchunk.md │ │ │ ├── tool.md │ │ │ ├── toolcall.md │ │ │ ├── toolchoice.md │ │ │ ├── toolchoiceenum.md │ │ │ ├── toolmessage.md │ │ │ ├── toolmessagecontent.md │ │ │ ├── toolmessagerole.md │ │ │ ├── tooltypes.md │ │ │ ├── type.md │ │ │ ├── usageinfo.md │ │ │ ├── usermessage.md │ │ │ ├── usermessagecontent.md │ │ │ ├── usermessagerole.md │ │ │ └── validationerror.md │ │ └── errors │ │ │ └── httpvalidationerror.md │ └── sdks │ │ ├── chat │ │ └── README.md │ │ ├── fim │ │ └── README.md │ │ └── mistralgcp │ │ └── README.md │ ├── eslint.config.mjs │ ├── jsr.json │ ├── package-lock.json │ ├── package.json │ ├── src │ ├── core.ts │ ├── funcs │ │ ├── chatComplete.ts │ │ ├── chatStream.ts │ │ ├── fimComplete.ts │ │ └── fimStream.ts │ ├── hooks │ │ ├── custom_user_agent.ts │ │ ├── hooks.ts │ │ ├── index.ts │ │ ├── registration.ts │ │ └── types.ts │ ├── index.ts │ ├── lib │ │ ├── base64.ts │ │ ├── config.ts │ │ ├── dlv.ts │ │ ├── encodings.ts │ │ ├── event-streams.ts │ │ ├── files.ts │ │ ├── http.ts │ │ ├── is-plain-object.ts │ │ ├── logger.ts │ │ ├── matchers.ts │ │ ├── primitives.ts │ │ ├── retries.ts │ │ ├── schemas.ts │ │ ├── sdks.ts │ │ ├── security.ts │ │ └── url.ts │ ├── models │ │ ├── components │ │ │ ├── assistantmessage.ts │ │ │ ├── chatcompletionchoice.ts │ │ │ ├── chatcompletionrequest.ts │ │ │ ├── chatcompletionresponse.ts │ │ │ ├── chatcompletionstreamrequest.ts │ │ │ ├── completionchunk.ts │ │ │ ├── completionevent.ts │ │ │ ├── completionresponsestreamchoice.ts │ │ │ ├── contentchunk.ts │ │ │ ├── deltamessage.ts │ │ │ ├── fimcompletionrequest.ts │ │ │ ├── fimcompletionresponse.ts │ │ │ ├── fimcompletionstreamrequest.ts │ │ │ ├── function.ts │ │ │ ├── functioncall.ts │ │ │ ├── functionname.ts │ │ │ ├── imageurl.ts │ │ │ ├── imageurlchunk.ts │ │ │ ├── index.ts │ │ │ ├── jsonschema.ts │ │ │ ├── prediction.ts │ │ │ ├── referencechunk.ts │ │ │ ├── responseformat.ts │ │ │ ├── responseformats.ts │ │ │ ├── security.ts │ │ │ ├── systemmessage.ts │ │ │ ├── textchunk.ts │ │ │ ├── tool.ts │ │ │ ├── toolcall.ts │ │ │ ├── toolchoice.ts │ │ │ ├── toolchoiceenum.ts │ │ │ ├── toolmessage.ts │ │ │ ├── tooltypes.ts │ │ │ ├── usageinfo.ts │ │ │ ├── usermessage.ts │ │ │ └── validationerror.ts │ │ └── errors │ │ │ ├── httpclienterrors.ts │ │ │ ├── httpvalidationerror.ts │ │ │ ├── index.ts │ │ │ ├── sdkerror.ts │ │ │ └── sdkvalidationerror.ts │ ├── sdk │ │ ├── chat.ts │ │ ├── fim.ts │ │ ├── index.ts │ │ └── sdk.ts │ └── types │ │ ├── async.ts │ │ ├── blobs.ts │ │ ├── constdatetime.ts │ │ ├── enums.ts │ │ ├── fp.ts │ │ ├── index.ts │ │ ├── operations.ts │ │ ├── rfcdate.ts │ │ └── streams.ts │ └── tsconfig.json ├── src ├── core.ts ├── extra │ ├── README.md │ └── structChat.ts ├── funcs │ ├── agentsComplete.ts │ ├── agentsStream.ts │ ├── batchJobsCancel.ts │ ├── batchJobsCreate.ts │ ├── batchJobsGet.ts │ ├── batchJobsList.ts │ ├── betaAgentsCreate.ts │ ├── betaAgentsGet.ts │ ├── betaAgentsList.ts │ ├── betaAgentsUpdate.ts │ ├── betaAgentsUpdateVersion.ts │ ├── betaConversationsAppend.ts │ ├── betaConversationsAppendStream.ts │ ├── betaConversationsGet.ts │ ├── betaConversationsGetHistory.ts │ ├── betaConversationsGetMessages.ts │ ├── betaConversationsList.ts │ ├── betaConversationsRestart.ts │ ├── betaConversationsRestartStream.ts │ ├── betaConversationsStart.ts │ ├── betaConversationsStartStream.ts │ ├── chatComplete.ts │ ├── chatStream.ts │ ├── classifiersClassify.ts │ ├── classifiersClassifyChat.ts │ ├── classifiersModerate.ts │ ├── classifiersModerateChat.ts │ ├── embeddingsCreate.ts │ ├── filesDelete.ts │ ├── filesDownload.ts │ ├── filesGetSignedUrl.ts │ ├── filesList.ts │ ├── filesRetrieve.ts │ ├── filesUpload.ts │ ├── fimComplete.ts │ ├── fimStream.ts │ ├── fineTuningJobsCancel.ts │ ├── fineTuningJobsCreate.ts │ ├── fineTuningJobsGet.ts │ ├── fineTuningJobsList.ts │ ├── fineTuningJobsStart.ts │ ├── modelsArchive.ts │ ├── modelsDelete.ts │ ├── modelsList.ts │ ├── modelsRetrieve.ts │ ├── modelsUnarchive.ts │ ├── modelsUpdate.ts │ └── ocrProcess.ts ├── hooks │ ├── custom_user_agent.ts │ ├── deprecation_warning.ts │ ├── hooks.ts │ ├── index.ts │ ├── registration.ts │ └── types.ts ├── index.ts ├── lib │ ├── base64.ts │ ├── config.ts │ ├── dlv.ts │ ├── encodings.ts │ ├── env.ts │ ├── event-streams.ts │ ├── files.ts │ ├── http.ts │ ├── is-plain-object.ts │ ├── logger.ts │ ├── matchers.ts │ ├── primitives.ts │ ├── retries.ts │ ├── schemas.ts │ ├── sdks.ts │ ├── security.ts │ └── url.ts ├── models │ ├── components │ │ ├── agent.ts │ │ ├── agentconversation.ts │ │ ├── agentcreationrequest.ts │ │ ├── agenthandoffdoneevent.ts │ │ ├── agenthandoffentry.ts │ │ ├── agenthandoffstartedevent.ts │ │ ├── agentscompletionrequest.ts │ │ ├── agentscompletionstreamrequest.ts │ │ ├── agentupdaterequest.ts │ │ ├── apiendpoint.ts │ │ ├── archiveftmodelout.ts │ │ ├── assistantmessage.ts │ │ ├── basemodelcard.ts │ │ ├── batcherror.ts │ │ ├── batchjobin.ts │ │ ├── batchjobout.ts │ │ ├── batchjobsout.ts │ │ ├── batchjobstatus.ts │ │ ├── builtinconnectors.ts │ │ ├── chatclassificationrequest.ts │ │ ├── chatcompletionchoice.ts │ │ ├── chatcompletionrequest.ts │ │ ├── chatcompletionresponse.ts │ │ ├── chatcompletionstreamrequest.ts │ │ ├── chatmoderationrequest.ts │ │ ├── checkpointout.ts │ │ ├── classificationrequest.ts │ │ ├── classificationresponse.ts │ │ ├── classificationtargetresult.ts │ │ ├── classifierdetailedjobout.ts │ │ ├── classifierftmodelout.ts │ │ ├── classifierjobout.ts │ │ ├── classifiertargetin.ts │ │ ├── classifiertargetout.ts │ │ ├── classifiertrainingparameters.ts │ │ ├── classifiertrainingparametersin.ts │ │ ├── codeinterpretertool.ts │ │ ├── completionargs.ts │ │ ├── completionargsstop.ts │ │ ├── completionchunk.ts │ │ ├── completiondetailedjobout.ts │ │ ├── completionevent.ts │ │ ├── completionftmodelout.ts │ │ ├── completionjobout.ts │ │ ├── completionresponsestreamchoice.ts │ │ ├── completiontrainingparameters.ts │ │ ├── completiontrainingparametersin.ts │ │ ├── contentchunk.ts │ │ ├── conversationappendrequest.ts │ │ ├── conversationappendstreamrequest.ts │ │ ├── conversationevents.ts │ │ ├── conversationhistory.ts │ │ ├── conversationinputs.ts │ │ ├── conversationmessages.ts │ │ ├── conversationrequest.ts │ │ ├── conversationresponse.ts │ │ ├── conversationrestartrequest.ts │ │ ├── conversationrestartstreamrequest.ts │ │ ├── conversationstreamrequest.ts │ │ ├── conversationusageinfo.ts │ │ ├── deletefileout.ts │ │ ├── deletemodelout.ts │ │ ├── deltamessage.ts │ │ ├── documentlibrarytool.ts │ │ ├── documenturlchunk.ts │ │ ├── embeddingdtype.ts │ │ ├── embeddingrequest.ts │ │ ├── embeddingresponse.ts │ │ ├── embeddingresponsedata.ts │ │ ├── eventout.ts │ │ ├── filepurpose.ts │ │ ├── fileschema.ts │ │ ├── filesignedurl.ts │ │ ├── fimcompletionrequest.ts │ │ ├── fimcompletionresponse.ts │ │ ├── fimcompletionstreamrequest.ts │ │ ├── finetuneablemodeltype.ts │ │ ├── ftclassifierlossfunction.ts │ │ ├── ftmodelcapabilitiesout.ts │ │ ├── ftmodelcard.ts │ │ ├── function.ts │ │ ├── functioncall.ts │ │ ├── functioncallentry.ts │ │ ├── functioncallentryarguments.ts │ │ ├── functioncallevent.ts │ │ ├── functionname.ts │ │ ├── functionresultentry.ts │ │ ├── functiontool.ts │ │ ├── githubrepositoryin.ts │ │ ├── githubrepositoryout.ts │ │ ├── imagegenerationtool.ts │ │ ├── imageurl.ts │ │ ├── imageurlchunk.ts │ │ ├── index.ts │ │ ├── inputentries.ts │ │ ├── inputs.ts │ │ ├── instructrequest.ts │ │ ├── jobin.ts │ │ ├── jobmetadataout.ts │ │ ├── jobsout.ts │ │ ├── jsonschema.ts │ │ ├── legacyjobmetadataout.ts │ │ ├── listfilesout.ts │ │ ├── messageentries.ts │ │ ├── messageinputcontentchunks.ts │ │ ├── messageinputentry.ts │ │ ├── messageoutputcontentchunks.ts │ │ ├── messageoutputentry.ts │ │ ├── messageoutputevent.ts │ │ ├── metricout.ts │ │ ├── modelcapabilities.ts │ │ ├── modelconversation.ts │ │ ├── modellist.ts │ │ ├── moderationobject.ts │ │ ├── moderationresponse.ts │ │ ├── ocrimageobject.ts │ │ ├── ocrpagedimensions.ts │ │ ├── ocrpageobject.ts │ │ ├── ocrrequest.ts │ │ ├── ocrresponse.ts │ │ ├── ocrusageinfo.ts │ │ ├── outputcontentchunks.ts │ │ ├── prediction.ts │ │ ├── referencechunk.ts │ │ ├── responsedoneevent.ts │ │ ├── responseerrorevent.ts │ │ ├── responseformat.ts │ │ ├── responseformats.ts │ │ ├── responsestartedevent.ts │ │ ├── retrievefileout.ts │ │ ├── sampletype.ts │ │ ├── security.ts │ │ ├── source.ts │ │ ├── ssetypes.ts │ │ ├── systemmessage.ts │ │ ├── textchunk.ts │ │ ├── tool.ts │ │ ├── toolcall.ts │ │ ├── toolchoice.ts │ │ ├── toolchoiceenum.ts │ │ ├── toolexecutiondoneevent.ts │ │ ├── toolexecutionentry.ts │ │ ├── toolexecutionstartedevent.ts │ │ ├── toolfilechunk.ts │ │ ├── toolmessage.ts │ │ ├── toolreferencechunk.ts │ │ ├── tooltypes.ts │ │ ├── trainingfile.ts │ │ ├── unarchiveftmodelout.ts │ │ ├── updateftmodelin.ts │ │ ├── uploadfileout.ts │ │ ├── usageinfo.ts │ │ ├── usermessage.ts │ │ ├── validationerror.ts │ │ ├── wandbintegration.ts │ │ ├── wandbintegrationout.ts │ │ ├── websearchpremiumtool.ts │ │ └── websearchtool.ts │ ├── errors │ │ ├── httpclienterrors.ts │ │ ├── httpvalidationerror.ts │ │ ├── index.ts │ │ ├── sdkerror.ts │ │ └── sdkvalidationerror.ts │ └── operations │ │ ├── agentsapiv1agentsget.ts │ │ ├── agentsapiv1agentslist.ts │ │ ├── agentsapiv1agentsupdate.ts │ │ ├── agentsapiv1agentsupdateversion.ts │ │ ├── agentsapiv1conversationsappend.ts │ │ ├── agentsapiv1conversationsappendstream.ts │ │ ├── agentsapiv1conversationsget.ts │ │ ├── agentsapiv1conversationshistory.ts │ │ ├── agentsapiv1conversationslist.ts │ │ ├── agentsapiv1conversationsmessages.ts │ │ ├── agentsapiv1conversationsrestart.ts │ │ ├── agentsapiv1conversationsrestartstream.ts │ │ ├── deletemodelv1modelsmodeliddelete.ts │ │ ├── filesapiroutesdeletefile.ts │ │ ├── filesapiroutesdownloadfile.ts │ │ ├── filesapiroutesgetsignedurl.ts │ │ ├── filesapirouteslistfiles.ts │ │ ├── filesapiroutesretrievefile.ts │ │ ├── filesapiroutesuploadfile.ts │ │ ├── index.ts │ │ ├── jobsapiroutesbatchcancelbatchjob.ts │ │ ├── jobsapiroutesbatchgetbatchjob.ts │ │ ├── jobsapiroutesbatchgetbatchjobs.ts │ │ ├── jobsapiroutesfinetuningarchivefinetunedmodel.ts │ │ ├── jobsapiroutesfinetuningcancelfinetuningjob.ts │ │ ├── jobsapiroutesfinetuningcreatefinetuningjob.ts │ │ ├── jobsapiroutesfinetuninggetfinetuningjob.ts │ │ ├── jobsapiroutesfinetuninggetfinetuningjobs.ts │ │ ├── jobsapiroutesfinetuningstartfinetuningjob.ts │ │ ├── jobsapiroutesfinetuningunarchivefinetunedmodel.ts │ │ ├── jobsapiroutesfinetuningupdatefinetunedmodel.ts │ │ └── retrievemodelv1modelsmodelidget.ts ├── sdk │ ├── agents.ts │ ├── batch.ts │ ├── beta.ts │ ├── chat.ts │ ├── classifiers.ts │ ├── conversations.ts │ ├── embeddings.ts │ ├── files.ts │ ├── fim.ts │ ├── finetuning.ts │ ├── index.ts │ ├── jobs.ts │ ├── mistralagents.ts │ ├── mistraljobs.ts │ ├── models.ts │ ├── ocr.ts │ ├── oldclient.ts │ └── sdk.ts └── types │ ├── async.ts │ ├── blobs.ts │ ├── constdatetime.ts │ ├── enums.ts │ ├── fp.ts │ ├── index.ts │ ├── operations.ts │ ├── rfcdate.ts │ └── streams.ts ├── tests ├── extra │ └── structChat.test.ts ├── jest.config.js ├── package-lock.json ├── package.json └── tsconfig.json └── tsconfig.json /.devcontainer/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install the speakeasy CLI 4 | curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh 5 | 6 | # Setup samples directory 7 | rmdir samples || true 8 | mkdir samples 9 | 10 | npm install 11 | npm install -g ts-node 12 | npm link 13 | npm link @mistralai/mistralai 14 | TS_CONFIG_CONTENT=$(cat < samples/tsconfig.json 28 | 29 | # Generate starter usage sample with speakeasy 30 | speakeasy generate usage -s registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi -l typescript -o samples/root.ts -------------------------------------------------------------------------------- /.genignore: -------------------------------------------------------------------------------- 1 | examples/ 2 | src/extra/ 3 | tests/ -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # This allows generated code to be indexed correctly 2 | *.ts linguist-generated=false -------------------------------------------------------------------------------- /.github/workflows/sdk_generation_mistralai_azure_sdk.yaml: -------------------------------------------------------------------------------- 1 | name: Generate MISTRALAI-AZURE-SDK 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | workflow_dispatch: 9 | inputs: 10 | force: 11 | description: Force generation of SDKs 12 | type: boolean 13 | default: false 14 | set_version: 15 | description: optionally set a specific SDK version 16 | type: string 17 | jobs: 18 | generate: 19 | uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 20 | with: 21 | force: ${{ github.event.inputs.force }} 22 | mode: pr 23 | set_version: ${{ github.event.inputs.set_version }} 24 | speakeasy_version: latest 25 | target: mistralai-azure-sdk 26 | secrets: 27 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 28 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 29 | -------------------------------------------------------------------------------- /.github/workflows/sdk_generation_mistralai_gcp_sdk.yaml: -------------------------------------------------------------------------------- 1 | name: Generate MISTRALAI-GCP-SDK 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | workflow_dispatch: 9 | inputs: 10 | force: 11 | description: Force generation of SDKs 12 | type: boolean 13 | default: false 14 | set_version: 15 | description: optionally set a specific SDK version 16 | type: string 17 | jobs: 18 | generate: 19 | uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 20 | with: 21 | force: ${{ github.event.inputs.force }} 22 | mode: pr 23 | set_version: ${{ github.event.inputs.set_version }} 24 | speakeasy_version: latest 25 | target: mistralai-gcp-sdk 26 | secrets: 27 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 28 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 29 | -------------------------------------------------------------------------------- /.github/workflows/sdk_generation_mistralai_sdk.yaml: -------------------------------------------------------------------------------- 1 | name: Generate MISTRALAI-SDK 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | workflow_dispatch: 9 | inputs: 10 | force: 11 | description: Force generation of SDKs 12 | type: boolean 13 | default: false 14 | set_version: 15 | description: optionally set a specific SDK version 16 | type: string 17 | jobs: 18 | generate: 19 | uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15 20 | with: 21 | force: ${{ github.event.inputs.force }} 22 | mode: pr 23 | set_version: ${{ github.event.inputs.set_version }} 24 | speakeasy_version: latest 25 | target: mistralai-sdk 26 | secrets: 27 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 28 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 29 | -------------------------------------------------------------------------------- /.github/workflows/sdk_publish_mistralai_azure_sdk.yaml: -------------------------------------------------------------------------------- 1 | name: Publish MISTRALAI-AZURE-SDK 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | push: 9 | branches: 10 | - main 11 | paths: 12 | - packages/mistralai-azure/RELEASES.md 13 | jobs: 14 | publish: 15 | uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 16 | secrets: 17 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 18 | npm_token: ${{ secrets.NPM_TOKEN }} 19 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 20 | -------------------------------------------------------------------------------- /.github/workflows/sdk_publish_mistralai_gcp_sdk.yaml: -------------------------------------------------------------------------------- 1 | name: Publish MISTRALAI-GCP-SDK 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | push: 9 | branches: 10 | - main 11 | paths: 12 | - packages/mistralai-gcp/RELEASES.md 13 | jobs: 14 | publish: 15 | uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 16 | secrets: 17 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 18 | npm_token: ${{ secrets.NPM_TOKEN }} 19 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 20 | -------------------------------------------------------------------------------- /.github/workflows/sdk_publish_mistralai_sdk.yaml: -------------------------------------------------------------------------------- 1 | name: Publish MISTRALAI-SDK 2 | permissions: 3 | checks: write 4 | contents: write 5 | pull-requests: write 6 | statuses: write 7 | "on": 8 | push: 9 | branches: 10 | - main 11 | paths: 12 | - RELEASES.md 13 | - '*/RELEASES.md' 14 | jobs: 15 | publish: 16 | uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 17 | secrets: 18 | github_access_token: ${{ secrets.GITHUB_TOKEN }} 19 | npm_token: ${{ secrets.NPM_TOKEN }} 20 | speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }} 21 | -------------------------------------------------------------------------------- /.github/workflows/test_custom_code.yaml: -------------------------------------------------------------------------------- 1 | name: Testing custom files 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | lint: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout code 16 | uses: actions/checkout@v3 17 | 18 | - name: Set up Node.js 19 | uses: actions/setup-node@v4 20 | with: 21 | node-version: '22' 22 | 23 | - name: Install dependencies 24 | run: npm install && npm install --prefix examples && npm install --prefix tests 25 | 26 | - name: Build the project 27 | run: npm run build 28 | 29 | - name: Run the unit tests 30 | run: (cd tests && npm test) 31 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !/FUNCTIONS.md 3 | !/RUNTIMES.md 4 | !/REACT_QUERY.md 5 | !/**/*.ts 6 | !/**/*.js 7 | !/**/*.mjs 8 | !/**/*.json 9 | !/**/*.map 10 | 11 | /eslint.config.mjs 12 | /cjs 13 | /.tshy 14 | /.tshy-* 15 | /__tests__ 16 | -------------------------------------------------------------------------------- /docs/models/components/agentconversationobject.md: -------------------------------------------------------------------------------- 1 | # AgentConversationObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentConversationObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: AgentConversationObject = "conversation"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/agenthandoffdoneeventtype.md: -------------------------------------------------------------------------------- 1 | # AgentHandoffDoneEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentHandoffDoneEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: AgentHandoffDoneEventType = "agent.handoff.done"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "agent.handoff.done" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/agenthandoffentryobject.md: -------------------------------------------------------------------------------- 1 | # AgentHandoffEntryObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentHandoffEntryObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: AgentHandoffEntryObject = "entry"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "entry" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/agenthandoffentrytype.md: -------------------------------------------------------------------------------- 1 | # AgentHandoffEntryType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentHandoffEntryType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: AgentHandoffEntryType = "agent.handoff"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "agent.handoff" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/agenthandoffstartedeventtype.md: -------------------------------------------------------------------------------- 1 | # AgentHandoffStartedEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentHandoffStartedEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: AgentHandoffStartedEventType = "agent.handoff.started"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "agent.handoff.started" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/agentobject.md: -------------------------------------------------------------------------------- 1 | # AgentObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: AgentObject = "agent"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "agent" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/agentscompletionrequestmessages.md: -------------------------------------------------------------------------------- 1 | # AgentsCompletionRequestMessages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: "", 17 | }; 18 | ``` 19 | 20 | ### `components.ToolMessage` 21 | 22 | ```typescript 23 | const value: components.ToolMessage = { 24 | content: [ 25 | { 26 | text: "", 27 | type: "text", 28 | }, 29 | ], 30 | }; 31 | ``` 32 | 33 | ### `components.UserMessage` 34 | 35 | ```typescript 36 | const value: components.UserMessage = { 37 | content: "", 38 | }; 39 | ``` 40 | 41 | -------------------------------------------------------------------------------- /docs/models/components/agentscompletionrequeststop.md: -------------------------------------------------------------------------------- 1 | # AgentsCompletionRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/agentscompletionrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # AgentsCompletionRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "auto"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/agentscompletionstreamrequestmessages.md: -------------------------------------------------------------------------------- 1 | # AgentsCompletionStreamRequestMessages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: "", 17 | }; 18 | ``` 19 | 20 | ### `components.ToolMessage` 21 | 22 | ```typescript 23 | const value: components.ToolMessage = { 24 | content: "", 25 | }; 26 | ``` 27 | 28 | ### `components.UserMessage` 29 | 30 | ```typescript 31 | const value: components.UserMessage = { 32 | content: "", 33 | }; 34 | ``` 35 | 36 | -------------------------------------------------------------------------------- /docs/models/components/agentscompletionstreamrequeststop.md: -------------------------------------------------------------------------------- 1 | # AgentsCompletionStreamRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/agentscompletionstreamrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # AgentsCompletionStreamRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "required"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/apiendpoint.md: -------------------------------------------------------------------------------- 1 | # ApiEndpoint 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ApiEndpoint } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ApiEndpoint = "/v1/chat/moderations"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "/v1/chat/completions" | "/v1/embeddings" | "/v1/fim/completions" | "/v1/moderations" | "/v1/chat/moderations" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/archiveftmodeloutobject.md: -------------------------------------------------------------------------------- 1 | # ArchiveFTModelOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ArchiveFTModelOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ArchiveFTModelOutObject = "model"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "model" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/arguments.md: -------------------------------------------------------------------------------- 1 | # Arguments 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `{ [k: string]: any }` 7 | 8 | ```typescript 9 | const value: { [k: string]: any } = { 10 | "key": "", 11 | }; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = ""; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/assistantmessagecontent.md: -------------------------------------------------------------------------------- 1 | # AssistantMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | referenceIds: [ 18 | 991891, 19 | ], 20 | type: "reference", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /docs/models/components/assistantmessagerole.md: -------------------------------------------------------------------------------- 1 | # AssistantMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AssistantMessageRole } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: AssistantMessageRole = "assistant"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "assistant" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/batcherror.md: -------------------------------------------------------------------------------- 1 | # BatchError 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { BatchError } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: BatchError = { 9 | message: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `message` | *string* | :heavy_check_mark: | N/A | 18 | | `count` | *number* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/batchjoboutobject.md: -------------------------------------------------------------------------------- 1 | # BatchJobOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { BatchJobOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: BatchJobOutObject = "batch"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "batch" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/batchjobsoutobject.md: -------------------------------------------------------------------------------- 1 | # BatchJobsOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { BatchJobsOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: BatchJobsOutObject = "list"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "list" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/batchjobstatus.md: -------------------------------------------------------------------------------- 1 | # BatchJobStatus 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { BatchJobStatus } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: BatchJobStatus = "FAILED"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "QUEUED" | "RUNNING" | "SUCCESS" | "FAILED" | "TIMEOUT_EXCEEDED" | "CANCELLATION_REQUESTED" | "CANCELLED" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/builtinconnectors.md: -------------------------------------------------------------------------------- 1 | # BuiltInConnectors 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { BuiltInConnectors } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: BuiltInConnectors = "document_library"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "web_search" | "web_search_premium" | "code_interpreter" | "image_generation" | "document_library" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/chatclassificationrequest.md: -------------------------------------------------------------------------------- 1 | # ChatClassificationRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ChatClassificationRequest } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ChatClassificationRequest = { 9 | model: "Volt", 10 | inputs: [ 11 | { 12 | messages: [ 13 | { 14 | content: "", 15 | role: "system", 16 | }, 17 | ], 18 | }, 19 | ], 20 | }; 21 | ``` 22 | 23 | ## Fields 24 | 25 | | Field | Type | Required | Description | 26 | | ------------------- | ------------------- | ------------------- | ------------------- | 27 | | `model` | *string* | :heavy_check_mark: | N/A | 28 | | `inputs` | *components.Inputs* | :heavy_check_mark: | Chat to classify | -------------------------------------------------------------------------------- /docs/models/components/chatcompletionrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "auto"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/chatcompletionstreamrequestmessages.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionStreamRequestMessages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: [ 17 | { 18 | text: "", 19 | type: "text", 20 | }, 21 | ], 22 | }; 23 | ``` 24 | 25 | ### `components.ToolMessage` 26 | 27 | ```typescript 28 | const value: components.ToolMessage = { 29 | content: [ 30 | { 31 | documentUrl: "https://formal-sushi.com", 32 | type: "document_url", 33 | }, 34 | ], 35 | }; 36 | ``` 37 | 38 | ### `components.UserMessage` 39 | 40 | ```typescript 41 | const value: components.UserMessage = { 42 | content: "", 43 | }; 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /docs/models/components/chatcompletionstreamrequeststop.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionStreamRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/chatcompletionstreamrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionStreamRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "auto"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/chatmoderationrequestinputs.md: -------------------------------------------------------------------------------- 1 | # ChatModerationRequestInputs 2 | 3 | Chat to classify 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.One[]` 9 | 10 | ```typescript 11 | const value: components.One[] = [ 12 | { 13 | content: "", 14 | role: "system", 15 | }, 16 | ]; 17 | ``` 18 | 19 | ### `components.Two[][]` 20 | 21 | ```typescript 22 | const value: components.Two[][] = [ 23 | [ 24 | { 25 | content: [ 26 | { 27 | text: "", 28 | type: "text", 29 | }, 30 | ], 31 | role: "tool", 32 | }, 33 | ], 34 | ]; 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /docs/models/components/classificationrequestinputs.md: -------------------------------------------------------------------------------- 1 | # ClassificationRequestInputs 2 | 3 | Text to classify. 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/classificationtargetresult.md: -------------------------------------------------------------------------------- 1 | # ClassificationTargetResult 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ClassificationTargetResult } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ClassificationTargetResult = { 9 | scores: { 10 | "key": 3589.95, 11 | }, 12 | }; 13 | ``` 14 | 15 | ## Fields 16 | 17 | | Field | Type | Required | Description | 18 | | ------------------------ | ------------------------ | ------------------------ | ------------------------ | 19 | | `scores` | Record | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/classifierdetailedjoboutintegrations.md: -------------------------------------------------------------------------------- 1 | # ClassifierDetailedJobOutIntegrations 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.WandbIntegrationOut` 7 | 8 | ```typescript 9 | const value: components.WandbIntegrationOut = { 10 | project: "", 11 | }; 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /docs/models/components/classifierdetailedjoboutjobtype.md: -------------------------------------------------------------------------------- 1 | # ClassifierDetailedJobOutJobType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ClassifierDetailedJobOutJobType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ClassifierDetailedJobOutJobType = "classifier"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "classifier" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/classifierdetailedjoboutobject.md: -------------------------------------------------------------------------------- 1 | # ClassifierDetailedJobOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ClassifierDetailedJobOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ClassifierDetailedJobOutObject = "job"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "job" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/classifierdetailedjoboutstatus.md: -------------------------------------------------------------------------------- 1 | # ClassifierDetailedJobOutStatus 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ClassifierDetailedJobOutStatus } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ClassifierDetailedJobOutStatus = "SUCCESS"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "QUEUED" | "STARTED" | "VALIDATING" | "VALIDATED" | "RUNNING" | "FAILED_VALIDATION" | "FAILED" | "SUCCESS" | "CANCELLED" | "CANCELLATION_REQUESTED" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/classifierftmodeloutmodeltype.md: -------------------------------------------------------------------------------- 1 | # ClassifierFTModelOutModelType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ClassifierFTModelOutModelType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ClassifierFTModelOutModelType = "classifier"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "classifier" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/classifierftmodeloutobject.md: -------------------------------------------------------------------------------- 1 | # ClassifierFTModelOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ClassifierFTModelOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ClassifierFTModelOutObject = "model"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "model" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/classifierjoboutintegrations.md: -------------------------------------------------------------------------------- 1 | # ClassifierJobOutIntegrations 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.WandbIntegrationOut` 7 | 8 | ```typescript 9 | const value: components.WandbIntegrationOut = { 10 | project: "", 11 | }; 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /docs/models/components/classifierjoboutjobtype.md: -------------------------------------------------------------------------------- 1 | # ClassifierJobOutJobType 2 | 3 | The type of job (`FT` for fine-tuning). 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { ClassifierJobOutJobType } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: ClassifierJobOutJobType = "classifier"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "classifier" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/classifierjoboutobject.md: -------------------------------------------------------------------------------- 1 | # ClassifierJobOutObject 2 | 3 | The object type of the fine-tuning job. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { ClassifierJobOutObject } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: ClassifierJobOutObject = "job"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "job" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/classifierjoboutstatus.md: -------------------------------------------------------------------------------- 1 | # ClassifierJobOutStatus 2 | 3 | The current status of the fine-tuning job. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { ClassifierJobOutStatus } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: ClassifierJobOutStatus = "VALIDATING"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "QUEUED" | "STARTED" | "VALIDATING" | "VALIDATED" | "RUNNING" | "FAILED_VALIDATION" | "FAILED" | "SUCCESS" | "CANCELLED" | "CANCELLATION_REQUESTED" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/codeinterpretertooltype.md: -------------------------------------------------------------------------------- 1 | # CodeInterpreterToolType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { CodeInterpreterToolType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: CodeInterpreterToolType = "code_interpreter"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "code_interpreter" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/completionargsstop.md: -------------------------------------------------------------------------------- 1 | # CompletionArgsStop 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `string[]` 13 | 14 | ```typescript 15 | const value: string[] = [ 16 | "", 17 | ]; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/completiondetailedjoboutintegrations.md: -------------------------------------------------------------------------------- 1 | # CompletionDetailedJobOutIntegrations 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.WandbIntegrationOut` 7 | 8 | ```typescript 9 | const value: components.WandbIntegrationOut = { 10 | project: "", 11 | }; 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /docs/models/components/completiondetailedjoboutjobtype.md: -------------------------------------------------------------------------------- 1 | # CompletionDetailedJobOutJobType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { CompletionDetailedJobOutJobType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: CompletionDetailedJobOutJobType = "completion"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "completion" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/completiondetailedjoboutobject.md: -------------------------------------------------------------------------------- 1 | # CompletionDetailedJobOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { CompletionDetailedJobOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: CompletionDetailedJobOutObject = "job"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "job" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/completiondetailedjoboutrepositories.md: -------------------------------------------------------------------------------- 1 | # CompletionDetailedJobOutRepositories 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.GithubRepositoryOut` 7 | 8 | ```typescript 9 | const value: components.GithubRepositoryOut = { 10 | name: "", 11 | owner: "", 12 | commitId: "", 13 | }; 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /docs/models/components/completiondetailedjoboutstatus.md: -------------------------------------------------------------------------------- 1 | # CompletionDetailedJobOutStatus 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { CompletionDetailedJobOutStatus } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: CompletionDetailedJobOutStatus = "QUEUED"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "QUEUED" | "STARTED" | "VALIDATING" | "VALIDATED" | "RUNNING" | "FAILED_VALIDATION" | "FAILED" | "SUCCESS" | "CANCELLED" | "CANCELLATION_REQUESTED" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/completionftmodeloutobject.md: -------------------------------------------------------------------------------- 1 | # CompletionFTModelOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { CompletionFTModelOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: CompletionFTModelOutObject = "model"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "model" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/completionjoboutobject.md: -------------------------------------------------------------------------------- 1 | # CompletionJobOutObject 2 | 3 | The object type of the fine-tuning job. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { CompletionJobOutObject } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: CompletionJobOutObject = "job"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "job" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/completionresponsestreamchoicefinishreason.md: -------------------------------------------------------------------------------- 1 | # CompletionResponseStreamChoiceFinishReason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { CompletionResponseStreamChoiceFinishReason } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: CompletionResponseStreamChoiceFinishReason = "length"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "stop" | "length" | "error" | "tool_calls" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/content.md: -------------------------------------------------------------------------------- 1 | # Content 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | referenceIds: [ 18 | 351936, 19 | ], 20 | type: "reference", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /docs/models/components/contentchunk.md: -------------------------------------------------------------------------------- 1 | # ContentChunk 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ImageURLChunk` 7 | 8 | ```typescript 9 | const value: components.ImageURLChunk = { 10 | imageUrl: "https://exhausted-cycle.com", 11 | }; 12 | ``` 13 | 14 | ### `components.DocumentURLChunk` 15 | 16 | ```typescript 17 | const value: components.DocumentURLChunk = { 18 | documentUrl: "https://free-ignorance.info", 19 | }; 20 | ``` 21 | 22 | ### `components.TextChunk` 23 | 24 | ```typescript 25 | const value: components.TextChunk = { 26 | text: "", 27 | }; 28 | ``` 29 | 30 | ### `components.ReferenceChunk` 31 | 32 | ```typescript 33 | const value: components.ReferenceChunk = { 34 | referenceIds: [ 35 | 778172, 36 | ], 37 | }; 38 | ``` 39 | 40 | -------------------------------------------------------------------------------- /docs/models/components/conversationappendrequesthandoffexecution.md: -------------------------------------------------------------------------------- 1 | # ConversationAppendRequestHandoffExecution 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationAppendRequestHandoffExecution } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationAppendRequestHandoffExecution = "client"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "client" | "server" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/conversationappendstreamrequesthandoffexecution.md: -------------------------------------------------------------------------------- 1 | # ConversationAppendStreamRequestHandoffExecution 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationAppendStreamRequestHandoffExecution } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationAppendStreamRequestHandoffExecution = "server"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "client" | "server" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/conversationhistoryobject.md: -------------------------------------------------------------------------------- 1 | # ConversationHistoryObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationHistoryObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationHistoryObject = "conversation.history"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation.history" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/conversationinputs.md: -------------------------------------------------------------------------------- 1 | # ConversationInputs 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.InputEntries[]` 13 | 14 | ```typescript 15 | const value: components.InputEntries[] = [ 16 | { 17 | object: "entry", 18 | type: "function.result", 19 | toolCallId: "", 20 | result: "", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /docs/models/components/conversationmessagesobject.md: -------------------------------------------------------------------------------- 1 | # ConversationMessagesObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationMessagesObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationMessagesObject = "conversation.messages"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation.messages" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/conversationresponseobject.md: -------------------------------------------------------------------------------- 1 | # ConversationResponseObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationResponseObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationResponseObject = "conversation.response"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation.response" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/conversationrestartrequesthandoffexecution.md: -------------------------------------------------------------------------------- 1 | # ConversationRestartRequestHandoffExecution 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationRestartRequestHandoffExecution } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationRestartRequestHandoffExecution = "client"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "client" | "server" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/conversationrestartstreamrequesthandoffexecution.md: -------------------------------------------------------------------------------- 1 | # ConversationRestartStreamRequestHandoffExecution 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationRestartStreamRequestHandoffExecution } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationRestartStreamRequestHandoffExecution = "server"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "client" | "server" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/conversationstreamrequesthandoffexecution.md: -------------------------------------------------------------------------------- 1 | # ConversationStreamRequestHandoffExecution 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ConversationStreamRequestHandoffExecution } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ConversationStreamRequestHandoffExecution = "server"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "client" | "server" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/data.md: -------------------------------------------------------------------------------- 1 | # Data 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.BaseModelCard` 7 | 8 | ```typescript 9 | const value: components.BaseModelCard = { 10 | id: "", 11 | capabilities: {}, 12 | }; 13 | ``` 14 | 15 | ### `components.FTModelCard` 16 | 17 | ```typescript 18 | const value: components.FTModelCard = { 19 | id: "", 20 | capabilities: {}, 21 | job: "Global Assurance Orchestrator", 22 | root: "", 23 | }; 24 | ``` 25 | 26 | -------------------------------------------------------------------------------- /docs/models/components/document.md: -------------------------------------------------------------------------------- 1 | # Document 2 | 3 | Document to run OCR on 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.DocumentURLChunk` 9 | 10 | ```typescript 11 | const value: components.DocumentURLChunk = { 12 | documentUrl: "https://apprehensive-saloon.biz", 13 | }; 14 | ``` 15 | 16 | ### `components.ImageURLChunk` 17 | 18 | ```typescript 19 | const value: components.ImageURLChunk = { 20 | imageUrl: "https://grave-bran.info/", 21 | }; 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /docs/models/components/documentlibrarytooltype.md: -------------------------------------------------------------------------------- 1 | # DocumentLibraryToolType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentLibraryToolType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: DocumentLibraryToolType = "document_library"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "document_library" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/documenturlchunktype.md: -------------------------------------------------------------------------------- 1 | # DocumentURLChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { DocumentURLChunkType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: DocumentURLChunkType = "document_url"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "document_url" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/embeddingdtype.md: -------------------------------------------------------------------------------- 1 | # EmbeddingDtype 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { EmbeddingDtype } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: EmbeddingDtype = "ubinary"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "float" | "int8" | "uint8" | "binary" | "ubinary" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/embeddingrequestinputs.md: -------------------------------------------------------------------------------- 1 | # EmbeddingRequestInputs 2 | 3 | Text to embed. 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = "[\"Embed this sentence.\",\"As well as this one.\"]"; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "Embed this sentence.", 19 | "As well as this one.", 20 | ]; 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /docs/models/components/embeddingresponsedata.md: -------------------------------------------------------------------------------- 1 | # EmbeddingResponseData 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { EmbeddingResponseData } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: EmbeddingResponseData = { 9 | object: "embedding", 10 | embedding: [ 11 | 0.4, 12 | 0.5, 13 | 0.6, 14 | ], 15 | index: 1, 16 | }; 17 | ``` 18 | 19 | ## Fields 20 | 21 | | Field | Type | Required | Description | Example | 22 | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | 23 | | `object` | *string* | :heavy_minus_sign: | N/A | embedding | 24 | | `embedding` | *number*[] | :heavy_minus_sign: | N/A | [
0.1,
0.2,
0.3
] | 25 | | `index` | *number* | :heavy_minus_sign: | N/A | 0 | -------------------------------------------------------------------------------- /docs/models/components/filepurpose.md: -------------------------------------------------------------------------------- 1 | # FilePurpose 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FilePurpose } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FilePurpose = "batch"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "fine-tune" | "batch" | "ocr" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/filesignedurl.md: -------------------------------------------------------------------------------- 1 | # FileSignedURL 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FileSignedURL } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FileSignedURL = { 9 | url: "https://dental-chasuble.info", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `url` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/fimcompletionrequeststop.md: -------------------------------------------------------------------------------- 1 | # FIMCompletionRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/fimcompletionstreamrequeststop.md: -------------------------------------------------------------------------------- 1 | # FIMCompletionStreamRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/finetuneablemodeltype.md: -------------------------------------------------------------------------------- 1 | # FineTuneableModelType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FineTuneableModelType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FineTuneableModelType = "classifier"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "completion" | "classifier" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/finishreason.md: -------------------------------------------------------------------------------- 1 | # FinishReason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FinishReason } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FinishReason = "stop"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "stop" | "length" | "model_length" | "error" | "tool_calls" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/ftclassifierlossfunction.md: -------------------------------------------------------------------------------- 1 | # FTClassifierLossFunction 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FTClassifierLossFunction } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FTClassifierLossFunction = "single_class"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "single_class" | "multi_class" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/ftmodelcapabilitiesout.md: -------------------------------------------------------------------------------- 1 | # FTModelCapabilitiesOut 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FTModelCapabilitiesOut } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FTModelCapabilitiesOut = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `completionChat` | *boolean* | :heavy_minus_sign: | N/A | 16 | | `completionFim` | *boolean* | :heavy_minus_sign: | N/A | 17 | | `functionCalling` | *boolean* | :heavy_minus_sign: | N/A | 18 | | `fineTuning` | *boolean* | :heavy_minus_sign: | N/A | 19 | | `classification` | *boolean* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/ftmodelcardtype.md: -------------------------------------------------------------------------------- 1 | # FTModelCardType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FTModelCardType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FTModelCardType = "fine-tuned"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "fine-tuned" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/functioncall.md: -------------------------------------------------------------------------------- 1 | # FunctionCall 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionCall } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionCall = { 9 | name: "", 10 | arguments: "", 11 | }; 12 | ``` 13 | 14 | ## Fields 15 | 16 | | Field | Type | Required | Description | 17 | | ---------------------- | ---------------------- | ---------------------- | ---------------------- | 18 | | `name` | *string* | :heavy_check_mark: | N/A | 19 | | `arguments` | *components.Arguments* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/functioncallentryarguments.md: -------------------------------------------------------------------------------- 1 | # FunctionCallEntryArguments 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `{ [k: string]: any }` 7 | 8 | ```typescript 9 | const value: { [k: string]: any } = { 10 | "key": "", 11 | }; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = ""; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/functioncallentryobject.md: -------------------------------------------------------------------------------- 1 | # FunctionCallEntryObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionCallEntryObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionCallEntryObject = "entry"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "entry" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/functioncallentrytype.md: -------------------------------------------------------------------------------- 1 | # FunctionCallEntryType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionCallEntryType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionCallEntryType = "function.call"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "function.call" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/functioncalleventtype.md: -------------------------------------------------------------------------------- 1 | # FunctionCallEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionCallEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionCallEventType = "function.call.delta"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "function.call.delta" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/functionname.md: -------------------------------------------------------------------------------- 1 | # FunctionName 2 | 3 | this restriction of `Function` is used to select a specific function to call 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { FunctionName } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: FunctionName = { 11 | name: "", 12 | }; 13 | ``` 14 | 15 | ## Fields 16 | 17 | | Field | Type | Required | Description | 18 | | ------------------ | ------------------ | ------------------ | ------------------ | 19 | | `name` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/functionresultentryobject.md: -------------------------------------------------------------------------------- 1 | # FunctionResultEntryObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionResultEntryObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionResultEntryObject = "entry"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "entry" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/functionresultentrytype.md: -------------------------------------------------------------------------------- 1 | # FunctionResultEntryType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionResultEntryType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionResultEntryType = "function.result"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "function.result" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/functiont.md: -------------------------------------------------------------------------------- 1 | # FunctionT 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionT } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionT = { 9 | name: "", 10 | parameters: { 11 | "key": "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | --------------------- | --------------------- | --------------------- | --------------------- | 20 | | `name` | *string* | :heavy_check_mark: | N/A | 21 | | `description` | *string* | :heavy_minus_sign: | N/A | 22 | | `strict` | *boolean* | :heavy_minus_sign: | N/A | 23 | | `parameters` | Record | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/functiontooltype.md: -------------------------------------------------------------------------------- 1 | # FunctionToolType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionToolType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: FunctionToolType = "function"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "function" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/githubrepositoryintype.md: -------------------------------------------------------------------------------- 1 | # GithubRepositoryInType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { GithubRepositoryInType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: GithubRepositoryInType = "github"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "github" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/githubrepositoryouttype.md: -------------------------------------------------------------------------------- 1 | # GithubRepositoryOutType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { GithubRepositoryOutType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: GithubRepositoryOutType = "github"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "github" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/handoffexecution.md: -------------------------------------------------------------------------------- 1 | # HandoffExecution 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { HandoffExecution } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: HandoffExecution = "client"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "client" | "server" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/hyperparameters.md: -------------------------------------------------------------------------------- 1 | # Hyperparameters 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.CompletionTrainingParametersIn` 7 | 8 | ```typescript 9 | const value: components.CompletionTrainingParametersIn = {}; 10 | ``` 11 | 12 | ### `components.ClassifierTrainingParametersIn` 13 | 14 | ```typescript 15 | const value: components.ClassifierTrainingParametersIn = {}; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/imagegenerationtooltype.md: -------------------------------------------------------------------------------- 1 | # ImageGenerationToolType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ImageGenerationToolType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ImageGenerationToolType = "image_generation"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "image_generation" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/imageurl.md: -------------------------------------------------------------------------------- 1 | # ImageURL 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ImageURL } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ImageURL = { 9 | url: "https://runny-epic.net", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `url` | *string* | :heavy_check_mark: | N/A | 18 | | `detail` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/imageurlchunkimageurl.md: -------------------------------------------------------------------------------- 1 | # ImageURLChunkImageURL 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ImageURL` 7 | 8 | ```typescript 9 | const value: components.ImageURL = { 10 | url: "https://white-digestive.name", 11 | }; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = ""; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /docs/models/components/imageurlchunktype.md: -------------------------------------------------------------------------------- 1 | # ImageURLChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ImageURLChunkType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ImageURLChunkType = "image_url"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "image_url" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/inputentries.md: -------------------------------------------------------------------------------- 1 | # InputEntries 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.MessageInputEntry` 7 | 8 | ```typescript 9 | const value: components.MessageInputEntry = { 10 | role: "user", 11 | content: "", 12 | }; 13 | ``` 14 | 15 | ### `components.FunctionResultEntry` 16 | 17 | ```typescript 18 | const value: components.FunctionResultEntry = { 19 | toolCallId: "", 20 | result: "", 21 | }; 22 | ``` 23 | 24 | -------------------------------------------------------------------------------- /docs/models/components/inputs.md: -------------------------------------------------------------------------------- 1 | # Inputs 2 | 3 | Chat to classify 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.InstructRequestInputs` 9 | 10 | ```typescript 11 | const value: components.InstructRequestInputs = { 12 | messages: [ 13 | { 14 | content: [ 15 | { 16 | text: "", 17 | type: "text", 18 | }, 19 | ], 20 | role: "system", 21 | }, 22 | ], 23 | }; 24 | ``` 25 | 26 | ### `components.InstructRequest[]` 27 | 28 | ```typescript 29 | const value: components.InstructRequest[] = [ 30 | { 31 | messages: [ 32 | { 33 | content: [ 34 | { 35 | documentUrl: "https://shocked-characterization.org", 36 | type: "document_url", 37 | }, 38 | ], 39 | role: "user", 40 | }, 41 | ], 42 | }, 43 | ]; 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /docs/models/components/instructrequestmessages.md: -------------------------------------------------------------------------------- 1 | # InstructRequestMessages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: "", 17 | }; 18 | ``` 19 | 20 | ### `components.ToolMessage` 21 | 22 | ```typescript 23 | const value: components.ToolMessage = { 24 | content: "", 25 | }; 26 | ``` 27 | 28 | ### `components.UserMessage` 29 | 30 | ```typescript 31 | const value: components.UserMessage = { 32 | content: "", 33 | }; 34 | ``` 35 | 36 | -------------------------------------------------------------------------------- /docs/models/components/integrations.md: -------------------------------------------------------------------------------- 1 | # Integrations 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.WandbIntegrationOut` 7 | 8 | ```typescript 9 | const value: components.WandbIntegrationOut = { 10 | project: "", 11 | }; 12 | ``` 13 | 14 | -------------------------------------------------------------------------------- /docs/models/components/jobinintegrations.md: -------------------------------------------------------------------------------- 1 | # JobInIntegrations 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.WandbIntegration` 7 | 8 | ```typescript 9 | const value: components.WandbIntegration = { 10 | project: "", 11 | apiKey: "", 12 | }; 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /docs/models/components/jobinrepositories.md: -------------------------------------------------------------------------------- 1 | # JobInRepositories 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.GithubRepositoryIn` 7 | 8 | ```typescript 9 | const value: components.GithubRepositoryIn = { 10 | name: "", 11 | owner: "", 12 | token: "", 13 | }; 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /docs/models/components/jobsoutdata.md: -------------------------------------------------------------------------------- 1 | # JobsOutData 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ClassifierJobOut` 7 | 8 | ```typescript 9 | const value: components.ClassifierJobOut = { 10 | id: "5fcbe189-f431-40ea-9c49-17fe5f3ffcad", 11 | autoStart: false, 12 | model: "Roadster", 13 | status: "FAILED", 14 | createdAt: 13236, 15 | modifiedAt: 347233, 16 | trainingFiles: [ 17 | "2f77a52d-3831-4dff-8ec5-16320b0c211a", 18 | ], 19 | hyperparameters: {}, 20 | }; 21 | ``` 22 | 23 | ### `components.CompletionJobOut` 24 | 25 | ```typescript 26 | const value: components.CompletionJobOut = { 27 | id: "68db4204-47ab-4462-ac0b-cc45945370c1", 28 | autoStart: false, 29 | model: "Colorado", 30 | status: "FAILED_VALIDATION", 31 | createdAt: 959434, 32 | modifiedAt: 645570, 33 | trainingFiles: [ 34 | "0688a426-f2e8-47e7-9b6e-bb5ca32cf79d", 35 | ], 36 | hyperparameters: {}, 37 | }; 38 | ``` 39 | 40 | -------------------------------------------------------------------------------- /docs/models/components/jobsoutobject.md: -------------------------------------------------------------------------------- 1 | # JobsOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { JobsOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: JobsOutObject = "list"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "list" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/jobtype.md: -------------------------------------------------------------------------------- 1 | # JobType 2 | 3 | The type of job (`FT` for fine-tuning). 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { JobType } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: JobType = "completion"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "completion" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/jsonschema.md: -------------------------------------------------------------------------------- 1 | # JsonSchema 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { JsonSchema } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: JsonSchema = { 9 | name: "", 10 | schemaDefinition: { 11 | "key": "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | --------------------- | --------------------- | --------------------- | --------------------- | 20 | | `name` | *string* | :heavy_check_mark: | N/A | 21 | | `description` | *string* | :heavy_minus_sign: | N/A | 22 | | `schemaDefinition` | Record | :heavy_check_mark: | N/A | 23 | | `strict` | *boolean* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/legacyjobmetadataoutobject.md: -------------------------------------------------------------------------------- 1 | # LegacyJobMetadataOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { LegacyJobMetadataOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: LegacyJobMetadataOutObject = "job.metadata"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "job.metadata" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/loc.md: -------------------------------------------------------------------------------- 1 | # Loc 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 437587; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /docs/models/components/messageentries.md: -------------------------------------------------------------------------------- 1 | # MessageEntries 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.MessageInputEntry` 7 | 8 | ```typescript 9 | const value: components.MessageInputEntry = { 10 | role: "user", 11 | content: "", 12 | }; 13 | ``` 14 | 15 | ### `components.MessageOutputEntry` 16 | 17 | ```typescript 18 | const value: components.MessageOutputEntry = { 19 | content: "", 20 | }; 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /docs/models/components/messageinputcontentchunks.md: -------------------------------------------------------------------------------- 1 | # MessageInputContentChunks 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.TextChunk` 7 | 8 | ```typescript 9 | const value: components.TextChunk = { 10 | text: "", 11 | }; 12 | ``` 13 | 14 | ### `components.ImageURLChunk` 15 | 16 | ```typescript 17 | const value: components.ImageURLChunk = { 18 | imageUrl: { 19 | url: "https://strident-metal.info", 20 | }, 21 | }; 22 | ``` 23 | 24 | ### `components.ToolFileChunk` 25 | 26 | ```typescript 27 | const value: components.ToolFileChunk = { 28 | tool: "web_search", 29 | fileId: "", 30 | }; 31 | ``` 32 | 33 | ### `components.DocumentURLChunk` 34 | 35 | ```typescript 36 | const value: components.DocumentURLChunk = { 37 | documentUrl: "https://kosher-puppet.org", 38 | }; 39 | ``` 40 | 41 | -------------------------------------------------------------------------------- /docs/models/components/messageinputentrycontent.md: -------------------------------------------------------------------------------- 1 | # MessageInputEntryContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.MessageInputContentChunks[]` 13 | 14 | ```typescript 15 | const value: components.MessageInputContentChunks[] = [ 16 | { 17 | imageUrl: { 18 | url: "https://strict-pressure.com", 19 | }, 20 | type: "image_url", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /docs/models/components/messageinputentryrole.md: -------------------------------------------------------------------------------- 1 | # MessageInputEntryRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MessageInputEntryRole } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: MessageInputEntryRole = "user"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "assistant" | "user" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/messageinputentrytype.md: -------------------------------------------------------------------------------- 1 | # MessageInputEntryType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MessageInputEntryType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: MessageInputEntryType = "message.input"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "message.input" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/messageoutputentrycontent.md: -------------------------------------------------------------------------------- 1 | # MessageOutputEntryContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.MessageOutputContentChunks[]` 13 | 14 | ```typescript 15 | const value: components.MessageOutputContentChunks[] = [ 16 | { 17 | documentUrl: "https://favorite-lid.com", 18 | type: "document_url", 19 | }, 20 | ]; 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /docs/models/components/messageoutputentryobject.md: -------------------------------------------------------------------------------- 1 | # MessageOutputEntryObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MessageOutputEntryObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: MessageOutputEntryObject = "entry"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "entry" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/messageoutputentryrole.md: -------------------------------------------------------------------------------- 1 | # MessageOutputEntryRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MessageOutputEntryRole } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: MessageOutputEntryRole = "assistant"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "assistant" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/messageoutputentrytype.md: -------------------------------------------------------------------------------- 1 | # MessageOutputEntryType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MessageOutputEntryType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: MessageOutputEntryType = "message.output"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "message.output" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/messageoutputeventcontent.md: -------------------------------------------------------------------------------- 1 | # MessageOutputEventContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.OutputContentChunks` 13 | 14 | ```typescript 15 | const value: components.OutputContentChunks = { 16 | text: "", 17 | type: "text", 18 | }; 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /docs/models/components/messageoutputeventrole.md: -------------------------------------------------------------------------------- 1 | # MessageOutputEventRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MessageOutputEventRole } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: MessageOutputEventRole = "assistant"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "assistant" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/messageoutputeventtype.md: -------------------------------------------------------------------------------- 1 | # MessageOutputEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { MessageOutputEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: MessageOutputEventType = "message.output.delta"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "message.output.delta" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/messages.md: -------------------------------------------------------------------------------- 1 | # Messages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: "", 17 | }; 18 | ``` 19 | 20 | ### `components.ToolMessage` 21 | 22 | ```typescript 23 | const value: components.ToolMessage = { 24 | content: "", 25 | }; 26 | ``` 27 | 28 | ### `components.UserMessage` 29 | 30 | ```typescript 31 | const value: components.UserMessage = { 32 | content: [ 33 | { 34 | referenceIds: [ 35 | 102413, 36 | ], 37 | type: "reference", 38 | }, 39 | ], 40 | }; 41 | ``` 42 | 43 | -------------------------------------------------------------------------------- /docs/models/components/modelcapabilities.md: -------------------------------------------------------------------------------- 1 | # ModelCapabilities 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ModelCapabilities } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ModelCapabilities = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `completionChat` | *boolean* | :heavy_minus_sign: | N/A | 16 | | `completionFim` | *boolean* | :heavy_minus_sign: | N/A | 17 | | `functionCalling` | *boolean* | :heavy_minus_sign: | N/A | 18 | | `fineTuning` | *boolean* | :heavy_minus_sign: | N/A | 19 | | `vision` | *boolean* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/modelconversationobject.md: -------------------------------------------------------------------------------- 1 | # ModelConversationObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ModelConversationObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ModelConversationObject = "conversation"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/modellist.md: -------------------------------------------------------------------------------- 1 | # ModelList 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ModelList } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ModelList = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------- | ------------------- | ------------------- | ------------------- | 15 | | `object` | *string* | :heavy_minus_sign: | N/A | 16 | | `data` | *components.Data*[] | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/modeltype.md: -------------------------------------------------------------------------------- 1 | # ModelType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ModelType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ModelType = "completion"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "completion" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/moderationobject.md: -------------------------------------------------------------------------------- 1 | # ModerationObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ModerationObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ModerationObject = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 15 | | `categories` | Record | :heavy_minus_sign: | Moderation result thresholds | 16 | | `categoryScores` | Record | :heavy_minus_sign: | Moderation result | -------------------------------------------------------------------------------- /docs/models/components/objectt.md: -------------------------------------------------------------------------------- 1 | # ObjectT 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ObjectT } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ObjectT = "entry"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "entry" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/ocrusageinfo.md: -------------------------------------------------------------------------------- 1 | # OCRUsageInfo 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { OCRUsageInfo } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: OCRUsageInfo = { 9 | pagesProcessed: 899867, 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------------- | ------------------------- | ------------------------- | ------------------------- | 17 | | `pagesProcessed` | *number* | :heavy_check_mark: | Number of pages processed | 18 | | `docSizeBytes` | *number* | :heavy_minus_sign: | Document size in bytes | -------------------------------------------------------------------------------- /docs/models/components/one.md: -------------------------------------------------------------------------------- 1 | # One 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: [ 17 | { 18 | text: "", 19 | type: "text", 20 | }, 21 | ], 22 | }; 23 | ``` 24 | 25 | ### `components.ToolMessage` 26 | 27 | ```typescript 28 | const value: components.ToolMessage = { 29 | content: "", 30 | }; 31 | ``` 32 | 33 | ### `components.UserMessage` 34 | 35 | ```typescript 36 | const value: components.UserMessage = { 37 | content: [ 38 | { 39 | text: "", 40 | type: "text", 41 | }, 42 | ], 43 | }; 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /docs/models/components/outputs.md: -------------------------------------------------------------------------------- 1 | # Outputs 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.MessageOutputEntry` 7 | 8 | ```typescript 9 | const value: components.MessageOutputEntry = { 10 | content: "", 11 | }; 12 | ``` 13 | 14 | ### `components.ToolExecutionEntry` 15 | 16 | ```typescript 17 | const value: components.ToolExecutionEntry = { 18 | name: "web_search", 19 | }; 20 | ``` 21 | 22 | ### `components.FunctionCallEntry` 23 | 24 | ```typescript 25 | const value: components.FunctionCallEntry = { 26 | toolCallId: "", 27 | name: "", 28 | arguments: { 29 | "key": "", 30 | }, 31 | }; 32 | ``` 33 | 34 | ### `components.AgentHandoffEntry` 35 | 36 | ```typescript 37 | const value: components.AgentHandoffEntry = { 38 | previousAgentId: "", 39 | previousAgentName: "", 40 | nextAgentId: "", 41 | nextAgentName: "", 42 | }; 43 | ``` 44 | 45 | -------------------------------------------------------------------------------- /docs/models/components/prediction.md: -------------------------------------------------------------------------------- 1 | # Prediction 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Prediction } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: Prediction = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `type` | *string* | :heavy_minus_sign: | N/A | 16 | | `content` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/referencechunktype.md: -------------------------------------------------------------------------------- 1 | # ReferenceChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ReferenceChunkType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ReferenceChunkType = "reference"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "reference" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/repositories.md: -------------------------------------------------------------------------------- 1 | # Repositories 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.GithubRepositoryOut` 7 | 8 | ```typescript 9 | const value: components.GithubRepositoryOut = { 10 | name: "", 11 | owner: "", 12 | commitId: "", 13 | }; 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /docs/models/components/responsedoneeventtype.md: -------------------------------------------------------------------------------- 1 | # ResponseDoneEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ResponseDoneEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ResponseDoneEventType = "conversation.response.done"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation.response.done" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/responseerroreventtype.md: -------------------------------------------------------------------------------- 1 | # ResponseErrorEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ResponseErrorEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ResponseErrorEventType = "conversation.response.error"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation.response.error" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/responseformats.md: -------------------------------------------------------------------------------- 1 | # ResponseFormats 2 | 3 | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { ResponseFormats } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: ResponseFormats = "json_object"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "text" | "json_object" | "json_schema" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/responsestartedeventtype.md: -------------------------------------------------------------------------------- 1 | # ResponseStartedEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ResponseStartedEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ResponseStartedEventType = "conversation.response.started"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "conversation.response.started" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/role.md: -------------------------------------------------------------------------------- 1 | # Role 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Role } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: Role = "system"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "system" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/sampletype.md: -------------------------------------------------------------------------------- 1 | # SampleType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { SampleType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: SampleType = "instruct"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "pretrain" | "instruct" | "batch_request" | "batch_result" | "batch_error" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/security.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Security } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: Security = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `apiKey` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/source.md: -------------------------------------------------------------------------------- 1 | # Source 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Source } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: Source = "upload"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "upload" | "repository" | "mistral" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/ssetypes.md: -------------------------------------------------------------------------------- 1 | # SSETypes 2 | 3 | Server side events sent when streaming a conversation response. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { SSETypes } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: SSETypes = "message.output.delta"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "conversation.response.started" | "conversation.response.done" | "conversation.response.error" | "message.output.delta" | "tool.execution.started" | "tool.execution.done" | "agent.handoff.started" | "agent.handoff.done" | "function.call.delta" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/status.md: -------------------------------------------------------------------------------- 1 | # Status 2 | 3 | The current status of the fine-tuning job. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { Status } from "@mistralai/mistralai/models/components"; 9 | 10 | let value: Status = "FAILED_VALIDATION"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "QUEUED" | "STARTED" | "VALIDATING" | "VALIDATED" | "RUNNING" | "FAILED_VALIDATION" | "FAILED" | "SUCCESS" | "CANCELLED" | "CANCELLATION_REQUESTED" 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/stop.md: -------------------------------------------------------------------------------- 1 | # Stop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/systemmessagecontent.md: -------------------------------------------------------------------------------- 1 | # SystemMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.TextChunk[]` 13 | 14 | ```typescript 15 | const value: components.TextChunk[] = [ 16 | { 17 | text: "", 18 | }, 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /docs/models/components/textchunktype.md: -------------------------------------------------------------------------------- 1 | # TextChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { TextChunkType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: TextChunkType = "text"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "text" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolchoiceenum.md: -------------------------------------------------------------------------------- 1 | # ToolChoiceEnum 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolChoiceEnum } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolChoiceEnum = "any"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "auto" | "none" | "any" | "required" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolexecutiondoneeventtype.md: -------------------------------------------------------------------------------- 1 | # ToolExecutionDoneEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolExecutionDoneEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolExecutionDoneEventType = "tool.execution.done"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool.execution.done" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolexecutionentryobject.md: -------------------------------------------------------------------------------- 1 | # ToolExecutionEntryObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolExecutionEntryObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolExecutionEntryObject = "entry"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "entry" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolexecutionentrytype.md: -------------------------------------------------------------------------------- 1 | # ToolExecutionEntryType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolExecutionEntryType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolExecutionEntryType = "tool.execution"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool.execution" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolexecutionstartedeventtype.md: -------------------------------------------------------------------------------- 1 | # ToolExecutionStartedEventType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolExecutionStartedEventType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolExecutionStartedEventType = "tool.execution.started"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool.execution.started" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolfilechunktype.md: -------------------------------------------------------------------------------- 1 | # ToolFileChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolFileChunkType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolFileChunkType = "tool_file"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool_file" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolmessagecontent.md: -------------------------------------------------------------------------------- 1 | # ToolMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | referenceIds: [ 18 | 932562, 19 | ], 20 | type: "reference", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /docs/models/components/toolmessagerole.md: -------------------------------------------------------------------------------- 1 | # ToolMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolMessageRole } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolMessageRole = "tool"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/toolreferencechunktype.md: -------------------------------------------------------------------------------- 1 | # ToolReferenceChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolReferenceChunkType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolReferenceChunkType = "tool_reference"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool_reference" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/tooltypes.md: -------------------------------------------------------------------------------- 1 | # ToolTypes 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolTypes } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ToolTypes = "function"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "function" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /docs/models/components/trainingfile.md: -------------------------------------------------------------------------------- 1 | # TrainingFile 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { TrainingFile } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: TrainingFile = { 9 | fileId: "840b058e-1605-4943-b19b-af0a99f0bd85", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `fileId` | *string* | :heavy_check_mark: | N/A | 18 | | `weight` | *number* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/type.md: -------------------------------------------------------------------------------- 1 | # Type 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Type } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: Type = "base"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "base" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/unarchiveftmodeloutobject.md: -------------------------------------------------------------------------------- 1 | # UnarchiveFTModelOutObject 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UnarchiveFTModelOutObject } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: UnarchiveFTModelOutObject = "model"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "model" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/updateftmodelin.md: -------------------------------------------------------------------------------- 1 | # UpdateFTModelIn 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UpdateFTModelIn } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: UpdateFTModelIn = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `name` | *string* | :heavy_minus_sign: | N/A | 16 | | `description` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/components/usageinfo.md: -------------------------------------------------------------------------------- 1 | # UsageInfo 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UsageInfo } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: UsageInfo = { 9 | promptTokens: 16, 10 | completionTokens: 34, 11 | totalTokens: 50, 12 | }; 13 | ``` 14 | 15 | ## Fields 16 | 17 | | Field | Type | Required | Description | Example | 18 | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | 19 | | `promptTokens` | *number* | :heavy_check_mark: | N/A | 16 | 20 | | `completionTokens` | *number* | :heavy_check_mark: | N/A | 34 | 21 | | `totalTokens` | *number* | :heavy_check_mark: | N/A | 50 | -------------------------------------------------------------------------------- /docs/models/components/usermessagecontent.md: -------------------------------------------------------------------------------- 1 | # UserMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | imageUrl: { 18 | url: "https://oddball-devil.name/", 19 | }, 20 | type: "image_url", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /docs/models/components/usermessagerole.md: -------------------------------------------------------------------------------- 1 | # UserMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UserMessageRole } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: UserMessageRole = "user"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "user" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/validationerror.md: -------------------------------------------------------------------------------- 1 | # ValidationError 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ValidationError } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: ValidationError = { 9 | loc: [ 10 | 963663, 11 | ], 12 | msg: "", 13 | type: "", 14 | }; 15 | ``` 16 | 17 | ## Fields 18 | 19 | | Field | Type | Required | Description | 20 | | ------------------ | ------------------ | ------------------ | ------------------ | 21 | | `loc` | *components.Loc*[] | :heavy_check_mark: | N/A | 22 | | `msg` | *string* | :heavy_check_mark: | N/A | 23 | | `type` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/components/wandbintegrationouttype.md: -------------------------------------------------------------------------------- 1 | # WandbIntegrationOutType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { WandbIntegrationOutType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: WandbIntegrationOutType = "wandb"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "wandb" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/wandbintegrationtype.md: -------------------------------------------------------------------------------- 1 | # WandbIntegrationType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { WandbIntegrationType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: WandbIntegrationType = "wandb"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "wandb" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/websearchpremiumtooltype.md: -------------------------------------------------------------------------------- 1 | # WebSearchPremiumToolType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { WebSearchPremiumToolType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: WebSearchPremiumToolType = "web_search_premium"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "web_search_premium" 15 | ``` -------------------------------------------------------------------------------- /docs/models/components/websearchtooltype.md: -------------------------------------------------------------------------------- 1 | # WebSearchToolType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { WebSearchToolType } from "@mistralai/mistralai/models/components"; 7 | 8 | let value: WebSearchToolType = "web_search"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "web_search" 15 | ``` -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1agentsgetrequest.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1AgentsGetRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentsApiV1AgentsGetRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: AgentsApiV1AgentsGetRequest = { 9 | agentId: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `agentId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1agentslistrequest.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1AgentsListRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentsApiV1AgentsListRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: AgentsApiV1AgentsListRequest = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `page` | *number* | :heavy_minus_sign: | N/A | 16 | | `pageSize` | *number* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1agentsupdateversionrequest.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1AgentsUpdateVersionRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentsApiV1AgentsUpdateVersionRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: AgentsApiV1AgentsUpdateVersionRequest = { 9 | agentId: "", 10 | version: 5, 11 | }; 12 | ``` 13 | 14 | ## Fields 15 | 16 | | Field | Type | Required | Description | 17 | | ------------------ | ------------------ | ------------------ | ------------------ | 18 | | `agentId` | *string* | :heavy_check_mark: | N/A | 19 | | `version` | *number* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1conversationsgetrequest.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1ConversationsGetRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentsApiV1ConversationsGetRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: AgentsApiV1ConversationsGetRequest = { 9 | conversationId: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `conversationId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1conversationsgetresponsev1conversationsget.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1ConversationsGetResponseV1ConversationsGet 2 | 3 | Successful Response 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.ModelConversation` 9 | 10 | ```typescript 11 | const value: components.ModelConversation = { 12 | id: "", 13 | createdAt: new Date("2024-03-27T03:08:04.092Z"), 14 | updatedAt: new Date("2024-06-20T10:43:11.807Z"), 15 | model: "Camry", 16 | }; 17 | ``` 18 | 19 | ### `components.AgentConversation` 20 | 21 | ```typescript 22 | const value: components.AgentConversation = { 23 | id: "", 24 | createdAt: new Date("2024-10-07T03:33:36.949Z"), 25 | updatedAt: new Date("2025-04-05T13:13:41.181Z"), 26 | agentId: "", 27 | }; 28 | ``` 29 | 30 | -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1conversationshistoryrequest.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1ConversationsHistoryRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentsApiV1ConversationsHistoryRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: AgentsApiV1ConversationsHistoryRequest = { 9 | conversationId: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `conversationId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1conversationslistrequest.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1ConversationsListRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentsApiV1ConversationsListRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: AgentsApiV1ConversationsListRequest = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `page` | *number* | :heavy_minus_sign: | N/A | 16 | | `pageSize` | *number* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/agentsapiv1conversationsmessagesrequest.md: -------------------------------------------------------------------------------- 1 | # AgentsApiV1ConversationsMessagesRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AgentsApiV1ConversationsMessagesRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: AgentsApiV1ConversationsMessagesRequest = { 9 | conversationId: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `conversationId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/filesapiroutesdeletefilerequest.md: -------------------------------------------------------------------------------- 1 | # FilesApiRoutesDeleteFileRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FilesApiRoutesDeleteFileRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: FilesApiRoutesDeleteFileRequest = { 9 | fileId: "00810fd2-0f42-4b14-bfa8-6c2fd90be851", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `fileId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/filesapiroutesdownloadfilerequest.md: -------------------------------------------------------------------------------- 1 | # FilesApiRoutesDownloadFileRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FilesApiRoutesDownloadFileRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: FilesApiRoutesDownloadFileRequest = { 9 | fileId: "e1c0f984-e4df-4c81-8773-6527480ed8df", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `fileId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/filesapiroutesretrievefilerequest.md: -------------------------------------------------------------------------------- 1 | # FilesApiRoutesRetrieveFileRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FilesApiRoutesRetrieveFileRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: FilesApiRoutesRetrieveFileRequest = { 9 | fileId: "1ffb5442-825a-4b06-9ad7-f4074d34cb8b", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `fileId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/filet.md: -------------------------------------------------------------------------------- 1 | # FileT 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FileT } from "@mistralai/mistralai/models/operations"; 7 | 8 | // No examples available for this model 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 15 | | `fileName` | *string* | :heavy_check_mark: | N/A | 16 | | `content` | *ReadableStream* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/jobsapiroutesbatchcancelbatchjobrequest.md: -------------------------------------------------------------------------------- 1 | # JobsApiRoutesBatchCancelBatchJobRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { JobsApiRoutesBatchCancelBatchJobRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: JobsApiRoutesBatchCancelBatchJobRequest = { 9 | jobId: "d4ad9fb1-8bc0-4bdb-a878-be9eb1844559", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `jobId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/jobsapiroutesbatchgetbatchjobrequest.md: -------------------------------------------------------------------------------- 1 | # JobsApiRoutesBatchGetBatchJobRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { JobsApiRoutesBatchGetBatchJobRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: JobsApiRoutesBatchGetBatchJobRequest = { 9 | jobId: "69f2e177-357d-4f8d-8953-680293d511e1", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `jobId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/jobsapiroutesfinetuningcancelfinetuningjobrequest.md: -------------------------------------------------------------------------------- 1 | # JobsApiRoutesFineTuningCancelFineTuningJobRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { JobsApiRoutesFineTuningCancelFineTuningJobRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: JobsApiRoutesFineTuningCancelFineTuningJobRequest = { 9 | jobId: "8bce286e-1fe1-47bb-bec4-7b2374d95dcf", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | 17 | | `jobId` | *string* | :heavy_check_mark: | The ID of the job to cancel. | -------------------------------------------------------------------------------- /docs/models/operations/jobsapiroutesfinetuninggetfinetuningjobrequest.md: -------------------------------------------------------------------------------- 1 | # JobsApiRoutesFineTuningGetFineTuningJobRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { JobsApiRoutesFineTuningGetFineTuningJobRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: JobsApiRoutesFineTuningGetFineTuningJobRequest = { 9 | jobId: "115cbbc4-88bf-44ca-a9cf-02c1834b0d78", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | 17 | | `jobId` | *string* | :heavy_check_mark: | The ID of the job to analyse. | -------------------------------------------------------------------------------- /docs/models/operations/jobsapiroutesfinetuningstartfinetuningjobrequest.md: -------------------------------------------------------------------------------- 1 | # JobsApiRoutesFineTuningStartFineTuningJobRequest 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { JobsApiRoutesFineTuningStartFineTuningJobRequest } from "@mistralai/mistralai/models/operations"; 7 | 8 | let value: JobsApiRoutesFineTuningStartFineTuningJobRequest = { 9 | jobId: "8f2e12b1-96be-4cd0-b486-34f450d234e3", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `jobId` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /docs/models/operations/one.md: -------------------------------------------------------------------------------- 1 | # One 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ClassifierJobOut` 7 | 8 | ```typescript 9 | const value: components.ClassifierJobOut = { 10 | id: "5d1ac26e-1096-4ce4-a679-fb64f2bea635", 11 | autoStart: false, 12 | model: "LeBaron", 13 | status: "CANCELLATION_REQUESTED", 14 | createdAt: 866861, 15 | modifiedAt: 816151, 16 | trainingFiles: [ 17 | "e4568a40-64fe-4da5-b8d1-c0dc0a822c9f", 18 | ], 19 | hyperparameters: {}, 20 | }; 21 | ``` 22 | 23 | ### `components.CompletionJobOut` 24 | 25 | ```typescript 26 | const value: components.CompletionJobOut = { 27 | id: "f1f37c39-2115-406a-9611-42f2c998f5c8", 28 | autoStart: false, 29 | model: "Wrangler", 30 | status: "FAILED_VALIDATION", 31 | createdAt: 118917, 32 | modifiedAt: 417539, 33 | trainingFiles: [ 34 | "cbe4c79f-fd5e-4a60-9c8c-bc4c87a014f2", 35 | ], 36 | hyperparameters: {}, 37 | }; 38 | ``` 39 | 40 | -------------------------------------------------------------------------------- /docs/models/operations/responsebody.md: -------------------------------------------------------------------------------- 1 | # ResponseBody 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ModelConversation` 7 | 8 | ```typescript 9 | const value: components.ModelConversation = { 10 | id: "", 11 | createdAt: new Date("2024-09-30T05:20:17.730Z"), 12 | updatedAt: new Date("2023-04-28T18:57:30.321Z"), 13 | model: "Civic", 14 | }; 15 | ``` 16 | 17 | ### `components.AgentConversation` 18 | 19 | ```typescript 20 | const value: components.AgentConversation = { 21 | id: "", 22 | createdAt: new Date("2024-05-15T13:07:55.829Z"), 23 | updatedAt: new Date("2023-01-23T23:04:14.239Z"), 24 | agentId: "", 25 | }; 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /docs/models/operations/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md: -------------------------------------------------------------------------------- 1 | # RetrieveModelV1ModelsModelIdGetResponseRetrieveModelV1ModelsModelIdGet 2 | 3 | Successful Response 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `components.BaseModelCard` 9 | 10 | ```typescript 11 | const value: components.BaseModelCard = { 12 | id: "", 13 | capabilities: {}, 14 | }; 15 | ``` 16 | 17 | ### `components.FTModelCard` 18 | 19 | ```typescript 20 | const value: components.FTModelCard = { 21 | id: "", 22 | capabilities: {}, 23 | job: "Dynamic Brand Developer", 24 | root: "", 25 | }; 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /docs/models/operations/status.md: -------------------------------------------------------------------------------- 1 | # Status 2 | 3 | The current job state to filter on. When set, the other results are not displayed. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { Status } from "@mistralai/mistralai/models/operations"; 9 | 10 | let value: Status = "CANCELLATION_REQUESTED"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "QUEUED" | "STARTED" | "VALIDATING" | "VALIDATED" | "RUNNING" | "FAILED_VALIDATION" | "FAILED" | "SUCCESS" | "CANCELLED" | "CANCELLATION_REQUESTED" 17 | ``` -------------------------------------------------------------------------------- /docs/sdks/batch/README.md: -------------------------------------------------------------------------------- 1 | # Batch 2 | (*batch*) 3 | 4 | ## Overview 5 | 6 | ### Available Operations 7 | -------------------------------------------------------------------------------- /docs/sdks/beta/README.md: -------------------------------------------------------------------------------- 1 | # Beta 2 | (*beta*) 3 | 4 | ## Overview 5 | 6 | ### Available Operations 7 | -------------------------------------------------------------------------------- /docs/sdks/finetuning/README.md: -------------------------------------------------------------------------------- 1 | # FineTuning 2 | (*fineTuning*) 3 | 4 | ## Overview 5 | 6 | ### Available Operations 7 | -------------------------------------------------------------------------------- /docs/sdks/mistral/README.md: -------------------------------------------------------------------------------- 1 | # Mistral SDK 2 | 3 | ## Overview 4 | 5 | Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. 6 | 7 | ### Available Operations 8 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | 5 | /** @type {import('eslint').Linter.Config[]} */ 6 | export default [ 7 | { files: ["**/*.{js,mjs,cjs,ts}"] }, 8 | { languageOptions: { globals: globals.browser } }, 9 | pluginJs.configs.recommended, 10 | ...tseslint.configs.recommended, 11 | { 12 | rules: { 13 | "no-constant-condition": "off", 14 | // Handled by typescript compiler 15 | "@typescript-eslint/no-unused-vars": "off", 16 | "@typescript-eslint/no-explicit-any": "off", 17 | "@typescript-eslint/no-empty-object-type": "off", 18 | "@typescript-eslint/no-namespace": "off", 19 | }, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /examples/.env.template: -------------------------------------------------------------------------------- 1 | # Default auth 2 | MISTRAL_API_KEY= 3 | 4 | # Azure auth 5 | AZURE_ENDPOINT= 6 | AZURE_API_KEY= 7 | 8 | # Google auth 9 | GOOGLE_CLOUD_REGION= 10 | GOOGLE_PROJECT_ID= 11 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | .env -------------------------------------------------------------------------------- /examples/src/async_chat_no_streaming.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from "@mistralai/mistralai"; 2 | 3 | const apiKey = process.env["MISTRAL_API_KEY"]; 4 | if (!apiKey) { 5 | throw new Error("missing MISTRAL_API_KEY environment variable"); 6 | } 7 | 8 | const client = new Mistral({ apiKey: apiKey }); 9 | 10 | const chatResponse = await client.chat.complete({ 11 | model: "mistral-tiny", 12 | messages: [{ role: "user", content: "What is the best French cheese?" }], 13 | }); 14 | 15 | console.log("Chat:", chatResponse); 16 | -------------------------------------------------------------------------------- /examples/src/async_chat_streaming.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from "@mistralai/mistralai"; 2 | 3 | const apiKey = process.env["MISTRAL_API_KEY"]; 4 | if (!apiKey) { 5 | throw new Error("missing MISTRAL_API_KEY environment variable"); 6 | } 7 | 8 | const mistral = new Mistral({ apiKey: apiKey }); 9 | 10 | const stream = await mistral.chat.stream({ 11 | model: "mistral-tiny", 12 | messages: [ 13 | { 14 | role: "user", 15 | content: "What is the best French cheese?", 16 | }, 17 | ], 18 | }); 19 | 20 | for await (const event of stream) { 21 | const content = event.data?.choices[0]?.delta.content; 22 | if (!content) { 23 | continue; 24 | } 25 | 26 | process.stdout.write(content); 27 | } 28 | -------------------------------------------------------------------------------- /examples/src/async_chat_with_image_no_streaming.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from "@mistralai/mistralai"; 2 | 3 | const apiKey = process.env["MISTRAL_API_KEY"]; 4 | if (!apiKey) { 5 | throw new Error("missing MISTRAL_API_KEY environment variable"); 6 | } 7 | 8 | const client = new Mistral({ apiKey: apiKey }); 9 | 10 | const chatResponse = await client.chat.complete({ 11 | model: "pixtral-12b", 12 | messages: [ 13 | { 14 | role: "user", 15 | content: [ 16 | { type: "text", text: "What's in this image?" }, 17 | { 18 | type: "image_url", 19 | imageUrl: "https://tripfixers.com/wp-content/uploads/2019/11/eiffel-tower-with-snow.jpeg", 20 | }, 21 | ] 22 | } 23 | ], 24 | }); 25 | 26 | 27 | console.log('JSON:', chatResponse.choices[0].message.content) 28 | -------------------------------------------------------------------------------- /examples/src/async_embeddings.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from "@mistralai/mistralai"; 2 | 3 | const apiKey = process.env["MISTRAL_API_KEY"]; 4 | if (!apiKey) { 5 | throw new Error("missing MISTRAL_API_KEY environment variable"); 6 | } 7 | 8 | const client = new Mistral({ apiKey: apiKey }); 9 | 10 | const inputs = []; 11 | for (let i = 0; i < 1; i++) { 12 | inputs.push("What is the best French cheese?"); 13 | } 14 | 15 | const embeddingsBatchResponse = await client.embeddings.create({ 16 | model: "mistral-embed", 17 | inputs: inputs, 18 | }); 19 | 20 | console.log("Embeddings Batch:", embeddingsBatchResponse.data); 21 | -------------------------------------------------------------------------------- /examples/src/async_json_format.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from "@mistralai/mistralai"; 2 | 3 | const apiKey = process.env["MISTRAL_API_KEY"]; 4 | if (!apiKey) { 5 | throw new Error("missing MISTRAL_API_KEY environment variable"); 6 | } 7 | 8 | const mistral = new Mistral({ apiKey: apiKey }); 9 | 10 | const chatResponse = await mistral.chat.complete({ 11 | model: "mistral-large-latest", 12 | messages: [{ role: "user", content: "What is the best French cheese?" }], 13 | responseFormat: { type: "json_object" }, 14 | }); 15 | 16 | console.log("Chat:", chatResponse.choices[0].message.content); 17 | -------------------------------------------------------------------------------- /examples/src/async_list_models.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from "@mistralai/mistralai"; 2 | 3 | const apiKey = process.env["MISTRAL_API_KEY"]; 4 | if (!apiKey) { 5 | throw new Error("missing MISTRAL_API_KEY environment variable"); 6 | } 7 | 8 | const mistral = new Mistral({ apiKey: apiKey }); 9 | 10 | const listModelsResponse = await mistral.models.list(); 11 | 12 | listModelsResponse.data.forEach((model) => { 13 | console.log("Model:", model); 14 | }); 15 | -------------------------------------------------------------------------------- /examples/src/async_ocr_process_from_file.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from '@mistralai/mistralai'; 2 | import fs from 'fs'; 3 | 4 | const apiKey = process.env.MISTRAL_API_KEY; 5 | 6 | const client = new Mistral({ apiKey: apiKey }); 7 | 8 | 9 | const file_path = "/path/to/uploaded_file.pdf" 10 | const uploaded_file = fs.readFileSync(file_path); 11 | const uploaded_pdf = await client.files.upload({ 12 | file: { 13 | fileName: "uploaded_file.pdf", 14 | content: uploaded_file, 15 | }, 16 | purpose: "ocr" 17 | }); 18 | 19 | client.files.retrieve({ fileId: uploaded_pdf.id }) 20 | 21 | const ocrResponse = await client.ocr.process({ 22 | model: "mistral-ocr-latest", 23 | document: { 24 | type: "document_url", 25 | documentUrl: "https://arxiv.org/pdf/2201.04234" 26 | }, 27 | includeImageBase64: true 28 | }); 29 | console.log("OCR ", ocrResponse); -------------------------------------------------------------------------------- /examples/src/async_ocr_process_from_url.ts: -------------------------------------------------------------------------------- 1 | import { Mistral } from '@mistralai/mistralai'; 2 | 3 | const apiKey = process.env.MISTRAL_API_KEY; 4 | const client = new Mistral({ apiKey: apiKey }); 5 | 6 | const ocrResponse = await client.ocr.process({ 7 | model: "mistral-ocr-latest", 8 | document: { 9 | type: "document_url", 10 | documentUrl: "https://arxiv.org/pdf/2201.04234.pdf" 11 | }, 12 | includeImageBase64: true 13 | }); 14 | 15 | console.log("OCR:", ocrResponse); -------------------------------------------------------------------------------- /examples/src/azure/async_chat_no_streaming.ts: -------------------------------------------------------------------------------- 1 | import { MistralAzure } from "@mistralai/mistralai-azure"; 2 | 3 | const azureAPIKey = process.env["AZURE_API_KEY"]; 4 | if (!azureAPIKey) { 5 | throw new Error("missing AZURE_API_KEY environment variable"); 6 | } 7 | 8 | const azureEndpoint = process.env["AZURE_ENDPOINT"]; 9 | if (!azureEndpoint) { 10 | throw new Error("missing AZURE_ENDPOINT environment variable"); 11 | } 12 | 13 | const sdk = new MistralAzure({ 14 | apiKey: azureAPIKey, 15 | endpoint: azureEndpoint, 16 | }); 17 | 18 | const chatResult = await sdk.chat.complete({ 19 | messages: [ 20 | { 21 | role: "user", 22 | content: "What is the best French cheese ?", 23 | }, 24 | ], 25 | }); 26 | 27 | console.log("Success", chatResult); 28 | -------------------------------------------------------------------------------- /examples/src/file.jsonl: -------------------------------------------------------------------------------- 1 | {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already."}]} 2 | {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?"}]} 3 | {"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters.", "weight": 0}]} -------------------------------------------------------------------------------- /examples/src/gcp/async_chat_no_streaming.ts: -------------------------------------------------------------------------------- 1 | import { MistralGoogleCloud } from "@mistralai/mistralai-gcp"; 2 | 3 | const projectId = process.env["GOOGLE_PROJECT_ID"]; 4 | if (!projectId) { 5 | throw new Error("missing GOOGLE_PROJECT_ID environment variable"); 6 | } 7 | 8 | const sdk = new MistralGoogleCloud({ 9 | region: "europe-west4", 10 | projectId: projectId, 11 | }); 12 | 13 | const chatResult = await sdk.chat.complete({ 14 | model: "mistral-large-2407", 15 | messages: [ 16 | { 17 | role: "user", 18 | content: "What is the best French cheese ?", 19 | }, 20 | ], 21 | }); 22 | 23 | console.log("Success", chatResult); 24 | -------------------------------------------------------------------------------- /jsr.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "name": "@mistralai/mistralai", 5 | "version": "1.7.1", 6 | "exports": { 7 | ".": "./src/index.ts", 8 | "./models/errors": "./src/models/errors/index.ts", 9 | "./models/components": "./src/models/components/index.ts", 10 | "./models/operations": "./src/models/operations/index.ts", 11 | "./lib/config": "./src/lib/config.ts", 12 | "./lib/http": "./src/lib/http.ts", 13 | "./lib/retries": "./src/lib/retries.ts", 14 | "./lib/sdks": "./src/lib/sdks.ts", 15 | "./lib/event-streams": "./src/lib/event-streams.ts", 16 | "./types": "./src/types/index.ts" 17 | }, 18 | "publish": { 19 | "include": [ 20 | "LICENSE", 21 | "README.md", 22 | "RUNTIMES.md", 23 | "USAGE.md", 24 | "jsr.json", 25 | "src/**/*.ts" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mistralai/mistralai", 3 | "version": "1.7.1", 4 | "author": "Speakeasy", 5 | "main": "./index.js", 6 | "sideEffects": false, 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/mistralai/client-ts.git" 10 | }, 11 | "scripts": { 12 | "lint": "eslint --cache --max-warnings=0 src", 13 | "build": "tsc", 14 | "prepublishOnly": "npm run build" 15 | }, 16 | "peerDependencies": { 17 | "zod": ">= 3" 18 | }, 19 | "devDependencies": { 20 | "@eslint/js": "^9.19.0", 21 | "eslint": "^9.19.0", 22 | "globals": "^15.14.0", 23 | "typescript": "^5.4.5", 24 | "typescript-eslint": "^8.22.0", 25 | "zod": "^3.23.4" 26 | }, 27 | "dependencies": { 28 | "zod-to-json-schema": "^3.24.1" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /packages/mistralai-azure/.genignore: -------------------------------------------------------------------------------- 1 | src/sdk/sdk.ts 2 | README.md 3 | USAGE.md 4 | docs/sdks/**/README.md -------------------------------------------------------------------------------- /packages/mistralai-azure/.gitattributes: -------------------------------------------------------------------------------- 1 | # This allows generated code to be indexed correctly 2 | *.ts linguist-generated=false -------------------------------------------------------------------------------- /packages/mistralai-azure/.gitignore: -------------------------------------------------------------------------------- 1 | /mcp-server 2 | /bin 3 | /.eslintcache 4 | /react-query 5 | /.speakeasy/reports 6 | /__tests__ 7 | /core.* 8 | /funcs 9 | /models 10 | /models/errors 11 | /types 12 | /node_modules 13 | /lib 14 | /sdk 15 | /hooks 16 | /index.* 17 | /cjs 18 | /esm 19 | /dist 20 | /.tsbuildinfo 21 | /.tshy 22 | /.tshy-* 23 | -------------------------------------------------------------------------------- /packages/mistralai-azure/.npmignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !/FUNCTIONS.md 3 | !/RUNTIMES.md 4 | !/REACT_QUERY.md 5 | !/**/*.ts 6 | !/**/*.js 7 | !/**/*.mjs 8 | !/**/*.json 9 | !/**/*.map 10 | 11 | /eslint.config.mjs 12 | /cjs 13 | /.tshy 14 | /.tshy-* 15 | /__tests__ 16 | -------------------------------------------------------------------------------- /packages/mistralai-azure/USAGE.md: -------------------------------------------------------------------------------- 1 | 2 | ### Create Chat Completions 3 | 4 | This example shows how to create chat completions. 5 | 6 | ```typescript 7 | import { MistralAzure } from "@mistralai/mistralai-azure"; 8 | 9 | const mistralAzure = new MistralAzure({ 10 | apiKey: process.env.["AZURE_API_KEY"], 11 | endpoint: process.env.["AZURE_ENDPOINT"], 12 | }); 13 | 14 | async function run() { 15 | const result = await mistralAzure.chat.complete({ 16 | model: "azureai", 17 | messages: [ 18 | { 19 | content: "Who is the best French painter? Answer in one short sentence.", 20 | role: "user", 21 | }, 22 | ], 23 | }); 24 | 25 | // Handle the result 26 | console.log(result); 27 | } 28 | 29 | run(); 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/arguments.md: -------------------------------------------------------------------------------- 1 | # Arguments 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `{ [k: string]: any }` 7 | 8 | ```typescript 9 | const value: { [k: string]: any } = { 10 | "key": "", 11 | }; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = ""; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/assistantmessagecontent.md: -------------------------------------------------------------------------------- 1 | # AssistantMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | imageUrl: { 18 | url: "https://jittery-window.com", 19 | }, 20 | type: "image_url", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/assistantmessagerole.md: -------------------------------------------------------------------------------- 1 | # AssistantMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AssistantMessageRole } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: AssistantMessageRole = "assistant"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "assistant" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/chatcompletionchoicefinishreason.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionChoiceFinishReason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ChatCompletionChoiceFinishReason } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ChatCompletionChoiceFinishReason = "stop"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "stop" | "length" | "model_length" | "error" | "tool_calls" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/chatcompletionrequestmessages.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionRequestMessages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: "", 17 | }; 18 | ``` 19 | 20 | ### `components.ToolMessage` 21 | 22 | ```typescript 23 | const value: components.ToolMessage = { 24 | content: [ 25 | { 26 | imageUrl: { 27 | url: "https://sugary-brace.org/", 28 | }, 29 | type: "image_url", 30 | }, 31 | ], 32 | }; 33 | ``` 34 | 35 | ### `components.UserMessage` 36 | 37 | ```typescript 38 | const value: components.UserMessage = { 39 | content: "", 40 | }; 41 | ``` 42 | 43 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/chatcompletionrequeststop.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/chatcompletionrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "required"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/chatcompletionstreamrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionStreamRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "none"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/content.md: -------------------------------------------------------------------------------- 1 | # Content 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | text: "", 18 | type: "text", 19 | }, 20 | ]; 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/contentchunk.md: -------------------------------------------------------------------------------- 1 | # ContentChunk 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ImageURLChunk` 7 | 8 | ```typescript 9 | const value: components.ImageURLChunk = { 10 | imageUrl: "https://blaring-bog.com", 11 | }; 12 | ``` 13 | 14 | ### `components.TextChunk` 15 | 16 | ```typescript 17 | const value: components.TextChunk = { 18 | text: "", 19 | }; 20 | ``` 21 | 22 | ### `components.ReferenceChunk` 23 | 24 | ```typescript 25 | const value: components.ReferenceChunk = { 26 | referenceIds: [ 27 | 832620, 28 | ], 29 | }; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/finishreason.md: -------------------------------------------------------------------------------- 1 | # FinishReason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FinishReason } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: FinishReason = "length"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "stop" | "length" | "error" | "tool_calls" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/functioncall.md: -------------------------------------------------------------------------------- 1 | # FunctionCall 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionCall } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: FunctionCall = { 9 | name: "", 10 | arguments: "", 11 | }; 12 | ``` 13 | 14 | ## Fields 15 | 16 | | Field | Type | Required | Description | 17 | | ---------------------- | ---------------------- | ---------------------- | ---------------------- | 18 | | `name` | *string* | :heavy_check_mark: | N/A | 19 | | `arguments` | *components.Arguments* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/functionname.md: -------------------------------------------------------------------------------- 1 | # FunctionName 2 | 3 | this restriction of `Function` is used to select a specific function to call 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { FunctionName } from "@mistralai/mistralai-azure/models/components"; 9 | 10 | let value: FunctionName = { 11 | name: "", 12 | }; 13 | ``` 14 | 15 | ## Fields 16 | 17 | | Field | Type | Required | Description | 18 | | ------------------ | ------------------ | ------------------ | ------------------ | 19 | | `name` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/functiont.md: -------------------------------------------------------------------------------- 1 | # FunctionT 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionT } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: FunctionT = { 9 | name: "", 10 | parameters: { 11 | "key": "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | --------------------- | --------------------- | --------------------- | --------------------- | 20 | | `name` | *string* | :heavy_check_mark: | N/A | 21 | | `description` | *string* | :heavy_minus_sign: | N/A | 22 | | `strict` | *boolean* | :heavy_minus_sign: | N/A | 23 | | `parameters` | Record | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/imageurl.md: -------------------------------------------------------------------------------- 1 | # ImageURL 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ImageURL } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ImageURL = { 9 | url: "https://misguided-hawk.biz", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `url` | *string* | :heavy_check_mark: | N/A | 18 | | `detail` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/imageurlchunkimageurl.md: -------------------------------------------------------------------------------- 1 | # ImageURLChunkImageURL 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ImageURL` 7 | 8 | ```typescript 9 | const value: components.ImageURL = { 10 | url: "https://true-wasabi.net", 11 | }; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = ""; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/imageurlchunktype.md: -------------------------------------------------------------------------------- 1 | # ImageURLChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ImageURLChunkType } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ImageURLChunkType = "image_url"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "image_url" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/loc.md: -------------------------------------------------------------------------------- 1 | # Loc 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 456150; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/messages.md: -------------------------------------------------------------------------------- 1 | # Messages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: [ 17 | { 18 | text: "", 19 | type: "text", 20 | }, 21 | ], 22 | }; 23 | ``` 24 | 25 | ### `components.ToolMessage` 26 | 27 | ```typescript 28 | const value: components.ToolMessage = { 29 | content: [ 30 | { 31 | text: "", 32 | type: "text", 33 | }, 34 | ], 35 | }; 36 | ``` 37 | 38 | ### `components.UserMessage` 39 | 40 | ```typescript 41 | const value: components.UserMessage = { 42 | content: [ 43 | { 44 | referenceIds: [ 45 | 359508, 46 | ], 47 | type: "reference", 48 | }, 49 | ], 50 | }; 51 | ``` 52 | 53 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/prediction.md: -------------------------------------------------------------------------------- 1 | # Prediction 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Prediction } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: Prediction = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `type` | *string* | :heavy_minus_sign: | N/A | 16 | | `content` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/referencechunktype.md: -------------------------------------------------------------------------------- 1 | # ReferenceChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ReferenceChunkType } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ReferenceChunkType = "reference"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "reference" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/responseformats.md: -------------------------------------------------------------------------------- 1 | # ResponseFormats 2 | 3 | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { ResponseFormats } from "@mistralai/mistralai-azure/models/components"; 9 | 10 | let value: ResponseFormats = "text"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "text" | "json_object" | "json_schema" 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/role.md: -------------------------------------------------------------------------------- 1 | # Role 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Role } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: Role = "system"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "system" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/security.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Security } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: Security = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `apiKey` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/stop.md: -------------------------------------------------------------------------------- 1 | # Stop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/systemmessagecontent.md: -------------------------------------------------------------------------------- 1 | # SystemMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.TextChunk[]` 13 | 14 | ```typescript 15 | const value: components.TextChunk[] = [ 16 | { 17 | text: "", 18 | }, 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/toolchoiceenum.md: -------------------------------------------------------------------------------- 1 | # ToolChoiceEnum 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolChoiceEnum } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ToolChoiceEnum = "any"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "auto" | "none" | "any" | "required" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/toolmessagecontent.md: -------------------------------------------------------------------------------- 1 | # ToolMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | imageUrl: { 18 | url: "https://fair-insolence.biz", 19 | }, 20 | type: "image_url", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/toolmessagerole.md: -------------------------------------------------------------------------------- 1 | # ToolMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolMessageRole } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ToolMessageRole = "tool"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/tooltypes.md: -------------------------------------------------------------------------------- 1 | # ToolTypes 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolTypes } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ToolTypes = "function"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "function" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/type.md: -------------------------------------------------------------------------------- 1 | # Type 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Type } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: Type = "text"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "text" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/usageinfo.md: -------------------------------------------------------------------------------- 1 | # UsageInfo 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UsageInfo } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: UsageInfo = { 9 | promptTokens: 16, 10 | completionTokens: 34, 11 | totalTokens: 50, 12 | }; 13 | ``` 14 | 15 | ## Fields 16 | 17 | | Field | Type | Required | Description | Example | 18 | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | 19 | | `promptTokens` | *number* | :heavy_check_mark: | N/A | 16 | 20 | | `completionTokens` | *number* | :heavy_check_mark: | N/A | 34 | 21 | | `totalTokens` | *number* | :heavy_check_mark: | N/A | 50 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/usermessagecontent.md: -------------------------------------------------------------------------------- 1 | # UserMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | referenceIds: [ 18 | 210382, 19 | ], 20 | type: "reference", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/usermessagerole.md: -------------------------------------------------------------------------------- 1 | # UserMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UserMessageRole } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: UserMessageRole = "user"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "user" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/models/components/validationerror.md: -------------------------------------------------------------------------------- 1 | # ValidationError 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ValidationError } from "@mistralai/mistralai-azure/models/components"; 7 | 8 | let value: ValidationError = { 9 | loc: [ 10 | 18789, 11 | ], 12 | msg: "", 13 | type: "", 14 | }; 15 | ``` 16 | 17 | ## Fields 18 | 19 | | Field | Type | Required | Description | 20 | | ------------------ | ------------------ | ------------------ | ------------------ | 21 | | `loc` | *components.Loc*[] | :heavy_check_mark: | N/A | 22 | | `msg` | *string* | :heavy_check_mark: | N/A | 23 | | `type` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-azure/docs/sdks/mistralazure/README.md: -------------------------------------------------------------------------------- 1 | # MistralAzure SDK 2 | 3 | 4 | ## Overview 5 | 6 | Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. 7 | 8 | ### Available Operations 9 | 10 | -------------------------------------------------------------------------------- /packages/mistralai-azure/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | 5 | /** @type {import('eslint').Linter.Config[]} */ 6 | export default [ 7 | { files: ["**/*.{js,mjs,cjs,ts}"] }, 8 | { languageOptions: { globals: globals.browser } }, 9 | pluginJs.configs.recommended, 10 | ...tseslint.configs.recommended, 11 | { 12 | rules: { 13 | "no-constant-condition": "off", 14 | // Handled by typescript compiler 15 | "@typescript-eslint/no-unused-vars": "off", 16 | "@typescript-eslint/no-explicit-any": "off", 17 | "@typescript-eslint/no-empty-object-type": "off", 18 | "@typescript-eslint/no-namespace": "off", 19 | }, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /packages/mistralai-azure/jsr.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "name": "@mistralai/mistralai-azure", 5 | "version": "1.5.0", 6 | "exports": { 7 | ".": "./src/index.ts", 8 | "./models/errors": "./src/models/errors/index.ts", 9 | "./models/components": "./src/models/components/index.ts", 10 | "./models/operations": "./src/models/operations/index.ts", 11 | "./lib/config": "./src/lib/config.ts", 12 | "./lib/http": "./src/lib/http.ts", 13 | "./lib/retries": "./src/lib/retries.ts", 14 | "./lib/sdks": "./src/lib/sdks.ts", 15 | "./lib/event-streams": "./src/lib/event-streams.ts", 16 | "./types": "./src/types/index.ts" 17 | }, 18 | "publish": { 19 | "include": [ 20 | "LICENSE", 21 | "README.md", 22 | "RUNTIMES.md", 23 | "USAGE.md", 24 | "jsr.json", 25 | "src/**/*.ts" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/mistralai-azure/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mistralai/mistralai-azure", 3 | "version": "1.5.0", 4 | "author": "Speakeasy", 5 | "main": "./index.js", 6 | "sideEffects": false, 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/mistralai/client-ts.git", 10 | "directory": "packages/mistralai-azure" 11 | }, 12 | "scripts": { 13 | "lint": "eslint --cache --max-warnings=0 src", 14 | "build": "tsc", 15 | "prepublishOnly": "npm run build" 16 | }, 17 | "peerDependencies": { 18 | "zod": ">= 3" 19 | }, 20 | "devDependencies": { 21 | "@eslint/js": "^9.19.0", 22 | "eslint": "^9.19.0", 23 | "globals": "^15.14.0", 24 | "typescript": "^5.4.5", 25 | "typescript-eslint": "^8.22.0", 26 | "zod": "^3.23.4" 27 | }, 28 | "dependencies": { 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/core.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "./lib/sdks.js"; 6 | 7 | /** 8 | * A minimal client to use when calling standalone SDK functions. Typically, an 9 | * instance of this class would be instantiated once at the start of an 10 | * application and passed around through some dependency injection mechanism to 11 | * parts of an application that need to make SDK calls. 12 | */ 13 | export class MistralAzureCore extends ClientSDK {} 14 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/hooks/custom_user_agent.ts: -------------------------------------------------------------------------------- 1 | import { BeforeRequestContext, BeforeRequestHook, Awaitable } from './types'; 2 | 3 | 4 | export class CustomUserAgentHook implements BeforeRequestHook { 5 | beforeRequest(_: BeforeRequestContext, request: Request): Awaitable { 6 | const userAgent = request.headers.get('user-agent') as string; 7 | const version = userAgent.split(' ')[1]; 8 | request.headers.set('user-agent', `mistral-azure-client-typescript/${version}`); 9 | return request; 10 | } 11 | } -------------------------------------------------------------------------------- /packages/mistralai-azure/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./hooks.js"; 6 | export * from "./types.js"; 7 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/hooks/registration.ts: -------------------------------------------------------------------------------- 1 | import { Hooks } from "./types.js"; 2 | import { CustomUserAgentHook } from "./custom_user_agent.js"; 3 | /* 4 | * This file is only ever generated once on the first generation and then is free to be modified. 5 | * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them 6 | * in this file or in separate files in the hooks folder. 7 | */ 8 | 9 | export function initHooks(hooks: Hooks) { 10 | // Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook 11 | // with an instance of a hook that implements that specific Hook interface 12 | // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance 13 | const customUserAgentHook = new CustomUserAgentHook(); 14 | hooks.registerBeforeRequestHook(customUserAgentHook) 15 | } 16 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./lib/config.js"; 6 | export * as files from "./lib/files.js"; 7 | export * from "./sdk/sdk.js"; 8 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/lib/logger.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export interface Logger { 6 | group(label?: string): void; 7 | groupEnd(): void; 8 | log(message: any, ...args: any[]): void; 9 | } 10 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/models/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./httpclienterrors.js"; 6 | export * from "./httpvalidationerror.js"; 7 | export * from "./sdkerror.js"; 8 | export * from "./sdkvalidationerror.js"; 9 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/models/errors/sdkerror.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export class SDKError extends Error { 6 | public readonly statusCode: number; 7 | public readonly contentType: string; 8 | 9 | constructor( 10 | message: string, 11 | public readonly rawResponse: Response, 12 | public readonly body: string = "", 13 | ) { 14 | const statusCode = rawResponse.status; 15 | const contentType = rawResponse.headers.get("content-type") || ""; 16 | const bodyString = body.length > 0 ? `\n${body}` : ""; 17 | 18 | super( 19 | `${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`, 20 | ); 21 | 22 | this.statusCode = statusCode; 23 | this.contentType = contentType; 24 | 25 | this.name = "SDKError"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/sdk/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./sdk.js"; 6 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/types/blobs.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export const blobLikeSchema: z.ZodType = 8 | z.custom(isBlobLike, { 9 | message: "expected a Blob, File or Blob-like object", 10 | fatal: true, 11 | }); 12 | 13 | export function isBlobLike(val: unknown): val is Blob { 14 | if (val instanceof Blob) { 15 | return true; 16 | } 17 | 18 | if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { 19 | return false; 20 | } 21 | 22 | const name = val[Symbol.toStringTag]; 23 | if (typeof name !== "string") { 24 | return false; 25 | } 26 | if (name !== "Blob" && name !== "File") { 27 | return false; 28 | } 29 | 30 | return "stream" in val && typeof val.stream === "function"; 31 | } 32 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/types/constdatetime.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export function constDateTime( 8 | val: string, 9 | ): z.ZodType { 10 | return z.custom((v) => { 11 | return ( 12 | typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() 13 | ); 14 | }, `Value must be equivelant to ${val}`); 15 | } 16 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/types/enums.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | declare const __brand: unique symbol; 6 | export type Unrecognized = T & { [__brand]: "unrecognized" }; 7 | 8 | export function catchUnrecognizedEnum(value: T): Unrecognized { 9 | return value as Unrecognized; 10 | } 11 | 12 | type Prettify = { [K in keyof T]: T[K] } & {}; 13 | export type ClosedEnum = T[keyof T]; 14 | export type OpenEnum = 15 | | Prettify 16 | | Unrecognized; 17 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export { blobLikeSchema, isBlobLike } from "./blobs.js"; 6 | export { catchUnrecognizedEnum } from "./enums.js"; 7 | export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js"; 8 | export type { Result } from "./fp.js"; 9 | export type { PageIterator, Paginator } from "./operations.js"; 10 | export { createPageIterator } from "./operations.js"; 11 | export { RFCDate } from "./rfcdate.js"; 12 | -------------------------------------------------------------------------------- /packages/mistralai-azure/src/types/streams.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export function isReadableStream( 6 | val: unknown, 7 | ): val is ReadableStream { 8 | if (typeof val !== "object" || val === null) { 9 | return false; 10 | } 11 | 12 | // Check for the presence of methods specific to ReadableStream 13 | const stream = val as ReadableStream; 14 | 15 | // ReadableStream has methods like getReader, cancel, and tee 16 | return ( 17 | typeof stream.getReader === "function" && 18 | typeof stream.cancel === "function" && 19 | typeof stream.tee === "function" 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/.genignore: -------------------------------------------------------------------------------- 1 | src/sdk/sdk.ts 2 | README.md 3 | USAGE.md 4 | docs/sdks/**/README.md -------------------------------------------------------------------------------- /packages/mistralai-gcp/.gitattributes: -------------------------------------------------------------------------------- 1 | # This allows generated code to be indexed correctly 2 | *.ts linguist-generated=false -------------------------------------------------------------------------------- /packages/mistralai-gcp/.gitignore: -------------------------------------------------------------------------------- 1 | /mcp-server 2 | /bin 3 | /.eslintcache 4 | /react-query 5 | /.speakeasy/reports 6 | /__tests__ 7 | /core.* 8 | /funcs 9 | /models 10 | /models/errors 11 | /types 12 | /node_modules 13 | /lib 14 | /sdk 15 | /hooks 16 | /index.* 17 | /cjs 18 | /esm 19 | /dist 20 | /.tsbuildinfo 21 | /.tshy 22 | /.tshy-* 23 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/.npmignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !/FUNCTIONS.md 3 | !/RUNTIMES.md 4 | !/REACT_QUERY.md 5 | !/**/*.ts 6 | !/**/*.js 7 | !/**/*.mjs 8 | !/**/*.json 9 | !/**/*.map 10 | 11 | /eslint.config.mjs 12 | /cjs 13 | /.tshy 14 | /.tshy-* 15 | /__tests__ 16 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/USAGE.md: -------------------------------------------------------------------------------- 1 | 2 | ### Create Chat Completions 3 | 4 | This example shows how to create chat completions. 5 | 6 | ```typescript 7 | import { MistralGoogleCloud } from "@mistralai/mistralai-gcp"; 8 | 9 | const mistralGoogleCloud = new MistralGoogleCloud({ 10 | region: "europe-west4", 11 | projectId: process.env["GOOGLE_PROJECT_ID"], 12 | }); 13 | 14 | async function run() { 15 | const result = await mistralGoogleCloud.chat.complete({ 16 | model: "mistral-small-latest", 17 | messages: [ 18 | { 19 | content: "Who is the best French painter? Answer in one short sentence.", 20 | role: "user", 21 | }, 22 | ], 23 | }); 24 | 25 | // Handle the result 26 | console.log(result); 27 | } 28 | 29 | run(); 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/arguments.md: -------------------------------------------------------------------------------- 1 | # Arguments 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `{ [k: string]: any }` 7 | 8 | ```typescript 9 | const value: { [k: string]: any } = { 10 | "key": "", 11 | }; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = ""; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/assistantmessagecontent.md: -------------------------------------------------------------------------------- 1 | # AssistantMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | imageUrl: { 18 | url: "https://jittery-window.com", 19 | }, 20 | type: "image_url", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/assistantmessagerole.md: -------------------------------------------------------------------------------- 1 | # AssistantMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { AssistantMessageRole } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: AssistantMessageRole = "assistant"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "assistant" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/chatcompletionchoicefinishreason.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionChoiceFinishReason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ChatCompletionChoiceFinishReason } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ChatCompletionChoiceFinishReason = "stop"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "stop" | "length" | "model_length" | "error" | "tool_calls" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/chatcompletionrequestmessages.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionRequestMessages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: "", 17 | }; 18 | ``` 19 | 20 | ### `components.ToolMessage` 21 | 22 | ```typescript 23 | const value: components.ToolMessage = { 24 | content: [ 25 | { 26 | imageUrl: { 27 | url: "https://sugary-brace.org/", 28 | }, 29 | type: "image_url", 30 | }, 31 | ], 32 | }; 33 | ``` 34 | 35 | ### `components.UserMessage` 36 | 37 | ```typescript 38 | const value: components.UserMessage = { 39 | content: "", 40 | }; 41 | ``` 42 | 43 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/chatcompletionrequeststop.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/chatcompletionrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "required"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/chatcompletionstreamrequesttoolchoice.md: -------------------------------------------------------------------------------- 1 | # ChatCompletionStreamRequestToolChoice 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ToolChoice` 7 | 8 | ```typescript 9 | const value: components.ToolChoice = { 10 | function: { 11 | name: "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ### `components.ToolChoiceEnum` 17 | 18 | ```typescript 19 | const value: components.ToolChoiceEnum = "none"; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/content.md: -------------------------------------------------------------------------------- 1 | # Content 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | text: "", 18 | type: "text", 19 | }, 20 | ]; 21 | ``` 22 | 23 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/contentchunk.md: -------------------------------------------------------------------------------- 1 | # ContentChunk 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ImageURLChunk` 7 | 8 | ```typescript 9 | const value: components.ImageURLChunk = { 10 | imageUrl: "https://blaring-bog.com", 11 | }; 12 | ``` 13 | 14 | ### `components.TextChunk` 15 | 16 | ```typescript 17 | const value: components.TextChunk = { 18 | text: "", 19 | }; 20 | ``` 21 | 22 | ### `components.ReferenceChunk` 23 | 24 | ```typescript 25 | const value: components.ReferenceChunk = { 26 | referenceIds: [ 27 | 832620, 28 | ], 29 | }; 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/fimcompletionrequeststop.md: -------------------------------------------------------------------------------- 1 | # FIMCompletionRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/fimcompletionstreamrequeststop.md: -------------------------------------------------------------------------------- 1 | # FIMCompletionStreamRequestStop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/finishreason.md: -------------------------------------------------------------------------------- 1 | # FinishReason 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FinishReason } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: FinishReason = "length"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "stop" | "length" | "error" | "tool_calls" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/functioncall.md: -------------------------------------------------------------------------------- 1 | # FunctionCall 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionCall } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: FunctionCall = { 9 | name: "", 10 | arguments: "", 11 | }; 12 | ``` 13 | 14 | ## Fields 15 | 16 | | Field | Type | Required | Description | 17 | | ---------------------- | ---------------------- | ---------------------- | ---------------------- | 18 | | `name` | *string* | :heavy_check_mark: | N/A | 19 | | `arguments` | *components.Arguments* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/functionname.md: -------------------------------------------------------------------------------- 1 | # FunctionName 2 | 3 | this restriction of `Function` is used to select a specific function to call 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { FunctionName } from "@mistralai/mistralai-gcp/models/components"; 9 | 10 | let value: FunctionName = { 11 | name: "", 12 | }; 13 | ``` 14 | 15 | ## Fields 16 | 17 | | Field | Type | Required | Description | 18 | | ------------------ | ------------------ | ------------------ | ------------------ | 19 | | `name` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/functiont.md: -------------------------------------------------------------------------------- 1 | # FunctionT 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { FunctionT } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: FunctionT = { 9 | name: "", 10 | parameters: { 11 | "key": "", 12 | }, 13 | }; 14 | ``` 15 | 16 | ## Fields 17 | 18 | | Field | Type | Required | Description | 19 | | --------------------- | --------------------- | --------------------- | --------------------- | 20 | | `name` | *string* | :heavy_check_mark: | N/A | 21 | | `description` | *string* | :heavy_minus_sign: | N/A | 22 | | `strict` | *boolean* | :heavy_minus_sign: | N/A | 23 | | `parameters` | Record | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/imageurl.md: -------------------------------------------------------------------------------- 1 | # ImageURL 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ImageURL } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ImageURL = { 9 | url: "https://misguided-hawk.biz", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `url` | *string* | :heavy_check_mark: | N/A | 18 | | `detail` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/imageurlchunkimageurl.md: -------------------------------------------------------------------------------- 1 | # ImageURLChunkImageURL 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.ImageURL` 7 | 8 | ```typescript 9 | const value: components.ImageURL = { 10 | url: "https://true-wasabi.net", 11 | }; 12 | ``` 13 | 14 | ### `string` 15 | 16 | ```typescript 17 | const value: string = ""; 18 | ``` 19 | 20 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/imageurlchunktype.md: -------------------------------------------------------------------------------- 1 | # ImageURLChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ImageURLChunkType } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ImageURLChunkType = "image_url"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "image_url" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/loc.md: -------------------------------------------------------------------------------- 1 | # Loc 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `number` 13 | 14 | ```typescript 15 | const value: number = 456150; 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/messages.md: -------------------------------------------------------------------------------- 1 | # Messages 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `components.AssistantMessage` 7 | 8 | ```typescript 9 | const value: components.AssistantMessage = {}; 10 | ``` 11 | 12 | ### `components.SystemMessage` 13 | 14 | ```typescript 15 | const value: components.SystemMessage = { 16 | content: [ 17 | { 18 | text: "", 19 | type: "text", 20 | }, 21 | ], 22 | }; 23 | ``` 24 | 25 | ### `components.ToolMessage` 26 | 27 | ```typescript 28 | const value: components.ToolMessage = { 29 | content: [ 30 | { 31 | text: "", 32 | type: "text", 33 | }, 34 | ], 35 | }; 36 | ``` 37 | 38 | ### `components.UserMessage` 39 | 40 | ```typescript 41 | const value: components.UserMessage = { 42 | content: [ 43 | { 44 | referenceIds: [ 45 | 359508, 46 | ], 47 | type: "reference", 48 | }, 49 | ], 50 | }; 51 | ``` 52 | 53 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/prediction.md: -------------------------------------------------------------------------------- 1 | # Prediction 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Prediction } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: Prediction = {}; 9 | ``` 10 | 11 | ## Fields 12 | 13 | | Field | Type | Required | Description | 14 | | ------------------ | ------------------ | ------------------ | ------------------ | 15 | | `type` | *string* | :heavy_minus_sign: | N/A | 16 | | `content` | *string* | :heavy_minus_sign: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/referencechunktype.md: -------------------------------------------------------------------------------- 1 | # ReferenceChunkType 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ReferenceChunkType } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ReferenceChunkType = "reference"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "reference" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/responseformats.md: -------------------------------------------------------------------------------- 1 | # ResponseFormats 2 | 3 | An object specifying the format that the model must output. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is in JSON. When using JSON mode you MUST also instruct the model to produce JSON yourself with a system or a user message. 4 | 5 | ## Example Usage 6 | 7 | ```typescript 8 | import { ResponseFormats } from "@mistralai/mistralai-gcp/models/components"; 9 | 10 | let value: ResponseFormats = "text"; 11 | ``` 12 | 13 | ## Values 14 | 15 | ```typescript 16 | "text" | "json_object" | "json_schema" 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/role.md: -------------------------------------------------------------------------------- 1 | # Role 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Role } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: Role = "system"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "system" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/security.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Security } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: Security = { 9 | apiKey: "", 10 | }; 11 | ``` 12 | 13 | ## Fields 14 | 15 | | Field | Type | Required | Description | 16 | | ------------------ | ------------------ | ------------------ | ------------------ | 17 | | `apiKey` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/stop.md: -------------------------------------------------------------------------------- 1 | # Stop 2 | 3 | Stop generation if this token is detected. Or if one of these tokens is detected when providing an array 4 | 5 | 6 | ## Supported Types 7 | 8 | ### `string` 9 | 10 | ```typescript 11 | const value: string = ""; 12 | ``` 13 | 14 | ### `string[]` 15 | 16 | ```typescript 17 | const value: string[] = [ 18 | "", 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/systemmessagecontent.md: -------------------------------------------------------------------------------- 1 | # SystemMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.TextChunk[]` 13 | 14 | ```typescript 15 | const value: components.TextChunk[] = [ 16 | { 17 | text: "", 18 | }, 19 | ]; 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/toolchoiceenum.md: -------------------------------------------------------------------------------- 1 | # ToolChoiceEnum 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolChoiceEnum } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ToolChoiceEnum = "any"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "auto" | "none" | "any" | "required" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/toolmessagecontent.md: -------------------------------------------------------------------------------- 1 | # ToolMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | imageUrl: { 18 | url: "https://fair-insolence.biz", 19 | }, 20 | type: "image_url", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/toolmessagerole.md: -------------------------------------------------------------------------------- 1 | # ToolMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolMessageRole } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ToolMessageRole = "tool"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "tool" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/tooltypes.md: -------------------------------------------------------------------------------- 1 | # ToolTypes 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ToolTypes } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ToolTypes = "function"; 9 | ``` 10 | 11 | ## Values 12 | 13 | This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. 14 | 15 | ```typescript 16 | "function" | Unrecognized 17 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/type.md: -------------------------------------------------------------------------------- 1 | # Type 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { Type } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: Type = "text"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "text" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/usageinfo.md: -------------------------------------------------------------------------------- 1 | # UsageInfo 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UsageInfo } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: UsageInfo = { 9 | promptTokens: 16, 10 | completionTokens: 34, 11 | totalTokens: 50, 12 | }; 13 | ``` 14 | 15 | ## Fields 16 | 17 | | Field | Type | Required | Description | Example | 18 | | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | 19 | | `promptTokens` | *number* | :heavy_check_mark: | N/A | 16 | 20 | | `completionTokens` | *number* | :heavy_check_mark: | N/A | 34 | 21 | | `totalTokens` | *number* | :heavy_check_mark: | N/A | 50 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/usermessagecontent.md: -------------------------------------------------------------------------------- 1 | # UserMessageContent 2 | 3 | 4 | ## Supported Types 5 | 6 | ### `string` 7 | 8 | ```typescript 9 | const value: string = ""; 10 | ``` 11 | 12 | ### `components.ContentChunk[]` 13 | 14 | ```typescript 15 | const value: components.ContentChunk[] = [ 16 | { 17 | referenceIds: [ 18 | 210382, 19 | ], 20 | type: "reference", 21 | }, 22 | ]; 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/usermessagerole.md: -------------------------------------------------------------------------------- 1 | # UserMessageRole 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { UserMessageRole } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: UserMessageRole = "user"; 9 | ``` 10 | 11 | ## Values 12 | 13 | ```typescript 14 | "user" 15 | ``` -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/models/components/validationerror.md: -------------------------------------------------------------------------------- 1 | # ValidationError 2 | 3 | ## Example Usage 4 | 5 | ```typescript 6 | import { ValidationError } from "@mistralai/mistralai-gcp/models/components"; 7 | 8 | let value: ValidationError = { 9 | loc: [ 10 | 18789, 11 | ], 12 | msg: "", 13 | type: "", 14 | }; 15 | ``` 16 | 17 | ## Fields 18 | 19 | | Field | Type | Required | Description | 20 | | ------------------ | ------------------ | ------------------ | ------------------ | 21 | | `loc` | *components.Loc*[] | :heavy_check_mark: | N/A | 22 | | `msg` | *string* | :heavy_check_mark: | N/A | 23 | | `type` | *string* | :heavy_check_mark: | N/A | -------------------------------------------------------------------------------- /packages/mistralai-gcp/docs/sdks/mistralgcp/README.md: -------------------------------------------------------------------------------- 1 | # MistralGoogleCloud SDK 2 | 3 | 4 | ## Overview 5 | 6 | Mistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it. 7 | 8 | ### Available Operations 9 | 10 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import globals from "globals"; 2 | import pluginJs from "@eslint/js"; 3 | import tseslint from "typescript-eslint"; 4 | 5 | /** @type {import('eslint').Linter.Config[]} */ 6 | export default [ 7 | { files: ["**/*.{js,mjs,cjs,ts}"] }, 8 | { languageOptions: { globals: globals.browser } }, 9 | pluginJs.configs.recommended, 10 | ...tseslint.configs.recommended, 11 | { 12 | rules: { 13 | "no-constant-condition": "off", 14 | // Handled by typescript compiler 15 | "@typescript-eslint/no-unused-vars": "off", 16 | "@typescript-eslint/no-explicit-any": "off", 17 | "@typescript-eslint/no-empty-object-type": "off", 18 | "@typescript-eslint/no-namespace": "off", 19 | }, 20 | }, 21 | ]; 22 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/jsr.json: -------------------------------------------------------------------------------- 1 | 2 | 3 | { 4 | "name": "@mistralai/mistralai-gcp", 5 | "version": "1.5.0", 6 | "exports": { 7 | ".": "./src/index.ts", 8 | "./models/errors": "./src/models/errors/index.ts", 9 | "./models/components": "./src/models/components/index.ts", 10 | "./models/operations": "./src/models/operations/index.ts", 11 | "./lib/config": "./src/lib/config.ts", 12 | "./lib/http": "./src/lib/http.ts", 13 | "./lib/retries": "./src/lib/retries.ts", 14 | "./lib/sdks": "./src/lib/sdks.ts", 15 | "./lib/event-streams": "./src/lib/event-streams.ts", 16 | "./types": "./src/types/index.ts" 17 | }, 18 | "publish": { 19 | "include": [ 20 | "LICENSE", 21 | "README.md", 22 | "RUNTIMES.md", 23 | "USAGE.md", 24 | "jsr.json", 25 | "src/**/*.ts" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mistralai/mistralai-gcp", 3 | "version": "1.5.0", 4 | "author": "Speakeasy", 5 | "main": "./index.js", 6 | "sideEffects": false, 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/mistralai/client-ts.git", 10 | "directory": "packages/mistralai-gcp" 11 | }, 12 | "scripts": { 13 | "lint": "eslint --cache --max-warnings=0 src", 14 | "build": "tsc", 15 | "prepublishOnly": "npm run build" 16 | }, 17 | "peerDependencies": { 18 | "zod": ">= 3" 19 | }, 20 | "devDependencies": { 21 | "@eslint/js": "^9.19.0", 22 | "eslint": "^9.19.0", 23 | "globals": "^15.14.0", 24 | "typescript": "^5.4.5", 25 | "typescript-eslint": "^8.22.0", 26 | "zod": "^3.23.4" 27 | }, 28 | "dependencies": { 29 | "google-auth-library": "^9.11.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/core.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "./lib/sdks.js"; 6 | 7 | /** 8 | * A minimal client to use when calling standalone SDK functions. Typically, an 9 | * instance of this class would be instantiated once at the start of an 10 | * application and passed around through some dependency injection mechanism to 11 | * parts of an application that need to make SDK calls. 12 | */ 13 | export class MistralGoogleCloudCore extends ClientSDK {} 14 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/hooks/custom_user_agent.ts: -------------------------------------------------------------------------------- 1 | import { BeforeRequestContext, BeforeRequestHook, Awaitable } from './types'; 2 | 3 | 4 | export class CustomUserAgentHook implements BeforeRequestHook { 5 | beforeRequest(_: BeforeRequestContext, request: Request): Awaitable { 6 | const userAgent = request.headers.get('user-agent') as string; 7 | const version = userAgent.split(' ')[1]; 8 | request.headers.set('user-agent', `mistral-gcp-client-typescript/${version}`); 9 | return request; 10 | } 11 | } -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./hooks.js"; 6 | export * from "./types.js"; 7 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/hooks/registration.ts: -------------------------------------------------------------------------------- 1 | import { Hooks } from "./types.js"; 2 | import { CustomUserAgentHook } from "./custom_user_agent.js"; 3 | 4 | /* 5 | * This file is only ever generated once on the first generation and then is free to be modified. 6 | * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them 7 | * in this file or in separate files in the hooks folder. 8 | */ 9 | 10 | export function initHooks(hooks: Hooks) { 11 | // Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook 12 | // with an instance of a hook that implements that specific Hook interface 13 | // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance 14 | const customUserAgentHook = new CustomUserAgentHook(); 15 | hooks.registerBeforeRequestHook(customUserAgentHook) 16 | } 17 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./lib/config.js"; 6 | export * as files from "./lib/files.js"; 7 | export * from "./sdk/sdk.js"; 8 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/lib/logger.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export interface Logger { 6 | group(label?: string): void; 7 | groupEnd(): void; 8 | log(message: any, ...args: any[]): void; 9 | } 10 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/models/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./httpclienterrors.js"; 6 | export * from "./httpvalidationerror.js"; 7 | export * from "./sdkerror.js"; 8 | export * from "./sdkvalidationerror.js"; 9 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/models/errors/sdkerror.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export class SDKError extends Error { 6 | public readonly statusCode: number; 7 | public readonly contentType: string; 8 | 9 | constructor( 10 | message: string, 11 | public readonly rawResponse: Response, 12 | public readonly body: string = "", 13 | ) { 14 | const statusCode = rawResponse.status; 15 | const contentType = rawResponse.headers.get("content-type") || ""; 16 | const bodyString = body.length > 0 ? `\n${body}` : ""; 17 | 18 | super( 19 | `${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`, 20 | ); 21 | 22 | this.statusCode = statusCode; 23 | this.contentType = contentType; 24 | 25 | this.name = "SDKError"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/sdk/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./sdk.js"; 6 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/types/blobs.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export const blobLikeSchema: z.ZodType = 8 | z.custom(isBlobLike, { 9 | message: "expected a Blob, File or Blob-like object", 10 | fatal: true, 11 | }); 12 | 13 | export function isBlobLike(val: unknown): val is Blob { 14 | if (val instanceof Blob) { 15 | return true; 16 | } 17 | 18 | if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { 19 | return false; 20 | } 21 | 22 | const name = val[Symbol.toStringTag]; 23 | if (typeof name !== "string") { 24 | return false; 25 | } 26 | if (name !== "Blob" && name !== "File") { 27 | return false; 28 | } 29 | 30 | return "stream" in val && typeof val.stream === "function"; 31 | } 32 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/types/constdatetime.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export function constDateTime( 8 | val: string, 9 | ): z.ZodType { 10 | return z.custom((v) => { 11 | return ( 12 | typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() 13 | ); 14 | }, `Value must be equivelant to ${val}`); 15 | } 16 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/types/enums.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | declare const __brand: unique symbol; 6 | export type Unrecognized = T & { [__brand]: "unrecognized" }; 7 | 8 | export function catchUnrecognizedEnum(value: T): Unrecognized { 9 | return value as Unrecognized; 10 | } 11 | 12 | type Prettify = { [K in keyof T]: T[K] } & {}; 13 | export type ClosedEnum = T[keyof T]; 14 | export type OpenEnum = 15 | | Prettify 16 | | Unrecognized; 17 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export { blobLikeSchema, isBlobLike } from "./blobs.js"; 6 | export { catchUnrecognizedEnum } from "./enums.js"; 7 | export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js"; 8 | export type { Result } from "./fp.js"; 9 | export type { PageIterator, Paginator } from "./operations.js"; 10 | export { createPageIterator } from "./operations.js"; 11 | export { RFCDate } from "./rfcdate.js"; 12 | -------------------------------------------------------------------------------- /packages/mistralai-gcp/src/types/streams.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export function isReadableStream( 6 | val: unknown, 7 | ): val is ReadableStream { 8 | if (typeof val !== "object" || val === null) { 9 | return false; 10 | } 11 | 12 | // Check for the presence of methods specific to ReadableStream 13 | const stream = val as ReadableStream; 14 | 15 | // ReadableStream has methods like getReader, cancel, and tee 16 | return ( 17 | typeof stream.getReader === "function" && 18 | typeof stream.cancel === "function" && 19 | typeof stream.tee === "function" 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /src/core.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "./lib/sdks.js"; 6 | 7 | /** 8 | * A minimal client to use when calling standalone SDK functions. Typically, an 9 | * instance of this class would be instantiated once at the start of an 10 | * application and passed around through some dependency injection mechanism to 11 | * parts of an application that need to make SDK calls. 12 | */ 13 | export class MistralCore extends ClientSDK {} 14 | -------------------------------------------------------------------------------- /src/hooks/custom_user_agent.ts: -------------------------------------------------------------------------------- 1 | import { SDK_METADATA } from "../lib/config"; 2 | import { BeforeRequestContext, BeforeRequestHook, Awaitable } from "./types"; 3 | 4 | export class CustomUserAgentHook implements BeforeRequestHook { 5 | beforeRequest(_: BeforeRequestContext, request: Request): Awaitable { 6 | const version = SDK_METADATA.sdkVersion; 7 | const ua = `mistral-client-typescript/${version}`; 8 | 9 | request.headers.set("user-agent", ua); 10 | 11 | // In Chrome, the line above may silently fail. If the header was not set 12 | // we fallback to setting an alternate header. 13 | // Chromium bug: https://issues.chromium.org/issues/40450316 14 | if (!request.headers.get("user-agent")) { 15 | request.headers.set("x-mistral-user-agent", ua); 16 | } 17 | 18 | return request; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/hooks/deprecation_warning.ts: -------------------------------------------------------------------------------- 1 | import { AfterSuccessContext, AfterSuccessHook, Awaitable } from './types'; 2 | 3 | 4 | const HEADER_MODEL_DEPRECATION_TIMESTAMP = "x-model-deprecation-timestamp"; 5 | 6 | export class DeprecationWarningHook implements AfterSuccessHook { 7 | afterSuccess(_: AfterSuccessContext, response: Response): Awaitable { 8 | if (response.headers.has(HEADER_MODEL_DEPRECATION_TIMESTAMP)) { 9 | response.clone().json().then((body) => { 10 | const model = body.model; 11 | console.warn( 12 | `WARNING: The model ${model} is deprecated and will be removed on ${response.headers.get(HEADER_MODEL_DEPRECATION_TIMESTAMP)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.` 13 | ); 14 | }); 15 | 16 | } 17 | return response; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/hooks/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./hooks.js"; 6 | export * from "./types.js"; 7 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./lib/config.js"; 6 | export * as files from "./lib/files.js"; 7 | export * from "./sdk/sdk.js"; 8 | -------------------------------------------------------------------------------- /src/lib/logger.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export interface Logger { 6 | group(label?: string): void; 7 | groupEnd(): void; 8 | log(message: any, ...args: any[]): void; 9 | } 10 | -------------------------------------------------------------------------------- /src/models/errors/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./httpclienterrors.js"; 6 | export * from "./httpvalidationerror.js"; 7 | export * from "./sdkerror.js"; 8 | export * from "./sdkvalidationerror.js"; 9 | -------------------------------------------------------------------------------- /src/models/errors/sdkerror.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export class SDKError extends Error { 6 | public readonly statusCode: number; 7 | public readonly contentType: string; 8 | 9 | constructor( 10 | message: string, 11 | public readonly rawResponse: Response, 12 | public readonly body: string = "", 13 | ) { 14 | const statusCode = rawResponse.status; 15 | const contentType = rawResponse.headers.get("content-type") || ""; 16 | const bodyString = body.length > 0 ? `\n${body}` : ""; 17 | 18 | super( 19 | `${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`, 20 | ); 21 | 22 | this.statusCode = statusCode; 23 | this.contentType = contentType; 24 | 25 | this.name = "SDKError"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/sdk/batch.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "../lib/sdks.js"; 6 | import { MistralJobs } from "./mistraljobs.js"; 7 | 8 | export class Batch extends ClientSDK { 9 | private _jobs?: MistralJobs; 10 | get jobs(): MistralJobs { 11 | return (this._jobs ??= new MistralJobs(this._options)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/sdk/beta.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "../lib/sdks.js"; 6 | import { Conversations } from "./conversations.js"; 7 | import { MistralAgents } from "./mistralagents.js"; 8 | 9 | export class Beta extends ClientSDK { 10 | private _conversations?: Conversations; 11 | get conversations(): Conversations { 12 | return (this._conversations ??= new Conversations(this._options)); 13 | } 14 | 15 | private _agents?: MistralAgents; 16 | get agents(): MistralAgents { 17 | return (this._agents ??= new MistralAgents(this._options)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/sdk/embeddings.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { embeddingsCreate } from "../funcs/embeddingsCreate.js"; 6 | import { ClientSDK, RequestOptions } from "../lib/sdks.js"; 7 | import * as components from "../models/components/index.js"; 8 | import { unwrapAsync } from "../types/fp.js"; 9 | 10 | export class Embeddings extends ClientSDK { 11 | /** 12 | * Embeddings 13 | * 14 | * @remarks 15 | * Embeddings 16 | */ 17 | async create( 18 | request: components.EmbeddingRequest, 19 | options?: RequestOptions, 20 | ): Promise { 21 | return unwrapAsync(embeddingsCreate( 22 | this, 23 | request, 24 | options, 25 | )); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/sdk/finetuning.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ClientSDK } from "../lib/sdks.js"; 6 | import { Jobs } from "./jobs.js"; 7 | 8 | export class FineTuning extends ClientSDK { 9 | private _jobs?: Jobs; 10 | get jobs(): Jobs { 11 | return (this._jobs ??= new Jobs(this._options)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/sdk/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export * from "./sdk.js"; 6 | -------------------------------------------------------------------------------- /src/sdk/ocr.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import { ocrProcess } from "../funcs/ocrProcess.js"; 6 | import { ClientSDK, RequestOptions } from "../lib/sdks.js"; 7 | import * as components from "../models/components/index.js"; 8 | import { unwrapAsync } from "../types/fp.js"; 9 | 10 | export class Ocr extends ClientSDK { 11 | /** 12 | * OCR 13 | */ 14 | async process( 15 | request: components.OCRRequest, 16 | options?: RequestOptions, 17 | ): Promise { 18 | return unwrapAsync(ocrProcess( 19 | this, 20 | request, 21 | options, 22 | )); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/sdk/oldclient.ts: -------------------------------------------------------------------------------- 1 | export class MistralClient { 2 | constructor(_apiKey: string) { 3 | throw new Error('This client is deprecated starting v1.0.0, pin your version to 0.4.2. Or migrate by following this documentation: TODO add link'); 4 | } 5 | } -------------------------------------------------------------------------------- /src/types/blobs.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export const blobLikeSchema: z.ZodType = 8 | z.custom(isBlobLike, { 9 | message: "expected a Blob, File or Blob-like object", 10 | fatal: true, 11 | }); 12 | 13 | export function isBlobLike(val: unknown): val is Blob { 14 | if (val instanceof Blob) { 15 | return true; 16 | } 17 | 18 | if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { 19 | return false; 20 | } 21 | 22 | const name = val[Symbol.toStringTag]; 23 | if (typeof name !== "string") { 24 | return false; 25 | } 26 | if (name !== "Blob" && name !== "File") { 27 | return false; 28 | } 29 | 30 | return "stream" in val && typeof val.stream === "function"; 31 | } 32 | -------------------------------------------------------------------------------- /src/types/constdatetime.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | import * as z from "zod"; 6 | 7 | export function constDateTime( 8 | val: string, 9 | ): z.ZodType { 10 | return z.custom((v) => { 11 | return ( 12 | typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() 13 | ); 14 | }, `Value must be equivelant to ${val}`); 15 | } 16 | -------------------------------------------------------------------------------- /src/types/enums.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | declare const __brand: unique symbol; 6 | export type Unrecognized = T & { [__brand]: "unrecognized" }; 7 | 8 | export function catchUnrecognizedEnum(value: T): Unrecognized { 9 | return value as Unrecognized; 10 | } 11 | 12 | type Prettify = { [K in keyof T]: T[K] } & {}; 13 | export type ClosedEnum = T[keyof T]; 14 | export type OpenEnum = 15 | | Prettify 16 | | Unrecognized; 17 | -------------------------------------------------------------------------------- /src/types/index.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export { blobLikeSchema, isBlobLike } from "./blobs.js"; 6 | export { catchUnrecognizedEnum } from "./enums.js"; 7 | export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js"; 8 | export type { Result } from "./fp.js"; 9 | export type { PageIterator, Paginator } from "./operations.js"; 10 | export { createPageIterator } from "./operations.js"; 11 | export { RFCDate } from "./rfcdate.js"; 12 | -------------------------------------------------------------------------------- /src/types/streams.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. 3 | */ 4 | 5 | export function isReadableStream( 6 | val: unknown, 7 | ): val is ReadableStream { 8 | if (typeof val !== "object" || val === null) { 9 | return false; 10 | } 11 | 12 | // Check for the presence of methods specific to ReadableStream 13 | const stream = val as ReadableStream; 14 | 15 | // ReadableStream has methods like getReader, cancel, and tee 16 | return ( 17 | typeof stream.getReader === "function" && 18 | typeof stream.cancel === "function" && 19 | typeof stream.tee === "function" 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /tests/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest', 3 | testEnvironment: 'node', 4 | testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'], 5 | }; 6 | -------------------------------------------------------------------------------- /tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tests", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "test": "jest" 7 | }, 8 | "author": "", 9 | "license": "ISC", 10 | "description": "", 11 | "devDependencies": { 12 | "@types/jest": "^29.5.14", 13 | "jest": "^29.7.0", 14 | "ts-jest": "^29.2.5", 15 | "typescript": "^5.7.3" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "skipLibCheck": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "moduleResolution": "node", 10 | "resolveJsonModule": true, 11 | "isolatedModules": true, 12 | "types": ["jest", "node", "@types/jest"], 13 | }, 14 | "include": ["extra"], 15 | "exclude": ["node_modules"] 16 | } --------------------------------------------------------------------------------