@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,835 +0,0 @@
|
|
|
1
|
-
# Conversations
|
|
2
|
-
(*beta.conversations*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
(beta) Conversations API
|
|
7
|
-
|
|
8
|
-
### Available Operations
|
|
9
|
-
|
|
10
|
-
* [start](#start) - Create a conversation and append entries to it.
|
|
11
|
-
* [list](#list) - List all created conversations.
|
|
12
|
-
* [get](#get) - Retrieve a conversation information.
|
|
13
|
-
* [append](#append) - Append new entries to an existing conversation.
|
|
14
|
-
* [getHistory](#gethistory) - Retrieve all entries in a conversation.
|
|
15
|
-
* [getMessages](#getmessages) - Retrieve all messages in a conversation.
|
|
16
|
-
* [restart](#restart) - Restart a conversation starting from a given entry.
|
|
17
|
-
* [startStream](#startstream) - Create a conversation and append entries to it.
|
|
18
|
-
* [appendStream](#appendstream) - Append new entries to an existing conversation.
|
|
19
|
-
* [restartStream](#restartstream) - Restart a conversation starting from a given entry.
|
|
20
|
-
|
|
21
|
-
## start
|
|
22
|
-
|
|
23
|
-
Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation.
|
|
24
|
-
|
|
25
|
-
### Example Usage
|
|
26
|
-
|
|
27
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_start" method="post" path="/v1/conversations" -->
|
|
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.conversations.start({
|
|
37
|
-
inputs: "<value>",
|
|
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 { betaConversationsStart } from "@mistralai/mistralai/funcs/betaConversationsStart.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 betaConversationsStart(mistral, {
|
|
62
|
-
inputs: "<value>",
|
|
63
|
-
});
|
|
64
|
-
if (res.ok) {
|
|
65
|
-
const { value: result } = res;
|
|
66
|
-
console.log(result);
|
|
67
|
-
} else {
|
|
68
|
-
console.log("betaConversationsStart failed:", res.error);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
run();
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Parameters
|
|
76
|
-
|
|
77
|
-
| Parameter | Type | Required | Description |
|
|
78
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
79
|
-
| `request` | [components.ConversationRequest](../../models/components/conversationrequest.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.ConversationResponse](../../models/components/conversationresponse.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
|
-
## list
|
|
96
|
-
|
|
97
|
-
Retrieve a list of conversation entities sorted by creation time.
|
|
98
|
-
|
|
99
|
-
### Example Usage
|
|
100
|
-
|
|
101
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_list" method="get" path="/v1/conversations" -->
|
|
102
|
-
```typescript
|
|
103
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
104
|
-
|
|
105
|
-
const mistral = new Mistral({
|
|
106
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
async function run() {
|
|
110
|
-
const result = await mistral.beta.conversations.list({});
|
|
111
|
-
|
|
112
|
-
console.log(result);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
run();
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Standalone function
|
|
119
|
-
|
|
120
|
-
The standalone function version of this method:
|
|
121
|
-
|
|
122
|
-
```typescript
|
|
123
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
124
|
-
import { betaConversationsList } from "@mistralai/mistralai/funcs/betaConversationsList.js";
|
|
125
|
-
|
|
126
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
127
|
-
// You can create one instance of it to use across an application.
|
|
128
|
-
const mistral = new MistralCore({
|
|
129
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
async function run() {
|
|
133
|
-
const res = await betaConversationsList(mistral, {});
|
|
134
|
-
if (res.ok) {
|
|
135
|
-
const { value: result } = res;
|
|
136
|
-
console.log(result);
|
|
137
|
-
} else {
|
|
138
|
-
console.log("betaConversationsList failed:", res.error);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
run();
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Parameters
|
|
146
|
-
|
|
147
|
-
| Parameter | Type | Required | Description |
|
|
148
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
149
|
-
| `request` | [operations.AgentsApiV1ConversationsListRequest](../../models/operations/agentsapiv1conversationslistrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
150
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
151
|
-
| `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. |
|
|
152
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
153
|
-
|
|
154
|
-
### Response
|
|
155
|
-
|
|
156
|
-
**Promise\<[operations.ResponseBody[]](../../models/.md)\>**
|
|
157
|
-
|
|
158
|
-
### Errors
|
|
159
|
-
|
|
160
|
-
| Error Type | Status Code | Content Type |
|
|
161
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
162
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
163
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
164
|
-
|
|
165
|
-
## get
|
|
166
|
-
|
|
167
|
-
Given a conversation_id retrieve a conversation entity with its attributes.
|
|
168
|
-
|
|
169
|
-
### Example Usage
|
|
170
|
-
|
|
171
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_get" method="get" path="/v1/conversations/{conversation_id}" -->
|
|
172
|
-
```typescript
|
|
173
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
174
|
-
|
|
175
|
-
const mistral = new Mistral({
|
|
176
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
async function run() {
|
|
180
|
-
const result = await mistral.beta.conversations.get({
|
|
181
|
-
conversationId: "<id>",
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
console.log(result);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
run();
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Standalone function
|
|
191
|
-
|
|
192
|
-
The standalone function version of this method:
|
|
193
|
-
|
|
194
|
-
```typescript
|
|
195
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
196
|
-
import { betaConversationsGet } from "@mistralai/mistralai/funcs/betaConversationsGet.js";
|
|
197
|
-
|
|
198
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
199
|
-
// You can create one instance of it to use across an application.
|
|
200
|
-
const mistral = new MistralCore({
|
|
201
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
async function run() {
|
|
205
|
-
const res = await betaConversationsGet(mistral, {
|
|
206
|
-
conversationId: "<id>",
|
|
207
|
-
});
|
|
208
|
-
if (res.ok) {
|
|
209
|
-
const { value: result } = res;
|
|
210
|
-
console.log(result);
|
|
211
|
-
} else {
|
|
212
|
-
console.log("betaConversationsGet failed:", res.error);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
run();
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Parameters
|
|
220
|
-
|
|
221
|
-
| Parameter | Type | Required | Description |
|
|
222
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
223
|
-
| `request` | [operations.AgentsApiV1ConversationsGetRequest](../../models/operations/agentsapiv1conversationsgetrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
224
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
225
|
-
| `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. |
|
|
226
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
227
|
-
|
|
228
|
-
### Response
|
|
229
|
-
|
|
230
|
-
**Promise\<[operations.AgentsApiV1ConversationsGetResponseV1ConversationsGet](../../models/operations/agentsapiv1conversationsgetresponsev1conversationsget.md)\>**
|
|
231
|
-
|
|
232
|
-
### Errors
|
|
233
|
-
|
|
234
|
-
| Error Type | Status Code | Content Type |
|
|
235
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
236
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
237
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
238
|
-
|
|
239
|
-
## append
|
|
240
|
-
|
|
241
|
-
Run completion on the history of the conversation and the user entries. Return the new created entries.
|
|
242
|
-
|
|
243
|
-
### Example Usage
|
|
244
|
-
|
|
245
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_append" method="post" path="/v1/conversations/{conversation_id}" -->
|
|
246
|
-
```typescript
|
|
247
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
248
|
-
|
|
249
|
-
const mistral = new Mistral({
|
|
250
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
async function run() {
|
|
254
|
-
const result = await mistral.beta.conversations.append({
|
|
255
|
-
conversationId: "<id>",
|
|
256
|
-
conversationAppendRequest: {
|
|
257
|
-
inputs: [],
|
|
258
|
-
},
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
console.log(result);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
run();
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Standalone function
|
|
268
|
-
|
|
269
|
-
The standalone function version of this method:
|
|
270
|
-
|
|
271
|
-
```typescript
|
|
272
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
273
|
-
import { betaConversationsAppend } from "@mistralai/mistralai/funcs/betaConversationsAppend.js";
|
|
274
|
-
|
|
275
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
276
|
-
// You can create one instance of it to use across an application.
|
|
277
|
-
const mistral = new MistralCore({
|
|
278
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
async function run() {
|
|
282
|
-
const res = await betaConversationsAppend(mistral, {
|
|
283
|
-
conversationId: "<id>",
|
|
284
|
-
conversationAppendRequest: {
|
|
285
|
-
inputs: [],
|
|
286
|
-
},
|
|
287
|
-
});
|
|
288
|
-
if (res.ok) {
|
|
289
|
-
const { value: result } = res;
|
|
290
|
-
console.log(result);
|
|
291
|
-
} else {
|
|
292
|
-
console.log("betaConversationsAppend failed:", res.error);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
run();
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Parameters
|
|
300
|
-
|
|
301
|
-
| Parameter | Type | Required | Description |
|
|
302
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
303
|
-
| `request` | [operations.AgentsApiV1ConversationsAppendRequest](../../models/operations/agentsapiv1conversationsappendrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
304
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
305
|
-
| `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. |
|
|
306
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
307
|
-
|
|
308
|
-
### Response
|
|
309
|
-
|
|
310
|
-
**Promise\<[components.ConversationResponse](../../models/components/conversationresponse.md)\>**
|
|
311
|
-
|
|
312
|
-
### Errors
|
|
313
|
-
|
|
314
|
-
| Error Type | Status Code | Content Type |
|
|
315
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
316
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
317
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
318
|
-
|
|
319
|
-
## getHistory
|
|
320
|
-
|
|
321
|
-
Given a conversation_id retrieve all the entries belonging to that conversation. The entries are sorted in the order they were appended, those can be messages, connectors or function_call.
|
|
322
|
-
|
|
323
|
-
### Example Usage
|
|
324
|
-
|
|
325
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_history" method="get" path="/v1/conversations/{conversation_id}/history" -->
|
|
326
|
-
```typescript
|
|
327
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
328
|
-
|
|
329
|
-
const mistral = new Mistral({
|
|
330
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
async function run() {
|
|
334
|
-
const result = await mistral.beta.conversations.getHistory({
|
|
335
|
-
conversationId: "<id>",
|
|
336
|
-
});
|
|
337
|
-
|
|
338
|
-
console.log(result);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
run();
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
### Standalone function
|
|
345
|
-
|
|
346
|
-
The standalone function version of this method:
|
|
347
|
-
|
|
348
|
-
```typescript
|
|
349
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
350
|
-
import { betaConversationsGetHistory } from "@mistralai/mistralai/funcs/betaConversationsGetHistory.js";
|
|
351
|
-
|
|
352
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
353
|
-
// You can create one instance of it to use across an application.
|
|
354
|
-
const mistral = new MistralCore({
|
|
355
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
async function run() {
|
|
359
|
-
const res = await betaConversationsGetHistory(mistral, {
|
|
360
|
-
conversationId: "<id>",
|
|
361
|
-
});
|
|
362
|
-
if (res.ok) {
|
|
363
|
-
const { value: result } = res;
|
|
364
|
-
console.log(result);
|
|
365
|
-
} else {
|
|
366
|
-
console.log("betaConversationsGetHistory failed:", res.error);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
run();
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
### Parameters
|
|
374
|
-
|
|
375
|
-
| Parameter | Type | Required | Description |
|
|
376
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
377
|
-
| `request` | [operations.AgentsApiV1ConversationsHistoryRequest](../../models/operations/agentsapiv1conversationshistoryrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
378
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
379
|
-
| `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. |
|
|
380
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
381
|
-
|
|
382
|
-
### Response
|
|
383
|
-
|
|
384
|
-
**Promise\<[components.ConversationHistory](../../models/components/conversationhistory.md)\>**
|
|
385
|
-
|
|
386
|
-
### Errors
|
|
387
|
-
|
|
388
|
-
| Error Type | Status Code | Content Type |
|
|
389
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
390
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
391
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
392
|
-
|
|
393
|
-
## getMessages
|
|
394
|
-
|
|
395
|
-
Given a conversation_id retrieve all the messages belonging to that conversation. This is similar to retrieving all entries except we filter the messages only.
|
|
396
|
-
|
|
397
|
-
### Example Usage
|
|
398
|
-
|
|
399
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_messages" method="get" path="/v1/conversations/{conversation_id}/messages" -->
|
|
400
|
-
```typescript
|
|
401
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
402
|
-
|
|
403
|
-
const mistral = new Mistral({
|
|
404
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
405
|
-
});
|
|
406
|
-
|
|
407
|
-
async function run() {
|
|
408
|
-
const result = await mistral.beta.conversations.getMessages({
|
|
409
|
-
conversationId: "<id>",
|
|
410
|
-
});
|
|
411
|
-
|
|
412
|
-
console.log(result);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
run();
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### Standalone function
|
|
419
|
-
|
|
420
|
-
The standalone function version of this method:
|
|
421
|
-
|
|
422
|
-
```typescript
|
|
423
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
424
|
-
import { betaConversationsGetMessages } from "@mistralai/mistralai/funcs/betaConversationsGetMessages.js";
|
|
425
|
-
|
|
426
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
427
|
-
// You can create one instance of it to use across an application.
|
|
428
|
-
const mistral = new MistralCore({
|
|
429
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
async function run() {
|
|
433
|
-
const res = await betaConversationsGetMessages(mistral, {
|
|
434
|
-
conversationId: "<id>",
|
|
435
|
-
});
|
|
436
|
-
if (res.ok) {
|
|
437
|
-
const { value: result } = res;
|
|
438
|
-
console.log(result);
|
|
439
|
-
} else {
|
|
440
|
-
console.log("betaConversationsGetMessages failed:", res.error);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
run();
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
### Parameters
|
|
448
|
-
|
|
449
|
-
| Parameter | Type | Required | Description |
|
|
450
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
451
|
-
| `request` | [operations.AgentsApiV1ConversationsMessagesRequest](../../models/operations/agentsapiv1conversationsmessagesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
452
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
453
|
-
| `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. |
|
|
454
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
455
|
-
|
|
456
|
-
### Response
|
|
457
|
-
|
|
458
|
-
**Promise\<[components.ConversationMessages](../../models/components/conversationmessages.md)\>**
|
|
459
|
-
|
|
460
|
-
### Errors
|
|
461
|
-
|
|
462
|
-
| Error Type | Status Code | Content Type |
|
|
463
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
464
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
465
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
466
|
-
|
|
467
|
-
## restart
|
|
468
|
-
|
|
469
|
-
Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned.
|
|
470
|
-
|
|
471
|
-
### Example Usage
|
|
472
|
-
|
|
473
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_restart" method="post" path="/v1/conversations/{conversation_id}/restart" -->
|
|
474
|
-
```typescript
|
|
475
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
476
|
-
|
|
477
|
-
const mistral = new Mistral({
|
|
478
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
479
|
-
});
|
|
480
|
-
|
|
481
|
-
async function run() {
|
|
482
|
-
const result = await mistral.beta.conversations.restart({
|
|
483
|
-
conversationId: "<id>",
|
|
484
|
-
conversationRestartRequest: {
|
|
485
|
-
inputs: "<value>",
|
|
486
|
-
fromEntryId: "<id>",
|
|
487
|
-
},
|
|
488
|
-
});
|
|
489
|
-
|
|
490
|
-
console.log(result);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
run();
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
### Standalone function
|
|
497
|
-
|
|
498
|
-
The standalone function version of this method:
|
|
499
|
-
|
|
500
|
-
```typescript
|
|
501
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
502
|
-
import { betaConversationsRestart } from "@mistralai/mistralai/funcs/betaConversationsRestart.js";
|
|
503
|
-
|
|
504
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
505
|
-
// You can create one instance of it to use across an application.
|
|
506
|
-
const mistral = new MistralCore({
|
|
507
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
508
|
-
});
|
|
509
|
-
|
|
510
|
-
async function run() {
|
|
511
|
-
const res = await betaConversationsRestart(mistral, {
|
|
512
|
-
conversationId: "<id>",
|
|
513
|
-
conversationRestartRequest: {
|
|
514
|
-
inputs: "<value>",
|
|
515
|
-
fromEntryId: "<id>",
|
|
516
|
-
},
|
|
517
|
-
});
|
|
518
|
-
if (res.ok) {
|
|
519
|
-
const { value: result } = res;
|
|
520
|
-
console.log(result);
|
|
521
|
-
} else {
|
|
522
|
-
console.log("betaConversationsRestart failed:", res.error);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
run();
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
### Parameters
|
|
530
|
-
|
|
531
|
-
| Parameter | Type | Required | Description |
|
|
532
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
533
|
-
| `request` | [operations.AgentsApiV1ConversationsRestartRequest](../../models/operations/agentsapiv1conversationsrestartrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
534
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
535
|
-
| `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. |
|
|
536
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
537
|
-
|
|
538
|
-
### Response
|
|
539
|
-
|
|
540
|
-
**Promise\<[components.ConversationResponse](../../models/components/conversationresponse.md)\>**
|
|
541
|
-
|
|
542
|
-
### Errors
|
|
543
|
-
|
|
544
|
-
| Error Type | Status Code | Content Type |
|
|
545
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
546
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
547
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
548
|
-
|
|
549
|
-
## startStream
|
|
550
|
-
|
|
551
|
-
Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation.
|
|
552
|
-
|
|
553
|
-
### Example Usage
|
|
554
|
-
|
|
555
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_start_stream" method="post" path="/v1/conversations#stream" -->
|
|
556
|
-
```typescript
|
|
557
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
558
|
-
|
|
559
|
-
const mistral = new Mistral({
|
|
560
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
561
|
-
});
|
|
562
|
-
|
|
563
|
-
async function run() {
|
|
564
|
-
const result = await mistral.beta.conversations.startStream({
|
|
565
|
-
inputs: [
|
|
566
|
-
{
|
|
567
|
-
object: "entry",
|
|
568
|
-
type: "agent.handoff",
|
|
569
|
-
previousAgentId: "<id>",
|
|
570
|
-
previousAgentName: "<value>",
|
|
571
|
-
nextAgentId: "<id>",
|
|
572
|
-
nextAgentName: "<value>",
|
|
573
|
-
},
|
|
574
|
-
],
|
|
575
|
-
});
|
|
576
|
-
|
|
577
|
-
for await (const event of result) {
|
|
578
|
-
// Handle the event
|
|
579
|
-
console.log(event);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
run();
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
### Standalone function
|
|
587
|
-
|
|
588
|
-
The standalone function version of this method:
|
|
589
|
-
|
|
590
|
-
```typescript
|
|
591
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
592
|
-
import { betaConversationsStartStream } from "@mistralai/mistralai/funcs/betaConversationsStartStream.js";
|
|
593
|
-
|
|
594
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
595
|
-
// You can create one instance of it to use across an application.
|
|
596
|
-
const mistral = new MistralCore({
|
|
597
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
598
|
-
});
|
|
599
|
-
|
|
600
|
-
async function run() {
|
|
601
|
-
const res = await betaConversationsStartStream(mistral, {
|
|
602
|
-
inputs: [
|
|
603
|
-
{
|
|
604
|
-
object: "entry",
|
|
605
|
-
type: "agent.handoff",
|
|
606
|
-
previousAgentId: "<id>",
|
|
607
|
-
previousAgentName: "<value>",
|
|
608
|
-
nextAgentId: "<id>",
|
|
609
|
-
nextAgentName: "<value>",
|
|
610
|
-
},
|
|
611
|
-
],
|
|
612
|
-
});
|
|
613
|
-
if (res.ok) {
|
|
614
|
-
const { value: result } = res;
|
|
615
|
-
for await (const event of result) {
|
|
616
|
-
// Handle the event
|
|
617
|
-
console.log(event);
|
|
618
|
-
}
|
|
619
|
-
} else {
|
|
620
|
-
console.log("betaConversationsStartStream failed:", res.error);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
run();
|
|
625
|
-
```
|
|
626
|
-
|
|
627
|
-
### Parameters
|
|
628
|
-
|
|
629
|
-
| Parameter | Type | Required | Description |
|
|
630
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
631
|
-
| `request` | [components.ConversationStreamRequest](../../models/components/conversationstreamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
632
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
633
|
-
| `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. |
|
|
634
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
635
|
-
|
|
636
|
-
### Response
|
|
637
|
-
|
|
638
|
-
**Promise\<[EventStream<components.ConversationEvents>](../../models/.md)\>**
|
|
639
|
-
|
|
640
|
-
### Errors
|
|
641
|
-
|
|
642
|
-
| Error Type | Status Code | Content Type |
|
|
643
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
644
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
645
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
646
|
-
|
|
647
|
-
## appendStream
|
|
648
|
-
|
|
649
|
-
Run completion on the history of the conversation and the user entries. Return the new created entries.
|
|
650
|
-
|
|
651
|
-
### Example Usage
|
|
652
|
-
|
|
653
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_append_stream" method="post" path="/v1/conversations/{conversation_id}#stream" -->
|
|
654
|
-
```typescript
|
|
655
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
656
|
-
|
|
657
|
-
const mistral = new Mistral({
|
|
658
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
659
|
-
});
|
|
660
|
-
|
|
661
|
-
async function run() {
|
|
662
|
-
const result = await mistral.beta.conversations.appendStream({
|
|
663
|
-
conversationId: "<id>",
|
|
664
|
-
conversationAppendStreamRequest: {
|
|
665
|
-
inputs: "<value>",
|
|
666
|
-
},
|
|
667
|
-
});
|
|
668
|
-
|
|
669
|
-
for await (const event of result) {
|
|
670
|
-
// Handle the event
|
|
671
|
-
console.log(event);
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
run();
|
|
676
|
-
```
|
|
677
|
-
|
|
678
|
-
### Standalone function
|
|
679
|
-
|
|
680
|
-
The standalone function version of this method:
|
|
681
|
-
|
|
682
|
-
```typescript
|
|
683
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
684
|
-
import { betaConversationsAppendStream } from "@mistralai/mistralai/funcs/betaConversationsAppendStream.js";
|
|
685
|
-
|
|
686
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
687
|
-
// You can create one instance of it to use across an application.
|
|
688
|
-
const mistral = new MistralCore({
|
|
689
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
690
|
-
});
|
|
691
|
-
|
|
692
|
-
async function run() {
|
|
693
|
-
const res = await betaConversationsAppendStream(mistral, {
|
|
694
|
-
conversationId: "<id>",
|
|
695
|
-
conversationAppendStreamRequest: {
|
|
696
|
-
inputs: "<value>",
|
|
697
|
-
},
|
|
698
|
-
});
|
|
699
|
-
if (res.ok) {
|
|
700
|
-
const { value: result } = res;
|
|
701
|
-
for await (const event of result) {
|
|
702
|
-
// Handle the event
|
|
703
|
-
console.log(event);
|
|
704
|
-
}
|
|
705
|
-
} else {
|
|
706
|
-
console.log("betaConversationsAppendStream failed:", res.error);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
run();
|
|
711
|
-
```
|
|
712
|
-
|
|
713
|
-
### Parameters
|
|
714
|
-
|
|
715
|
-
| Parameter | Type | Required | Description |
|
|
716
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
717
|
-
| `request` | [operations.AgentsApiV1ConversationsAppendStreamRequest](../../models/operations/agentsapiv1conversationsappendstreamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
718
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
719
|
-
| `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. |
|
|
720
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
721
|
-
|
|
722
|
-
### Response
|
|
723
|
-
|
|
724
|
-
**Promise\<[EventStream<components.ConversationEvents>](../../models/.md)\>**
|
|
725
|
-
|
|
726
|
-
### Errors
|
|
727
|
-
|
|
728
|
-
| Error Type | Status Code | Content Type |
|
|
729
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
730
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
731
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
732
|
-
|
|
733
|
-
## restartStream
|
|
734
|
-
|
|
735
|
-
Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned.
|
|
736
|
-
|
|
737
|
-
### Example Usage
|
|
738
|
-
|
|
739
|
-
<!-- UsageSnippet language="typescript" operationID="agents_api_v1_conversations_restart_stream" method="post" path="/v1/conversations/{conversation_id}/restart#stream" -->
|
|
740
|
-
```typescript
|
|
741
|
-
import { Mistral } from "@mistralai/mistralai";
|
|
742
|
-
|
|
743
|
-
const mistral = new Mistral({
|
|
744
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
745
|
-
});
|
|
746
|
-
|
|
747
|
-
async function run() {
|
|
748
|
-
const result = await mistral.beta.conversations.restartStream({
|
|
749
|
-
conversationId: "<id>",
|
|
750
|
-
conversationRestartStreamRequest: {
|
|
751
|
-
inputs: [
|
|
752
|
-
{
|
|
753
|
-
object: "entry",
|
|
754
|
-
type: "message.input",
|
|
755
|
-
role: "assistant",
|
|
756
|
-
content: "<value>",
|
|
757
|
-
prefix: false,
|
|
758
|
-
},
|
|
759
|
-
],
|
|
760
|
-
fromEntryId: "<id>",
|
|
761
|
-
},
|
|
762
|
-
});
|
|
763
|
-
|
|
764
|
-
for await (const event of result) {
|
|
765
|
-
// Handle the event
|
|
766
|
-
console.log(event);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
run();
|
|
771
|
-
```
|
|
772
|
-
|
|
773
|
-
### Standalone function
|
|
774
|
-
|
|
775
|
-
The standalone function version of this method:
|
|
776
|
-
|
|
777
|
-
```typescript
|
|
778
|
-
import { MistralCore } from "@mistralai/mistralai/core.js";
|
|
779
|
-
import { betaConversationsRestartStream } from "@mistralai/mistralai/funcs/betaConversationsRestartStream.js";
|
|
780
|
-
|
|
781
|
-
// Use `MistralCore` for best tree-shaking performance.
|
|
782
|
-
// You can create one instance of it to use across an application.
|
|
783
|
-
const mistral = new MistralCore({
|
|
784
|
-
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
|
|
785
|
-
});
|
|
786
|
-
|
|
787
|
-
async function run() {
|
|
788
|
-
const res = await betaConversationsRestartStream(mistral, {
|
|
789
|
-
conversationId: "<id>",
|
|
790
|
-
conversationRestartStreamRequest: {
|
|
791
|
-
inputs: [
|
|
792
|
-
{
|
|
793
|
-
object: "entry",
|
|
794
|
-
type: "message.input",
|
|
795
|
-
role: "assistant",
|
|
796
|
-
content: "<value>",
|
|
797
|
-
prefix: false,
|
|
798
|
-
},
|
|
799
|
-
],
|
|
800
|
-
fromEntryId: "<id>",
|
|
801
|
-
},
|
|
802
|
-
});
|
|
803
|
-
if (res.ok) {
|
|
804
|
-
const { value: result } = res;
|
|
805
|
-
for await (const event of result) {
|
|
806
|
-
// Handle the event
|
|
807
|
-
console.log(event);
|
|
808
|
-
}
|
|
809
|
-
} else {
|
|
810
|
-
console.log("betaConversationsRestartStream failed:", res.error);
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
run();
|
|
815
|
-
```
|
|
816
|
-
|
|
817
|
-
### Parameters
|
|
818
|
-
|
|
819
|
-
| Parameter | Type | Required | Description |
|
|
820
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
821
|
-
| `request` | [operations.AgentsApiV1ConversationsRestartStreamRequest](../../models/operations/agentsapiv1conversationsrestartstreamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
822
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
823
|
-
| `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. |
|
|
824
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
825
|
-
|
|
826
|
-
### Response
|
|
827
|
-
|
|
828
|
-
**Promise\<[EventStream<components.ConversationEvents>](../../models/.md)\>**
|
|
829
|
-
|
|
830
|
-
### Errors
|
|
831
|
-
|
|
832
|
-
| Error Type | Status Code | Content Type |
|
|
833
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
834
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
835
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|