@mistralai/mistralai 1.10.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -7
- package/_speakeasy/.github/action-inputs-config.json +53 -0
- package/_speakeasy/.github/action-security-config.json +88 -0
- package/funcs/audioTranscriptionsStream.d.ts +1 -1
- package/funcs/audioTranscriptionsStream.js +1 -1
- package/funcs/batchJobsGet.d.ts +3 -0
- package/funcs/batchJobsGet.d.ts.map +1 -1
- package/funcs/batchJobsGet.js +7 -0
- package/funcs/batchJobsGet.js.map +1 -1
- package/funcs/betaAgentsDelete.d.ts +15 -0
- package/funcs/betaAgentsDelete.d.ts.map +1 -0
- package/funcs/betaAgentsDelete.js +121 -0
- package/funcs/betaAgentsDelete.js.map +1 -0
- package/funcs/betaAgentsGet.js +4 -0
- package/funcs/betaAgentsGet.js.map +1 -1
- package/funcs/betaAgentsList.d.ts.map +1 -1
- package/funcs/betaAgentsList.js +8 -2
- package/funcs/betaAgentsList.js.map +1 -1
- package/funcs/betaConversationsDelete.d.ts +18 -0
- package/funcs/betaConversationsDelete.d.ts.map +1 -0
- package/funcs/betaConversationsDelete.js +124 -0
- package/funcs/betaConversationsDelete.js.map +1 -0
- package/funcs/betaConversationsList.d.ts.map +1 -1
- package/funcs/betaConversationsList.js +4 -2
- package/funcs/betaConversationsList.js.map +1 -1
- package/funcs/betaLibrariesDocumentsList.d.ts +1 -1
- package/funcs/betaLibrariesDocumentsList.js +2 -1
- package/funcs/betaLibrariesDocumentsList.js.map +1 -1
- package/funcs/filesList.js +1 -0
- package/funcs/filesList.js.map +1 -1
- package/funcs/modelsList.d.ts +1 -2
- package/funcs/modelsList.d.ts.map +1 -1
- package/funcs/modelsList.js +2 -6
- package/funcs/modelsList.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/agent.d.ts +12 -0
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +10 -0
- package/models/components/agent.js.map +1 -1
- package/models/components/agentconversation.d.ts +11 -0
- package/models/components/agentconversation.d.ts.map +1 -1
- package/models/components/agentconversation.js +6 -0
- package/models/components/agentconversation.js.map +1 -1
- package/models/components/agentcreationrequest.d.ts +6 -0
- package/models/components/agentcreationrequest.d.ts.map +1 -1
- package/models/components/agentcreationrequest.js +2 -0
- package/models/components/agentcreationrequest.js.map +1 -1
- package/models/components/agentscompletionrequest.d.ts +14 -2
- package/models/components/agentscompletionrequest.d.ts.map +1 -1
- package/models/components/agentscompletionrequest.js +2 -0
- package/models/components/agentscompletionrequest.js.map +1 -1
- package/models/components/agentscompletionstreamrequest.d.ts +14 -2
- package/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
- package/models/components/agentscompletionstreamrequest.js +2 -0
- package/models/components/agentscompletionstreamrequest.js.map +1 -1
- package/models/components/agentupdaterequest.d.ts +8 -0
- package/models/components/agentupdaterequest.d.ts.map +1 -1
- package/models/components/agentupdaterequest.js +6 -0
- package/models/components/agentupdaterequest.js.map +1 -1
- package/models/components/audioencoding.d.ts +26 -0
- package/models/components/audioencoding.d.ts.map +1 -0
- package/models/components/audioencoding.js +72 -0
- package/models/components/audioencoding.js.map +1 -0
- package/models/components/audioformat.d.ts +32 -0
- package/models/components/audioformat.d.ts.map +1 -0
- package/models/components/audioformat.js +81 -0
- package/models/components/audioformat.js.map +1 -0
- package/models/components/audiotranscriptionrequest.d.ts +3 -0
- package/models/components/audiotranscriptionrequest.d.ts.map +1 -1
- package/models/components/audiotranscriptionrequest.js.map +1 -1
- package/models/components/batchjobin.d.ts +20 -2
- package/models/components/batchjobin.d.ts.map +1 -1
- package/models/components/batchjobin.js +5 -2
- package/models/components/batchjobin.js.map +1 -1
- package/models/components/batchjobout.d.ts +6 -0
- package/models/components/batchjobout.d.ts.map +1 -1
- package/models/components/batchjobout.js +2 -0
- package/models/components/batchjobout.js.map +1 -1
- package/models/components/batchrequest.d.ts +35 -0
- package/models/components/batchrequest.d.ts.map +1 -0
- package/models/components/batchrequest.js +80 -0
- package/models/components/batchrequest.js.map +1 -0
- package/models/components/chatcompletionrequest.d.ts +26 -2
- package/models/components/chatcompletionrequest.d.ts.map +1 -1
- package/models/components/chatcompletionrequest.js +2 -0
- package/models/components/chatcompletionrequest.js.map +1 -1
- package/models/components/chatcompletionstreamrequest.d.ts +26 -2
- package/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
- package/models/components/chatcompletionstreamrequest.js +2 -0
- package/models/components/chatcompletionstreamrequest.js.map +1 -1
- package/models/components/classificationrequest.d.ts +6 -0
- package/models/components/classificationrequest.d.ts.map +1 -1
- package/models/components/classificationrequest.js +2 -0
- package/models/components/classificationrequest.js.map +1 -1
- package/models/components/conversationrequest.d.ts +13 -2
- package/models/components/conversationrequest.d.ts.map +1 -1
- package/models/components/conversationrequest.js +16 -6
- package/models/components/conversationrequest.js.map +1 -1
- package/models/components/conversationrestartrequest.d.ts +14 -0
- package/models/components/conversationrestartrequest.d.ts.map +1 -1
- package/models/components/conversationrestartrequest.js +6 -0
- package/models/components/conversationrestartrequest.js.map +1 -1
- package/models/components/conversationrestartstreamrequest.d.ts +14 -0
- package/models/components/conversationrestartstreamrequest.d.ts.map +1 -1
- package/models/components/conversationrestartstreamrequest.js +6 -0
- package/models/components/conversationrestartstreamrequest.js.map +1 -1
- package/models/components/conversationstreamrequest.d.ts +13 -2
- package/models/components/conversationstreamrequest.d.ts.map +1 -1
- package/models/components/conversationstreamrequest.js +16 -6
- package/models/components/conversationstreamrequest.js.map +1 -1
- package/models/components/documentout.d.ts +18 -10
- package/models/components/documentout.d.ts.map +1 -1
- package/models/components/documentout.js +14 -10
- package/models/components/documentout.js.map +1 -1
- package/models/components/documentupdatein.d.ts +27 -0
- package/models/components/documentupdatein.d.ts.map +1 -1
- package/models/components/documentupdatein.js +66 -1
- package/models/components/documentupdatein.js.map +1 -1
- package/models/components/embeddingrequest.d.ts +10 -4
- package/models/components/embeddingrequest.d.ts.map +1 -1
- package/models/components/embeddingrequest.js +2 -0
- package/models/components/embeddingrequest.js.map +1 -1
- package/models/components/fimcompletionrequest.d.ts +7 -5
- package/models/components/fimcompletionrequest.d.ts.map +1 -1
- package/models/components/fimcompletionrequest.js +2 -0
- package/models/components/fimcompletionrequest.js.map +1 -1
- package/models/components/fimcompletionstreamrequest.d.ts +7 -5
- package/models/components/fimcompletionstreamrequest.d.ts.map +1 -1
- package/models/components/fimcompletionstreamrequest.js +2 -0
- package/models/components/fimcompletionstreamrequest.js.map +1 -1
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/libraryout.d.ts +7 -4
- package/models/components/libraryout.d.ts.map +1 -1
- package/models/components/libraryout.js +6 -6
- package/models/components/libraryout.js.map +1 -1
- package/models/components/listfilesout.d.ts +2 -2
- package/models/components/listfilesout.d.ts.map +1 -1
- package/models/components/listfilesout.js +2 -2
- package/models/components/listfilesout.js.map +1 -1
- package/models/components/modelcapabilities.d.ts +8 -2
- package/models/components/modelcapabilities.d.ts.map +1 -1
- package/models/components/modelcapabilities.js +12 -6
- package/models/components/modelcapabilities.js.map +1 -1
- package/models/components/modelconversation.d.ts +9 -0
- package/models/components/modelconversation.d.ts.map +1 -1
- package/models/components/modelconversation.js +2 -0
- package/models/components/modelconversation.js.map +1 -1
- package/models/components/ocrpageobject.d.ts +21 -0
- package/models/components/ocrpageobject.d.ts.map +1 -1
- package/models/components/ocrpageobject.js +9 -0
- package/models/components/ocrpageobject.js.map +1 -1
- package/models/components/ocrrequest.d.ts +32 -0
- package/models/components/ocrrequest.d.ts.map +1 -1
- package/models/components/ocrrequest.js +33 -1
- package/models/components/ocrrequest.js.map +1 -1
- package/models/components/ocrtableobject.d.ts +74 -0
- package/models/components/ocrtableobject.d.ts.map +1 -0
- package/models/components/ocrtableobject.js +96 -0
- package/models/components/ocrtableobject.js.map +1 -0
- package/models/components/prediction.d.ts +3 -0
- package/models/components/prediction.d.ts.map +1 -1
- package/models/components/prediction.js.map +1 -1
- package/models/components/requestsource.d.ts +31 -0
- package/models/components/requestsource.d.ts.map +1 -0
- package/models/components/requestsource.js +61 -0
- package/models/components/requestsource.js.map +1 -0
- package/models/components/responseformat.d.ts +3 -3
- package/models/components/responseformat.d.ts.map +1 -1
- package/models/components/responseformats.d.ts +0 -6
- package/models/components/responseformats.d.ts.map +1 -1
- package/models/components/responseformats.js +0 -3
- package/models/components/responseformats.js.map +1 -1
- package/models/components/sharingdelete.d.ts +2 -2
- package/models/components/sharingdelete.d.ts.map +1 -1
- package/models/components/sharingdelete.js +2 -2
- package/models/components/sharingdelete.js.map +1 -1
- package/models/components/sharingin.d.ts +2 -2
- package/models/components/sharingin.d.ts.map +1 -1
- package/models/components/sharingin.js +2 -2
- package/models/components/sharingin.js.map +1 -1
- package/models/components/sharingout.d.ts +2 -2
- package/models/components/sharingout.d.ts.map +1 -1
- package/models/components/sharingout.js +2 -2
- package/models/components/sharingout.js.map +1 -1
- package/models/components/toolexecutiondeltaevent.d.ts +23 -2
- package/models/components/toolexecutiondeltaevent.d.ts.map +1 -1
- package/models/components/toolexecutiondeltaevent.js +26 -3
- package/models/components/toolexecutiondeltaevent.js.map +1 -1
- package/models/components/toolexecutiondoneevent.d.ts +23 -2
- package/models/components/toolexecutiondoneevent.d.ts.map +1 -1
- package/models/components/toolexecutiondoneevent.js +26 -3
- package/models/components/toolexecutiondoneevent.js.map +1 -1
- package/models/components/toolexecutionentry.d.ts +23 -2
- package/models/components/toolexecutionentry.d.ts.map +1 -1
- package/models/components/toolexecutionentry.js +27 -3
- package/models/components/toolexecutionentry.js.map +1 -1
- package/models/components/toolexecutionstartedevent.d.ts +23 -2
- package/models/components/toolexecutionstartedevent.d.ts.map +1 -1
- package/models/components/toolexecutionstartedevent.js +26 -3
- package/models/components/toolexecutionstartedevent.js.map +1 -1
- package/models/components/toolfilechunk.d.ts +23 -2
- package/models/components/toolfilechunk.d.ts.map +1 -1
- package/models/components/toolfilechunk.js +26 -3
- package/models/components/toolfilechunk.js.map +1 -1
- package/models/components/toolreferencechunk.d.ts +23 -2
- package/models/components/toolreferencechunk.d.ts.map +1 -1
- package/models/components/toolreferencechunk.js +26 -3
- package/models/components/toolreferencechunk.js.map +1 -1
- package/models/operations/agentsapiv1agentsdelete.d.ts +29 -0
- package/models/operations/agentsapiv1agentsdelete.d.ts.map +1 -0
- package/models/operations/agentsapiv1agentsdelete.js +78 -0
- package/models/operations/agentsapiv1agentsdelete.js.map +1 -0
- package/models/operations/agentsapiv1agentsget.d.ts +2 -0
- package/models/operations/agentsapiv1agentsget.d.ts.map +1 -1
- package/models/operations/agentsapiv1agentsget.js +4 -0
- package/models/operations/agentsapiv1agentsget.js.map +1 -1
- package/models/operations/agentsapiv1agentslist.d.ts +15 -0
- package/models/operations/agentsapiv1agentslist.d.ts.map +1 -1
- package/models/operations/agentsapiv1agentslist.js +15 -0
- package/models/operations/agentsapiv1agentslist.js.map +1 -1
- package/models/operations/agentsapiv1conversationsdelete.d.ts +32 -0
- package/models/operations/agentsapiv1conversationsdelete.d.ts.map +1 -0
- package/models/operations/agentsapiv1conversationsdelete.js +78 -0
- package/models/operations/agentsapiv1conversationsdelete.js.map +1 -0
- package/models/operations/agentsapiv1conversationslist.d.ts +6 -0
- package/models/operations/agentsapiv1conversationslist.d.ts.map +1 -1
- package/models/operations/agentsapiv1conversationslist.js +2 -0
- package/models/operations/agentsapiv1conversationslist.js.map +1 -1
- package/models/operations/filesapirouteslistfiles.d.ts +2 -0
- package/models/operations/filesapirouteslistfiles.d.ts.map +1 -1
- package/models/operations/filesapirouteslistfiles.js +4 -0
- package/models/operations/filesapirouteslistfiles.js.map +1 -1
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/jobsapiroutesbatchgetbatchjob.d.ts +2 -0
- package/models/operations/jobsapiroutesbatchgetbatchjob.d.ts.map +1 -1
- package/models/operations/jobsapiroutesbatchgetbatchjob.js +2 -0
- package/models/operations/jobsapiroutesbatchgetbatchjob.js.map +1 -1
- package/models/operations/librariesdocumentslistv1.d.ts +2 -0
- package/models/operations/librariesdocumentslistv1.d.ts.map +1 -1
- package/models/operations/librariesdocumentslistv1.js +4 -0
- package/models/operations/librariesdocumentslistv1.js.map +1 -1
- package/package.json +1 -1
- package/sdk/conversations.d.ts +7 -0
- package/sdk/conversations.d.ts.map +1 -1
- package/sdk/conversations.js +10 -0
- package/sdk/conversations.js.map +1 -1
- package/sdk/documents.d.ts +1 -1
- package/sdk/documents.js +1 -1
- package/sdk/mistralagents.d.ts +4 -0
- package/sdk/mistralagents.d.ts.map +1 -1
- package/sdk/mistralagents.js +7 -0
- package/sdk/mistralagents.js.map +1 -1
- package/sdk/mistraljobs.d.ts +3 -0
- package/sdk/mistraljobs.d.ts.map +1 -1
- package/sdk/mistraljobs.js +3 -0
- package/sdk/mistraljobs.js.map +1 -1
- package/sdk/transcriptions.d.ts +1 -1
- package/sdk/transcriptions.js +1 -1
- package/src/funcs/audioTranscriptionsStream.ts +1 -1
- package/src/funcs/batchJobsGet.ts +9 -1
- package/src/funcs/betaAgentsDelete.ts +174 -0
- package/src/funcs/betaAgentsGet.ts +6 -1
- package/src/funcs/betaAgentsList.ts +18 -5
- package/src/funcs/betaConversationsDelete.ts +179 -0
- package/src/funcs/betaConversationsList.ts +14 -5
- package/src/funcs/betaLibrariesDocumentsList.ts +2 -1
- package/src/funcs/filesList.ts +1 -0
- package/src/funcs/modelsList.ts +2 -11
- package/src/lib/config.ts +2 -2
- package/src/models/components/agent.ts +18 -0
- package/src/models/components/agentconversation.ts +13 -0
- package/src/models/components/agentcreationrequest.ts +4 -0
- package/src/models/components/agentscompletionrequest.ts +12 -2
- package/src/models/components/agentscompletionstreamrequest.ts +12 -2
- package/src/models/components/agentupdaterequest.ts +10 -0
- package/src/models/components/audioencoding.ts +52 -0
- package/src/models/components/audioformat.ts +80 -0
- package/src/models/components/audiotranscriptionrequest.ts +3 -0
- package/src/models/components/batchjobin.ts +29 -4
- package/src/models/components/batchjobout.ts +4 -0
- package/src/models/components/batchrequest.ts +75 -0
- package/src/models/components/chatcompletionrequest.ts +24 -2
- package/src/models/components/chatcompletionstreamrequest.ts +24 -2
- package/src/models/components/classificationrequest.ts +4 -0
- package/src/models/components/conversationrequest.ts +79 -72
- package/src/models/components/conversationrestartrequest.ts +16 -0
- package/src/models/components/conversationrestartstreamrequest.ts +16 -0
- package/src/models/components/conversationstreamrequest.ts +79 -72
- package/src/models/components/documentout.ts +28 -20
- package/src/models/components/documentupdatein.ts +144 -0
- package/src/models/components/embeddingrequest.ts +8 -4
- package/src/models/components/fimcompletionrequest.ts +5 -5
- package/src/models/components/fimcompletionstreamrequest.ts +5 -5
- package/src/models/components/index.ts +5 -0
- package/src/models/components/libraryout.ts +13 -10
- package/src/models/components/listfilesout.ts +4 -4
- package/src/models/components/modelcapabilities.ts +20 -8
- package/src/models/components/modelconversation.ts +7 -0
- package/src/models/components/ocrpageobject.ts +34 -0
- package/src/models/components/ocrrequest.ts +44 -0
- package/src/models/components/ocrtableobject.ts +111 -0
- package/src/models/components/prediction.ts +3 -0
- package/src/models/components/requestsource.ts +34 -0
- package/src/models/components/responseformat.ts +3 -3
- package/src/models/components/responseformats.ts +0 -6
- package/src/models/components/sharingdelete.ts +4 -4
- package/src/models/components/sharingin.ts +4 -4
- package/src/models/components/sharingout.ts +4 -4
- package/src/models/components/toolexecutiondeltaevent.ts +56 -4
- package/src/models/components/toolexecutiondoneevent.ts +54 -4
- package/src/models/components/toolexecutionentry.ts +44 -4
- package/src/models/components/toolexecutionstartedevent.ts +56 -4
- package/src/models/components/toolfilechunk.ts +54 -4
- package/src/models/components/toolreferencechunk.ts +54 -4
- package/src/models/operations/agentsapiv1agentsdelete.ts +77 -0
- package/src/models/operations/agentsapiv1agentsget.ts +6 -0
- package/src/models/operations/agentsapiv1agentslist.ts +25 -0
- package/src/models/operations/agentsapiv1conversationsdelete.ts +83 -0
- package/src/models/operations/agentsapiv1conversationslist.ts +4 -0
- package/src/models/operations/filesapirouteslistfiles.ts +6 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/jobsapiroutesbatchgetbatchjob.ts +4 -0
- package/src/models/operations/librariesdocumentslistv1.ts +6 -0
- package/src/sdk/conversations.ts +18 -0
- package/src/sdk/documents.ts +1 -1
- package/src/sdk/mistralagents.ts +15 -0
- package/src/sdk/mistraljobs.ts +3 -0
- package/src/sdk/transcriptions.ts +1 -1
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/accesses/README.md +0 -256
- package/docs/sdks/agents/README.md +0 -189
- package/docs/sdks/audio/README.md +0 -6
- package/docs/sdks/batch/README.md +0 -6
- package/docs/sdks/beta/README.md +0 -6
- package/docs/sdks/chat/README.md +0 -189
- package/docs/sdks/classifiers/README.md +0 -355
- package/docs/sdks/conversations/README.md +0 -835
- package/docs/sdks/documents/README.md +0 -785
- package/docs/sdks/embeddings/README.md +0 -92
- package/docs/sdks/files/README.md +0 -455
- package/docs/sdks/fim/README.md +0 -173
- package/docs/sdks/finetuning/README.md +0 -6
- package/docs/sdks/jobs/README.md +0 -379
- package/docs/sdks/libraries/README.md +0 -380
- package/docs/sdks/mistral/README.md +0 -7
- package/docs/sdks/mistralagents/README.md +0 -386
- package/docs/sdks/mistraljobs/README.md +0 -305
- package/docs/sdks/models/README.md +0 -453
- package/docs/sdks/ocr/README.md +0 -92
- package/docs/sdks/transcriptions/README.md +0 -163
- package/examples/README.md +0 -44
- package/packages/mistralai-azure/FUNCTIONS.md +0 -111
- package/packages/mistralai-azure/LICENSE +0 -201
- package/packages/mistralai-azure/README.md +0 -447
- package/packages/mistralai-azure/RUNTIMES.md +0 -48
- package/packages/mistralai-azure/docs/sdks/chat/README.md +0 -114
- package/packages/mistralai-azure/docs/sdks/mistralazure/README.md +0 -9
- package/packages/mistralai-gcp/FUNCTIONS.md +0 -112
- package/packages/mistralai-gcp/LICENSE +0 -201
- package/packages/mistralai-gcp/README.md +0 -455
- package/packages/mistralai-gcp/RUNTIMES.md +0 -48
- package/packages/mistralai-gcp/docs/sdks/chat/README.md +0 -115
- package/packages/mistralai-gcp/docs/sdks/fim/README.md +0 -58
- package/packages/mistralai-gcp/docs/sdks/mistralgcp/README.md +0 -9
- package/src/extra/README.md +0 -52
|
@@ -1,785 +0,0 @@
|
|
|
1
|
-
# Documents
|
|
2
|
-
(*beta.libraries.documents*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
(beta) Libraries API - manage documents in a library.
|
|
7
|
-
|
|
8
|
-
### Available Operations
|
|
9
|
-
|
|
10
|
-
* [list](#list) - List document in a given library.
|
|
11
|
-
* [upload](#upload) - Upload a new document.
|
|
12
|
-
* [get](#get) - Retrieve the metadata of a specific document.
|
|
13
|
-
* [update](#update) - Update the metadata of a specific document.
|
|
14
|
-
* [delete](#delete) - Delete a document.
|
|
15
|
-
* [textContent](#textcontent) - Retrieve the text content of a specific document.
|
|
16
|
-
* [status](#status) - Retrieve the processing status of a specific document.
|
|
17
|
-
* [getSignedUrl](#getsignedurl) - Retrieve the signed URL of a specific document.
|
|
18
|
-
* [extractedTextSignedUrl](#extractedtextsignedurl) - Retrieve the signed URL of text extracted from a given document.
|
|
19
|
-
* [reprocess](#reprocess) - Reprocess a document.
|
|
20
|
-
|
|
21
|
-
## list
|
|
22
|
-
|
|
23
|
-
Given a library, lists the document that have been uploaded to that library.
|
|
24
|
-
|
|
25
|
-
### Example Usage
|
|
26
|
-
|
|
27
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_list_v1" method="get" path="/v1/libraries/{library_id}/documents" -->
|
|
28
|
-
```typescript
|
|
29
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
30
|
-
|
|
31
|
-
const mistral = new Mistral({
|
|
32
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
async function run() {
|
|
36
|
-
const result = await mistral.beta.libraries.documents.list({
|
|
37
|
-
libraryId: "5c3ca4cd-62bc-4c71-ad8a-1531ae80d078",
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
console.log(result);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
run();
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Standalone function
|
|
47
|
-
|
|
48
|
-
The standalone function version of this method:
|
|
49
|
-
|
|
50
|
-
```typescript
|
|
51
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
52
|
-
import { betaLibrariesDocumentsList } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsList.js";
|
|
53
|
-
|
|
54
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
55
|
-
// You can create one instance of it to use across an application.
|
|
56
|
-
const mistral = new MistralCore({
|
|
57
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
async function run() {
|
|
61
|
-
const res = await betaLibrariesDocumentsList(mistral, {
|
|
62
|
-
libraryId: "5c3ca4cd-62bc-4c71-ad8a-1531ae80d078",
|
|
63
|
-
});
|
|
64
|
-
if (res.ok) {
|
|
65
|
-
const { value: result } = res;
|
|
66
|
-
console.log(result);
|
|
67
|
-
} else {
|
|
68
|
-
console.log("betaLibrariesDocumentsList failed:", res.error);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
run();
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Parameters
|
|
76
|
-
|
|
77
|
-
| Parameter | Type | Required | Description |
|
|
78
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
79
|
-
| `request` | [operations.LibrariesDocumentsListV1Request](../../models/operations/librariesdocumentslistv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
80
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
81
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
82
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
83
|
-
|
|
84
|
-
### Response
|
|
85
|
-
|
|
86
|
-
**Promise\<[components.ListDocumentOut](../../models/components/listdocumentout.md)\>**
|
|
87
|
-
|
|
88
|
-
### Errors
|
|
89
|
-
|
|
90
|
-
| Error Type | Status Code | Content Type |
|
|
91
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
92
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
93
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
94
|
-
|
|
95
|
-
## upload
|
|
96
|
-
|
|
97
|
-
Given a library, upload a new document to that library. It is queued for processing, it status will change it has been processed. The processing has to be completed in order be discoverable for the library search
|
|
98
|
-
|
|
99
|
-
### Example Usage
|
|
100
|
-
|
|
101
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_upload_v1" method="post" path="/v1/libraries/{library_id}/documents" -->
|
|
102
|
-
```typescript
|
|
103
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
104
|
-
import { openAsBlob } from "node:fs";
|
|
105
|
-
|
|
106
|
-
const mistral = new Mistral({
|
|
107
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
async function run() {
|
|
111
|
-
const result = await mistral.beta.libraries.documents.upload({
|
|
112
|
-
libraryId: "a02150d9-5ee0-4877-b62c-28b1fcdf3b76",
|
|
113
|
-
requestBody: {
|
|
114
|
-
file: await openAsBlob("example.file"),
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
console.log(result);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
run();
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Standalone function
|
|
125
|
-
|
|
126
|
-
The standalone function version of this method:
|
|
127
|
-
|
|
128
|
-
```typescript
|
|
129
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
130
|
-
import { betaLibrariesDocumentsUpload } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsUpload.js";
|
|
131
|
-
import { openAsBlob } from "node:fs";
|
|
132
|
-
|
|
133
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
134
|
-
// You can create one instance of it to use across an application.
|
|
135
|
-
const mistral = new MistralCore({
|
|
136
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
async function run() {
|
|
140
|
-
const res = await betaLibrariesDocumentsUpload(mistral, {
|
|
141
|
-
libraryId: "a02150d9-5ee0-4877-b62c-28b1fcdf3b76",
|
|
142
|
-
requestBody: {
|
|
143
|
-
file: await openAsBlob("example.file"),
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
if (res.ok) {
|
|
147
|
-
const { value: result } = res;
|
|
148
|
-
console.log(result);
|
|
149
|
-
} else {
|
|
150
|
-
console.log("betaLibrariesDocumentsUpload failed:", res.error);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
run();
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### Parameters
|
|
158
|
-
|
|
159
|
-
| Parameter | Type | Required | Description |
|
|
160
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
161
|
-
| `request` | [operations.LibrariesDocumentsUploadV1Request](../../models/operations/librariesdocumentsuploadv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
162
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
163
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
164
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
165
|
-
|
|
166
|
-
### Response
|
|
167
|
-
|
|
168
|
-
**Promise\<[components.DocumentOut](../../models/components/documentout.md)\>**
|
|
169
|
-
|
|
170
|
-
### Errors
|
|
171
|
-
|
|
172
|
-
| Error Type | Status Code | Content Type |
|
|
173
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
174
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
175
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
176
|
-
|
|
177
|
-
## get
|
|
178
|
-
|
|
179
|
-
Given a library and a document in this library, you can retrieve the metadata of that document.
|
|
180
|
-
|
|
181
|
-
### Example Usage
|
|
182
|
-
|
|
183
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_get_v1" method="get" path="/v1/libraries/{library_id}/documents/{document_id}" -->
|
|
184
|
-
```typescript
|
|
185
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
186
|
-
|
|
187
|
-
const mistral = new Mistral({
|
|
188
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
async function run() {
|
|
192
|
-
const result = await mistral.beta.libraries.documents.get({
|
|
193
|
-
libraryId: "03d908c8-90a1-44fd-bf3a-8490fb7c9a03",
|
|
194
|
-
documentId: "90973aec-0508-4375-8b00-91d732414745",
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
console.log(result);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
run();
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### Standalone function
|
|
204
|
-
|
|
205
|
-
The standalone function version of this method:
|
|
206
|
-
|
|
207
|
-
```typescript
|
|
208
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
209
|
-
import { betaLibrariesDocumentsGet } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsGet.js";
|
|
210
|
-
|
|
211
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
212
|
-
// You can create one instance of it to use across an application.
|
|
213
|
-
const mistral = new MistralCore({
|
|
214
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
async function run() {
|
|
218
|
-
const res = await betaLibrariesDocumentsGet(mistral, {
|
|
219
|
-
libraryId: "03d908c8-90a1-44fd-bf3a-8490fb7c9a03",
|
|
220
|
-
documentId: "90973aec-0508-4375-8b00-91d732414745",
|
|
221
|
-
});
|
|
222
|
-
if (res.ok) {
|
|
223
|
-
const { value: result } = res;
|
|
224
|
-
console.log(result);
|
|
225
|
-
} else {
|
|
226
|
-
console.log("betaLibrariesDocumentsGet failed:", res.error);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
run();
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Parameters
|
|
234
|
-
|
|
235
|
-
| Parameter | Type | Required | Description |
|
|
236
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
237
|
-
| `request` | [operations.LibrariesDocumentsGetV1Request](../../models/operations/librariesdocumentsgetv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
238
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
239
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
240
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
241
|
-
|
|
242
|
-
### Response
|
|
243
|
-
|
|
244
|
-
**Promise\<[components.DocumentOut](../../models/components/documentout.md)\>**
|
|
245
|
-
|
|
246
|
-
### Errors
|
|
247
|
-
|
|
248
|
-
| Error Type | Status Code | Content Type |
|
|
249
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
250
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
251
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
252
|
-
|
|
253
|
-
## update
|
|
254
|
-
|
|
255
|
-
Given a library and a document in that library, update the name of that document.
|
|
256
|
-
|
|
257
|
-
### Example Usage
|
|
258
|
-
|
|
259
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_update_v1" method="put" path="/v1/libraries/{library_id}/documents/{document_id}" -->
|
|
260
|
-
```typescript
|
|
261
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
262
|
-
|
|
263
|
-
const mistral = new Mistral({
|
|
264
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
async function run() {
|
|
268
|
-
const result = await mistral.beta.libraries.documents.update({
|
|
269
|
-
libraryId: "3ddd8d93-dca5-4a6d-980d-173226c35742",
|
|
270
|
-
documentId: "2a25e44c-b160-40ca-b5c2-b65fb2fcae34",
|
|
271
|
-
documentUpdateIn: {},
|
|
272
|
-
});
|
|
273
|
-
|
|
274
|
-
console.log(result);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
run();
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
### Standalone function
|
|
281
|
-
|
|
282
|
-
The standalone function version of this method:
|
|
283
|
-
|
|
284
|
-
```typescript
|
|
285
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
286
|
-
import { betaLibrariesDocumentsUpdate } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsUpdate.js";
|
|
287
|
-
|
|
288
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
289
|
-
// You can create one instance of it to use across an application.
|
|
290
|
-
const mistral = new MistralCore({
|
|
291
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
async function run() {
|
|
295
|
-
const res = await betaLibrariesDocumentsUpdate(mistral, {
|
|
296
|
-
libraryId: "3ddd8d93-dca5-4a6d-980d-173226c35742",
|
|
297
|
-
documentId: "2a25e44c-b160-40ca-b5c2-b65fb2fcae34",
|
|
298
|
-
documentUpdateIn: {},
|
|
299
|
-
});
|
|
300
|
-
if (res.ok) {
|
|
301
|
-
const { value: result } = res;
|
|
302
|
-
console.log(result);
|
|
303
|
-
} else {
|
|
304
|
-
console.log("betaLibrariesDocumentsUpdate failed:", res.error);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
run();
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
### Parameters
|
|
312
|
-
|
|
313
|
-
| Parameter | Type | Required | Description |
|
|
314
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
315
|
-
| `request` | [operations.LibrariesDocumentsUpdateV1Request](../../models/operations/librariesdocumentsupdatev1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
316
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
317
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
318
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
319
|
-
|
|
320
|
-
### Response
|
|
321
|
-
|
|
322
|
-
**Promise\<[components.DocumentOut](../../models/components/documentout.md)\>**
|
|
323
|
-
|
|
324
|
-
### Errors
|
|
325
|
-
|
|
326
|
-
| Error Type | Status Code | Content Type |
|
|
327
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
328
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
329
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
330
|
-
|
|
331
|
-
## delete
|
|
332
|
-
|
|
333
|
-
Given a library and a document in that library, delete that document. The document will be deleted from the library and the search index.
|
|
334
|
-
|
|
335
|
-
### Example Usage
|
|
336
|
-
|
|
337
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_delete_v1" method="delete" path="/v1/libraries/{library_id}/documents/{document_id}" -->
|
|
338
|
-
```typescript
|
|
339
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
340
|
-
|
|
341
|
-
const mistral = new Mistral({
|
|
342
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
343
|
-
});
|
|
344
|
-
|
|
345
|
-
async function run() {
|
|
346
|
-
await mistral.beta.libraries.documents.delete({
|
|
347
|
-
libraryId: "005daae9-d42e-407d-82d7-2261c6a1496c",
|
|
348
|
-
documentId: "edc236b0-baff-49a9-884b-4ca36a258da4",
|
|
349
|
-
});
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
run();
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
### Standalone function
|
|
358
|
-
|
|
359
|
-
The standalone function version of this method:
|
|
360
|
-
|
|
361
|
-
```typescript
|
|
362
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
363
|
-
import { betaLibrariesDocumentsDelete } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsDelete.js";
|
|
364
|
-
|
|
365
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
366
|
-
// You can create one instance of it to use across an application.
|
|
367
|
-
const mistral = new MistralCore({
|
|
368
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
async function run() {
|
|
372
|
-
const res = await betaLibrariesDocumentsDelete(mistral, {
|
|
373
|
-
libraryId: "005daae9-d42e-407d-82d7-2261c6a1496c",
|
|
374
|
-
documentId: "edc236b0-baff-49a9-884b-4ca36a258da4",
|
|
375
|
-
});
|
|
376
|
-
if (res.ok) {
|
|
377
|
-
const { value: result } = res;
|
|
378
|
-
|
|
379
|
-
} else {
|
|
380
|
-
console.log("betaLibrariesDocumentsDelete failed:", res.error);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
run();
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
### Parameters
|
|
388
|
-
|
|
389
|
-
| Parameter | Type | Required | Description |
|
|
390
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
391
|
-
| `request` | [operations.LibrariesDocumentsDeleteV1Request](../../models/operations/librariesdocumentsdeletev1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
392
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
393
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
394
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
395
|
-
|
|
396
|
-
### Response
|
|
397
|
-
|
|
398
|
-
**Promise\<void\>**
|
|
399
|
-
|
|
400
|
-
### Errors
|
|
401
|
-
|
|
402
|
-
| Error Type | Status Code | Content Type |
|
|
403
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
404
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
405
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
406
|
-
|
|
407
|
-
## textContent
|
|
408
|
-
|
|
409
|
-
Given a library and a document in that library, you can retrieve the text content of that document if it exists. For documents like pdf, docx and pptx the text content results from our processing using Mistral OCR.
|
|
410
|
-
|
|
411
|
-
### Example Usage
|
|
412
|
-
|
|
413
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_get_text_content_v1" method="get" path="/v1/libraries/{library_id}/documents/{document_id}/text_content" -->
|
|
414
|
-
```typescript
|
|
415
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
416
|
-
|
|
417
|
-
const mistral = new Mistral({
|
|
418
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
async function run() {
|
|
422
|
-
const result = await mistral.beta.libraries.documents.textContent({
|
|
423
|
-
libraryId: "1d177215-3b6b-45ba-9fa9-baf773223bec",
|
|
424
|
-
documentId: "60214c91-2aba-4692-a4e6-a53365de8caf",
|
|
425
|
-
});
|
|
426
|
-
|
|
427
|
-
console.log(result);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
run();
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### Standalone function
|
|
434
|
-
|
|
435
|
-
The standalone function version of this method:
|
|
436
|
-
|
|
437
|
-
```typescript
|
|
438
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
439
|
-
import { betaLibrariesDocumentsTextContent } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsTextContent.js";
|
|
440
|
-
|
|
441
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
442
|
-
// You can create one instance of it to use across an application.
|
|
443
|
-
const mistral = new MistralCore({
|
|
444
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
async function run() {
|
|
448
|
-
const res = await betaLibrariesDocumentsTextContent(mistral, {
|
|
449
|
-
libraryId: "1d177215-3b6b-45ba-9fa9-baf773223bec",
|
|
450
|
-
documentId: "60214c91-2aba-4692-a4e6-a53365de8caf",
|
|
451
|
-
});
|
|
452
|
-
if (res.ok) {
|
|
453
|
-
const { value: result } = res;
|
|
454
|
-
console.log(result);
|
|
455
|
-
} else {
|
|
456
|
-
console.log("betaLibrariesDocumentsTextContent failed:", res.error);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
run();
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
### Parameters
|
|
464
|
-
|
|
465
|
-
| Parameter | Type | Required | Description |
|
|
466
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
467
|
-
| `request` | [operations.LibrariesDocumentsGetTextContentV1Request](../../models/operations/librariesdocumentsgettextcontentv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
468
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
469
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
470
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
471
|
-
|
|
472
|
-
### Response
|
|
473
|
-
|
|
474
|
-
**Promise\<[components.DocumentTextContent](../../models/components/documenttextcontent.md)\>**
|
|
475
|
-
|
|
476
|
-
### Errors
|
|
477
|
-
|
|
478
|
-
| Error Type | Status Code | Content Type |
|
|
479
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
480
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
481
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
482
|
-
|
|
483
|
-
## status
|
|
484
|
-
|
|
485
|
-
Given a library and a document in that library, retrieve the processing status of that document.
|
|
486
|
-
|
|
487
|
-
### Example Usage
|
|
488
|
-
|
|
489
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_get_status_v1" method="get" path="/v1/libraries/{library_id}/documents/{document_id}/status" -->
|
|
490
|
-
```typescript
|
|
491
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
492
|
-
|
|
493
|
-
const mistral = new Mistral({
|
|
494
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
495
|
-
});
|
|
496
|
-
|
|
497
|
-
async function run() {
|
|
498
|
-
const result = await mistral.beta.libraries.documents.status({
|
|
499
|
-
libraryId: "e6906f70-368f-4155-80da-c1718f01bc43",
|
|
500
|
-
documentId: "2c904915-d831-4e9d-a345-8ce405bcef66",
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
console.log(result);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
run();
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
### Standalone function
|
|
510
|
-
|
|
511
|
-
The standalone function version of this method:
|
|
512
|
-
|
|
513
|
-
```typescript
|
|
514
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
515
|
-
import { betaLibrariesDocumentsStatus } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsStatus.js";
|
|
516
|
-
|
|
517
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
518
|
-
// You can create one instance of it to use across an application.
|
|
519
|
-
const mistral = new MistralCore({
|
|
520
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
521
|
-
});
|
|
522
|
-
|
|
523
|
-
async function run() {
|
|
524
|
-
const res = await betaLibrariesDocumentsStatus(mistral, {
|
|
525
|
-
libraryId: "e6906f70-368f-4155-80da-c1718f01bc43",
|
|
526
|
-
documentId: "2c904915-d831-4e9d-a345-8ce405bcef66",
|
|
527
|
-
});
|
|
528
|
-
if (res.ok) {
|
|
529
|
-
const { value: result } = res;
|
|
530
|
-
console.log(result);
|
|
531
|
-
} else {
|
|
532
|
-
console.log("betaLibrariesDocumentsStatus failed:", res.error);
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
run();
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
### Parameters
|
|
540
|
-
|
|
541
|
-
| Parameter | Type | Required | Description |
|
|
542
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
543
|
-
| `request` | [operations.LibrariesDocumentsGetStatusV1Request](../../models/operations/librariesdocumentsgetstatusv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
544
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
545
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
546
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
547
|
-
|
|
548
|
-
### Response
|
|
549
|
-
|
|
550
|
-
**Promise\<[components.ProcessingStatusOut](../../models/components/processingstatusout.md)\>**
|
|
551
|
-
|
|
552
|
-
### Errors
|
|
553
|
-
|
|
554
|
-
| Error Type | Status Code | Content Type |
|
|
555
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
556
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
557
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
558
|
-
|
|
559
|
-
## getSignedUrl
|
|
560
|
-
|
|
561
|
-
Given a library and a document in that library, retrieve the signed URL of a specific document.The url will expire after 30 minutes and can be accessed by anyone with the link.
|
|
562
|
-
|
|
563
|
-
### Example Usage
|
|
564
|
-
|
|
565
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_get_signed_url_v1" method="get" path="/v1/libraries/{library_id}/documents/{document_id}/signed-url" -->
|
|
566
|
-
```typescript
|
|
567
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
568
|
-
|
|
569
|
-
const mistral = new Mistral({
|
|
570
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
571
|
-
});
|
|
572
|
-
|
|
573
|
-
async function run() {
|
|
574
|
-
const result = await mistral.beta.libraries.documents.getSignedUrl({
|
|
575
|
-
libraryId: "23cf6904-a602-4ee8-9f5b-8efc557c336d",
|
|
576
|
-
documentId: "48598486-df71-4994-acbb-1133c72efa8c",
|
|
577
|
-
});
|
|
578
|
-
|
|
579
|
-
console.log(result);
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
run();
|
|
583
|
-
```
|
|
584
|
-
|
|
585
|
-
### Standalone function
|
|
586
|
-
|
|
587
|
-
The standalone function version of this method:
|
|
588
|
-
|
|
589
|
-
```typescript
|
|
590
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
591
|
-
import { betaLibrariesDocumentsGetSignedUrl } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsGetSignedUrl.js";
|
|
592
|
-
|
|
593
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
594
|
-
// You can create one instance of it to use across an application.
|
|
595
|
-
const mistral = new MistralCore({
|
|
596
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
597
|
-
});
|
|
598
|
-
|
|
599
|
-
async function run() {
|
|
600
|
-
const res = await betaLibrariesDocumentsGetSignedUrl(mistral, {
|
|
601
|
-
libraryId: "23cf6904-a602-4ee8-9f5b-8efc557c336d",
|
|
602
|
-
documentId: "48598486-df71-4994-acbb-1133c72efa8c",
|
|
603
|
-
});
|
|
604
|
-
if (res.ok) {
|
|
605
|
-
const { value: result } = res;
|
|
606
|
-
console.log(result);
|
|
607
|
-
} else {
|
|
608
|
-
console.log("betaLibrariesDocumentsGetSignedUrl failed:", res.error);
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
run();
|
|
613
|
-
```
|
|
614
|
-
|
|
615
|
-
### Parameters
|
|
616
|
-
|
|
617
|
-
| Parameter | Type | Required | Description |
|
|
618
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
619
|
-
| `request` | [operations.LibrariesDocumentsGetSignedUrlV1Request](../../models/operations/librariesdocumentsgetsignedurlv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
620
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
621
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
622
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
623
|
-
|
|
624
|
-
### Response
|
|
625
|
-
|
|
626
|
-
**Promise\<[string](../../models/.md)\>**
|
|
627
|
-
|
|
628
|
-
### Errors
|
|
629
|
-
|
|
630
|
-
| Error Type | Status Code | Content Type |
|
|
631
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
632
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
633
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
634
|
-
|
|
635
|
-
## extractedTextSignedUrl
|
|
636
|
-
|
|
637
|
-
Given a library and a document in that library, retrieve the signed URL of text extracted. For documents that are sent to the OCR this returns the result of the OCR queries.
|
|
638
|
-
|
|
639
|
-
### Example Usage
|
|
640
|
-
|
|
641
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_get_extracted_text_signed_url_v1" method="get" path="/v1/libraries/{library_id}/documents/{document_id}/extracted-text-signed-url" -->
|
|
642
|
-
```typescript
|
|
643
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
644
|
-
|
|
645
|
-
const mistral = new Mistral({
|
|
646
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
647
|
-
});
|
|
648
|
-
|
|
649
|
-
async function run() {
|
|
650
|
-
const result = await mistral.beta.libraries.documents.extractedTextSignedUrl({
|
|
651
|
-
libraryId: "a6f15de3-1e82-4f95-af82-851499042ef8",
|
|
652
|
-
documentId: "9749d4f9-24e5-4ca2-99a3-a406863f805d",
|
|
653
|
-
});
|
|
654
|
-
|
|
655
|
-
console.log(result);
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
run();
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
### Standalone function
|
|
662
|
-
|
|
663
|
-
The standalone function version of this method:
|
|
664
|
-
|
|
665
|
-
```typescript
|
|
666
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
667
|
-
import { betaLibrariesDocumentsExtractedTextSignedUrl } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsExtractedTextSignedUrl.js";
|
|
668
|
-
|
|
669
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
670
|
-
// You can create one instance of it to use across an application.
|
|
671
|
-
const mistral = new MistralCore({
|
|
672
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
673
|
-
});
|
|
674
|
-
|
|
675
|
-
async function run() {
|
|
676
|
-
const res = await betaLibrariesDocumentsExtractedTextSignedUrl(mistral, {
|
|
677
|
-
libraryId: "a6f15de3-1e82-4f95-af82-851499042ef8",
|
|
678
|
-
documentId: "9749d4f9-24e5-4ca2-99a3-a406863f805d",
|
|
679
|
-
});
|
|
680
|
-
if (res.ok) {
|
|
681
|
-
const { value: result } = res;
|
|
682
|
-
console.log(result);
|
|
683
|
-
} else {
|
|
684
|
-
console.log("betaLibrariesDocumentsExtractedTextSignedUrl failed:", res.error);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
run();
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
### Parameters
|
|
692
|
-
|
|
693
|
-
| Parameter | Type | Required | Description |
|
|
694
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
695
|
-
| `request` | [operations.LibrariesDocumentsGetExtractedTextSignedUrlV1Request](../../models/operations/librariesdocumentsgetextractedtextsignedurlv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
696
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
697
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
698
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
699
|
-
|
|
700
|
-
### Response
|
|
701
|
-
|
|
702
|
-
**Promise\<[string](../../models/.md)\>**
|
|
703
|
-
|
|
704
|
-
### Errors
|
|
705
|
-
|
|
706
|
-
| Error Type | Status Code | Content Type |
|
|
707
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
708
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
709
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
710
|
-
|
|
711
|
-
## reprocess
|
|
712
|
-
|
|
713
|
-
Given a library and a document in that library, reprocess that document, it will be billed again.
|
|
714
|
-
|
|
715
|
-
### Example Usage
|
|
716
|
-
|
|
717
|
-
<!-- UsageSnippet language="typescript" operationID="libraries_documents_reprocess_v1" method="post" path="/v1/libraries/{library_id}/documents/{document_id}/reprocess" -->
|
|
718
|
-
```typescript
|
|
719
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
720
|
-
|
|
721
|
-
const mistral = new Mistral({
|
|
722
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
723
|
-
});
|
|
724
|
-
|
|
725
|
-
async function run() {
|
|
726
|
-
await mistral.beta.libraries.documents.reprocess({
|
|
727
|
-
libraryId: "51b29371-de8f-4ba4-932b-a0bafb3a7f64",
|
|
728
|
-
documentId: "3052422c-49ca-45ac-a918-cadb35d61fd8",
|
|
729
|
-
});
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
run();
|
|
735
|
-
```
|
|
736
|
-
|
|
737
|
-
### Standalone function
|
|
738
|
-
|
|
739
|
-
The standalone function version of this method:
|
|
740
|
-
|
|
741
|
-
```typescript
|
|
742
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
743
|
-
import { betaLibrariesDocumentsReprocess } from "@mistralai/mistralai/funcs/betaLibrariesDocumentsReprocess.js";
|
|
744
|
-
|
|
745
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
746
|
-
// You can create one instance of it to use across an application.
|
|
747
|
-
const mistral = new MistralCore({
|
|
748
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
749
|
-
});
|
|
750
|
-
|
|
751
|
-
async function run() {
|
|
752
|
-
const res = await betaLibrariesDocumentsReprocess(mistral, {
|
|
753
|
-
libraryId: "51b29371-de8f-4ba4-932b-a0bafb3a7f64",
|
|
754
|
-
documentId: "3052422c-49ca-45ac-a918-cadb35d61fd8",
|
|
755
|
-
});
|
|
756
|
-
if (res.ok) {
|
|
757
|
-
const { value: result } = res;
|
|
758
|
-
|
|
759
|
-
} else {
|
|
760
|
-
console.log("betaLibrariesDocumentsReprocess failed:", res.error);
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
run();
|
|
765
|
-
```
|
|
766
|
-
|
|
767
|
-
### Parameters
|
|
768
|
-
|
|
769
|
-
| Parameter | Type | Required | Description |
|
|
770
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
771
|
-
| `request` | [operations.LibrariesDocumentsReprocessV1Request](../../models/operations/librariesdocumentsreprocessv1request.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
772
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
773
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
774
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
775
|
-
|
|
776
|
-
### Response
|
|
777
|
-
|
|
778
|
-
**Promise\<void\>**
|
|
779
|
-
|
|
780
|
-
### Errors
|
|
781
|
-
|
|
782
|
-
| Error Type | Status Code | Content Type |
|
|
783
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
784
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
785
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|