@mistralai/mistralai 3.3.0 → 3.5.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 +76 -46
- package/esm/extra/realtime/connection.d.ts +16 -3
- package/esm/extra/realtime/connection.d.ts.map +1 -1
- package/esm/extra/realtime/connection.js +35 -9
- package/esm/extra/realtime/connection.js.map +1 -1
- package/esm/extra/realtime/errors.d.ts +18 -0
- package/esm/extra/realtime/errors.d.ts.map +1 -1
- package/esm/extra/realtime/errors.js +19 -0
- package/esm/extra/realtime/errors.js.map +1 -1
- package/esm/extra/realtime/index.d.ts +20 -1
- package/esm/extra/realtime/index.d.ts.map +1 -1
- package/esm/extra/realtime/index.js +5 -0
- package/esm/extra/realtime/index.js.map +1 -1
- package/esm/extra/realtime/speech.d.ts +64 -0
- package/esm/extra/realtime/speech.d.ts.map +1 -0
- package/esm/extra/realtime/speech.js +461 -0
- package/esm/extra/realtime/speech.js.map +1 -0
- package/esm/extra/realtime/transcription.d.ts +2 -2
- package/esm/extra/realtime/transcription.d.ts.map +1 -1
- package/esm/extra/realtime/transcription.js +11 -2
- package/esm/extra/realtime/transcription.js.map +1 -1
- package/esm/extra/workflows/encoding/payload-encoder.d.ts.map +1 -1
- package/esm/extra/workflows/encoding/payload-encoder.js +2 -2
- package/esm/extra/workflows/encoding/payload-encoder.js.map +1 -1
- package/esm/extra/workflows/encoding/python-json.d.ts +3 -2
- package/esm/extra/workflows/encoding/python-json.d.ts.map +1 -1
- package/esm/extra/workflows/encoding/python-json.js +24 -9
- package/esm/extra/workflows/encoding/python-json.js.map +1 -1
- package/esm/funcs/{betaRagManagedIndexesCreate.d.ts → betaContextSearchIndexesCreate.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesCreate.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesCreate.js → betaContextSearchIndexesCreate.js} +3 -3
- package/esm/funcs/betaContextSearchIndexesCreate.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesDelete.d.ts → betaContextSearchIndexesDelete.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesDelete.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesDelete.js → betaContextSearchIndexesDelete.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesDelete.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesDeleteDocuments.d.ts → betaContextSearchIndexesDeleteDocuments.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesDeleteDocuments.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesDeleteDocuments.js → betaContextSearchIndexesDeleteDocuments.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesDeleteDocuments.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGenerateIndexSummary.d.ts → betaContextSearchIndexesGenerateIndexSummary.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesGenerateIndexSummary.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGenerateIndexSummary.js → betaContextSearchIndexesGenerateIndexSummary.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesGenerateIndexSummary.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGet.d.ts → betaContextSearchIndexesGet.d.ts} +2 -2
- package/esm/funcs/{betaRagManagedIndexesDelete.d.ts.map → betaContextSearchIndexesGet.d.ts.map} +1 -1
- package/esm/funcs/{betaRagManagedIndexesGet.js → betaContextSearchIndexesGet.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesGet.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGetChunk.d.ts → betaContextSearchIndexesGetChunk.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesGetChunk.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGetChunk.js → betaContextSearchIndexesGetChunk.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesGetChunk.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGetIndexSummary.d.ts → betaContextSearchIndexesGetIndexSummary.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesGetIndexSummary.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGetIndexSummary.js → betaContextSearchIndexesGetIndexSummary.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesGetIndexSummary.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGrep.d.ts → betaContextSearchIndexesGrep.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesGrep.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesGrep.js → betaContextSearchIndexesGrep.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesGrep.js.map +1 -0
- package/esm/funcs/betaContextSearchIndexesIngestDocuments.d.ts +19 -0
- package/esm/funcs/betaContextSearchIndexesIngestDocuments.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesIngestDocuments.js → betaContextSearchIndexesIngestDocuments.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesIngestDocuments.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesList.d.ts → betaContextSearchIndexesList.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesList.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesList.js → betaContextSearchIndexesList.js} +3 -3
- package/esm/funcs/betaContextSearchIndexesList.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesNavigate.d.ts → betaContextSearchIndexesNavigate.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesNavigate.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesNavigate.js → betaContextSearchIndexesNavigate.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesNavigate.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesRead.d.ts → betaContextSearchIndexesRead.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesRead.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesRead.js → betaContextSearchIndexesRead.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesRead.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesSearch.d.ts → betaContextSearchIndexesSearch.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesSearch.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesSearch.js → betaContextSearchIndexesSearch.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesSearch.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesSetIndexSummary.d.ts → betaContextSearchIndexesSetIndexSummary.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesSetIndexSummary.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesSetIndexSummary.js → betaContextSearchIndexesSetIndexSummary.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesSetIndexSummary.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesUpdate.d.ts → betaContextSearchIndexesUpdate.d.ts} +2 -2
- package/esm/funcs/betaContextSearchIndexesUpdate.d.ts.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesUpdate.js → betaContextSearchIndexesUpdate.js} +2 -2
- package/esm/funcs/betaContextSearchIndexesUpdate.js.map +1 -0
- package/esm/funcs/betaTriggersCreate.d.ts +15 -0
- package/esm/funcs/betaTriggersCreate.d.ts.map +1 -0
- package/esm/funcs/betaTriggersCreate.js +80 -0
- package/esm/funcs/betaTriggersCreate.js.map +1 -0
- package/esm/funcs/betaTriggersDelete.d.ts +15 -0
- package/esm/funcs/betaTriggersDelete.d.ts.map +1 -0
- package/esm/funcs/betaTriggersDelete.js +87 -0
- package/esm/funcs/betaTriggersDelete.js.map +1 -0
- package/esm/funcs/{betaRagManagedIndexesIngestDocuments.d.ts → betaTriggersGet.d.ts} +3 -6
- package/esm/funcs/betaTriggersGet.d.ts.map +1 -0
- package/esm/funcs/betaTriggersGet.js +86 -0
- package/esm/funcs/betaTriggersGet.js.map +1 -0
- package/esm/funcs/betaTriggersList.d.ts +16 -0
- package/esm/funcs/betaTriggersList.d.ts.map +1 -0
- package/esm/funcs/betaTriggersList.js +88 -0
- package/esm/funcs/betaTriggersList.js.map +1 -0
- package/esm/funcs/betaTriggersListEvents.d.ts +16 -0
- package/esm/funcs/betaTriggersListEvents.d.ts.map +1 -0
- package/esm/funcs/betaTriggersListEvents.js +92 -0
- package/esm/funcs/betaTriggersListEvents.js.map +1 -0
- package/esm/funcs/betaWebhooksCreate.d.ts +15 -0
- package/esm/funcs/betaWebhooksCreate.d.ts.map +1 -0
- package/esm/funcs/betaWebhooksCreate.js +80 -0
- package/esm/funcs/betaWebhooksCreate.js.map +1 -0
- package/esm/funcs/betaWebhooksDelete.d.ts +15 -0
- package/esm/funcs/betaWebhooksDelete.d.ts.map +1 -0
- package/esm/funcs/betaWebhooksDelete.js +87 -0
- package/esm/funcs/betaWebhooksDelete.js.map +1 -0
- package/esm/funcs/betaWebhooksGet.d.ts +16 -0
- package/esm/funcs/betaWebhooksGet.d.ts.map +1 -0
- package/esm/funcs/betaWebhooksGet.js +86 -0
- package/esm/funcs/betaWebhooksGet.js.map +1 -0
- package/esm/funcs/betaWebhooksGetSigningSecret.d.ts +16 -0
- package/esm/funcs/betaWebhooksGetSigningSecret.d.ts.map +1 -0
- package/esm/funcs/betaWebhooksGetSigningSecret.js +88 -0
- package/esm/funcs/betaWebhooksGetSigningSecret.js.map +1 -0
- package/esm/funcs/betaWebhooksList.d.ts +14 -0
- package/esm/funcs/betaWebhooksList.d.ts.map +1 -0
- package/esm/funcs/betaWebhooksList.js +67 -0
- package/esm/funcs/betaWebhooksList.js.map +1 -0
- package/esm/funcs/workflowsAddWorkflowTags.d.ts +15 -0
- package/esm/funcs/workflowsAddWorkflowTags.d.ts.map +1 -0
- package/esm/funcs/workflowsAddWorkflowTags.js +88 -0
- package/esm/funcs/workflowsAddWorkflowTags.js.map +1 -0
- package/esm/funcs/workflowsDeploymentsGetDeploymentArchive.d.ts +22 -0
- package/esm/funcs/workflowsDeploymentsGetDeploymentArchive.d.ts.map +1 -0
- package/esm/funcs/workflowsDeploymentsGetDeploymentArchive.js +94 -0
- package/esm/funcs/workflowsDeploymentsGetDeploymentArchive.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/connectionpreference.d.ts +12 -2
- package/esm/models/components/connectionpreference.d.ts.map +1 -1
- package/esm/models/components/connectionpreference.js +3 -3
- package/esm/models/components/connectionpreference.js.map +1 -1
- package/esm/models/components/connectoropenapispec.d.ts +14 -0
- package/esm/models/components/connectoropenapispec.d.ts.map +1 -0
- package/esm/models/components/connectoropenapispec.js +14 -0
- package/esm/models/components/connectoropenapispec.js.map +1 -0
- package/esm/models/components/createtrigger.d.ts +34 -0
- package/esm/models/components/createtrigger.d.ts.map +1 -0
- package/esm/models/components/createtrigger.js +26 -0
- package/esm/models/components/createtrigger.js.map +1 -0
- package/esm/models/components/createtriggeraction.d.ts +18 -0
- package/esm/models/components/createtriggeraction.d.ts.map +1 -0
- package/esm/models/components/createtriggeraction.js +19 -0
- package/esm/models/components/createtriggeraction.js.map +1 -0
- package/esm/models/components/createwebhook.d.ts +62 -0
- package/esm/models/components/createwebhook.d.ts.map +1 -0
- package/esm/models/components/createwebhook.js +47 -0
- package/esm/models/components/createwebhook.js.map +1 -0
- package/esm/models/components/deploymentarchiveresponse.d.ts +20 -0
- package/esm/models/components/deploymentarchiveresponse.d.ts.map +1 -0
- package/esm/models/components/deploymentarchiveresponse.js +20 -0
- package/esm/models/components/deploymentarchiveresponse.js.map +1 -0
- package/esm/models/components/deploymentworkerspecinput.d.ts +15 -2
- package/esm/models/components/deploymentworkerspecinput.d.ts.map +1 -1
- package/esm/models/components/deploymentworkerspecinput.js +5 -1
- package/esm/models/components/deploymentworkerspecinput.js.map +1 -1
- package/esm/models/components/deploymentworkerspecresponse.d.ts +8 -0
- package/esm/models/components/deploymentworkerspecresponse.d.ts.map +1 -1
- package/esm/models/components/deploymentworkerspecresponse.js +4 -0
- package/esm/models/components/deploymentworkerspecresponse.js.map +1 -1
- package/esm/models/components/getlog.d.ts +1 -0
- package/esm/models/components/getlog.d.ts.map +1 -1
- package/esm/models/components/getlog.js +2 -0
- package/esm/models/components/getlog.js.map +1 -1
- package/esm/models/components/getspan.d.ts +1 -0
- package/esm/models/components/getspan.d.ts.map +1 -1
- package/esm/models/components/getspan.js +2 -0
- package/esm/models/components/getspan.js.map +1 -1
- package/esm/models/components/getspanevaluation.d.ts +1 -0
- package/esm/models/components/getspanevaluation.d.ts.map +1 -1
- package/esm/models/components/getspanevaluation.js +2 -0
- package/esm/models/components/getspanevaluation.js.map +1 -1
- package/esm/models/components/gettrace.d.ts +1 -0
- package/esm/models/components/gettrace.d.ts.map +1 -1
- package/esm/models/components/gettrace.js +2 -0
- package/esm/models/components/gettrace.js.map +1 -1
- package/esm/models/components/httpconnector.d.ts +5 -0
- package/esm/models/components/httpconnector.d.ts.map +1 -1
- package/esm/models/components/httpconnector.js +3 -0
- package/esm/models/components/httpconnector.js.map +1 -1
- package/esm/models/components/index.d.ts +33 -5
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +33 -5
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/observabilityerrorcode.d.ts +1 -0
- package/esm/models/components/observabilityerrorcode.d.ts.map +1 -1
- package/esm/models/components/observabilityerrorcode.js +1 -0
- package/esm/models/components/observabilityerrorcode.js.map +1 -1
- package/esm/models/components/openapifilesource.d.ts +14 -0
- package/esm/models/components/openapifilesource.d.ts.map +1 -0
- package/esm/models/components/openapifilesource.js +14 -0
- package/esm/models/components/openapifilesource.js.map +1 -0
- package/esm/models/components/openapispecsource.d.ts +11 -0
- package/esm/models/components/openapispecsource.d.ts.map +1 -0
- package/esm/models/components/openapispecsource.js +16 -0
- package/esm/models/components/openapispecsource.js.map +1 -0
- package/esm/models/components/openapiurlsource.d.ts +14 -0
- package/esm/models/components/openapiurlsource.d.ts.map +1 -0
- package/esm/models/components/openapiurlsource.js +14 -0
- package/esm/models/components/openapiurlsource.js.map +1 -0
- package/esm/models/components/realtimespeecherror.d.ts +20 -0
- package/esm/models/components/realtimespeecherror.d.ts.map +1 -0
- package/esm/models/components/realtimespeecherror.js +23 -0
- package/esm/models/components/realtimespeecherror.js.map +1 -0
- package/esm/models/components/realtimespeecherrordetail.d.ts +45 -0
- package/esm/models/components/realtimespeecherrordetail.d.ts.map +1 -0
- package/esm/models/components/realtimespeecherrordetail.js +33 -0
- package/esm/models/components/realtimespeecherrordetail.js.map +1 -0
- package/esm/models/components/realtimespeechinputtextappend.d.ts +19 -0
- package/esm/models/components/realtimespeechinputtextappend.d.ts.map +1 -0
- package/esm/models/components/realtimespeechinputtextappend.js +22 -0
- package/esm/models/components/realtimespeechinputtextappend.js.map +1 -0
- package/esm/models/components/realtimespeechinputtextend.d.ts +17 -0
- package/esm/models/components/realtimespeechinputtextend.d.ts.map +1 -0
- package/esm/models/components/realtimespeechinputtextend.js +20 -0
- package/esm/models/components/realtimespeechinputtextend.js.map +1 -0
- package/esm/models/components/realtimespeechinputtextflush.d.ts +19 -0
- package/esm/models/components/realtimespeechinputtextflush.d.ts.map +1 -0
- package/esm/models/components/realtimespeechinputtextflush.js +22 -0
- package/esm/models/components/realtimespeechinputtextflush.js.map +1 -0
- package/esm/models/components/realtimespeechsession.d.ts +31 -0
- package/esm/models/components/realtimespeechsession.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsession.js +49 -0
- package/esm/models/components/realtimespeechsession.js.map +1 -0
- package/esm/models/components/realtimespeechsessioncreated.d.ts +20 -0
- package/esm/models/components/realtimespeechsessioncreated.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessioncreated.js +23 -0
- package/esm/models/components/realtimespeechsessioncreated.js.map +1 -0
- package/esm/models/components/realtimespeechsessionupdated.d.ts +20 -0
- package/esm/models/components/realtimespeechsessionupdated.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessionupdated.js +23 -0
- package/esm/models/components/realtimespeechsessionupdated.js.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.d.ts +20 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.js +23 -0
- package/esm/models/components/realtimespeechsessionupdatemessage.js.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.d.ts +42 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.d.ts.map +1 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.js +45 -0
- package/esm/models/components/realtimespeechsessionupdatepayload.js.map +1 -0
- package/esm/models/components/realtimespeechstreamingmode.d.ts +12 -0
- package/esm/models/components/realtimespeechstreamingmode.d.ts.map +1 -0
- package/esm/models/components/realtimespeechstreamingmode.js +13 -0
- package/esm/models/components/realtimespeechstreamingmode.js.map +1 -0
- package/esm/models/components/speechoutputformat.d.ts +2 -0
- package/esm/models/components/speechoutputformat.d.ts.map +1 -1
- package/esm/models/components/speechoutputformat.js +3 -1
- package/esm/models/components/speechoutputformat.js.map +1 -1
- package/esm/models/components/speechstreamaudiodelta.d.ts +8 -0
- package/esm/models/components/speechstreamaudiodelta.d.ts.map +1 -1
- package/esm/models/components/speechstreamaudiodelta.js +12 -0
- package/esm/models/components/speechstreamaudiodelta.js.map +1 -1
- package/esm/models/components/speechstreamdone.d.ts +10 -2
- package/esm/models/components/speechstreamdone.d.ts.map +1 -1
- package/esm/models/components/speechstreamdone.js +10 -2
- package/esm/models/components/speechstreamdone.js.map +1 -1
- package/esm/models/components/systemv2.d.ts +4 -0
- package/esm/models/components/systemv2.d.ts.map +1 -1
- package/esm/models/components/systemv2.js +2 -0
- package/esm/models/components/systemv2.js.map +1 -1
- package/esm/models/components/trigger.d.ts +24 -0
- package/esm/models/components/trigger.d.ts.map +1 -0
- package/esm/models/components/trigger.js +37 -0
- package/esm/models/components/trigger.js.map +1 -0
- package/esm/models/components/triggeraction.d.ts +12 -0
- package/esm/models/components/triggeraction.d.ts.map +1 -0
- package/esm/models/components/triggeraction.js +21 -0
- package/esm/models/components/triggeraction.js.map +1 -0
- package/esm/models/components/triggeractiontype.d.ts +14 -0
- package/esm/models/components/triggeractiontype.d.ts.map +1 -0
- package/esm/models/components/triggeractiontype.js +15 -0
- package/esm/models/components/triggeractiontype.js.map +1 -0
- package/esm/models/components/triggerevent.d.ts +19 -0
- package/esm/models/components/triggerevent.d.ts.map +1 -0
- package/esm/models/components/triggerevent.js +33 -0
- package/esm/models/components/triggerevent.js.map +1 -0
- package/esm/models/components/triggereventlist.d.ts +11 -0
- package/esm/models/components/triggereventlist.d.ts.map +1 -0
- package/esm/models/components/triggereventlist.js +14 -0
- package/esm/models/components/triggereventlist.js.map +1 -0
- package/esm/models/components/triggerhandler.d.ts +13 -0
- package/esm/models/components/triggerhandler.d.ts.map +1 -0
- package/esm/models/components/triggerhandler.js +14 -0
- package/esm/models/components/triggerhandler.js.map +1 -0
- package/esm/models/components/triggersownertype.d.ts +12 -0
- package/esm/models/components/triggersownertype.d.ts.map +1 -0
- package/esm/models/components/triggersownertype.js +13 -0
- package/esm/models/components/triggersownertype.js.map +1 -0
- package/esm/models/components/triggerstatusvalue.d.ts +12 -0
- package/esm/models/components/triggerstatusvalue.d.ts.map +1 -0
- package/esm/models/components/triggerstatusvalue.js +13 -0
- package/esm/models/components/triggerstatusvalue.js.map +1 -0
- package/esm/models/components/voicecreaterequest.d.ts +2 -3
- package/esm/models/components/voicecreaterequest.d.ts.map +1 -1
- package/esm/models/components/voicecreaterequest.js +2 -2
- package/esm/models/components/voicecreaterequest.js.map +1 -1
- package/esm/models/components/voiceupdaterequest.d.ts +2 -1
- package/esm/models/components/voiceupdaterequest.d.ts.map +1 -1
- package/esm/models/components/voiceupdaterequest.js +2 -1
- package/esm/models/components/voiceupdaterequest.js.map +1 -1
- package/esm/models/components/webhook.d.ts +35 -0
- package/esm/models/components/webhook.d.ts.map +1 -0
- package/esm/models/components/webhook.js +60 -0
- package/esm/models/components/webhook.js.map +1 -0
- package/esm/models/components/webhookprovider.d.ts +18 -0
- package/esm/models/components/webhookprovider.d.ts.map +1 -0
- package/esm/models/components/webhookprovider.js +19 -0
- package/esm/models/components/webhookprovider.js.map +1 -0
- package/esm/models/components/webhooksignatureencoding.d.ts +12 -0
- package/esm/models/components/webhooksignatureencoding.d.ts.map +1 -0
- package/esm/models/components/webhooksignatureencoding.js +13 -0
- package/esm/models/components/webhooksignatureencoding.js.map +1 -0
- package/esm/models/components/webhooksignaturehashalgorithm.d.ts +12 -0
- package/esm/models/components/webhooksignaturehashalgorithm.d.ts.map +1 -0
- package/esm/models/components/webhooksignaturehashalgorithm.js +13 -0
- package/esm/models/components/webhooksignaturehashalgorithm.js.map +1 -0
- package/esm/models/components/webhooksigningsecret.d.ts +13 -0
- package/esm/models/components/webhooksigningsecret.d.ts.map +1 -0
- package/esm/models/components/webhooksigningsecret.js +18 -0
- package/esm/models/components/webhooksigningsecret.js.map +1 -0
- package/esm/models/components/workflowsworkerspecupdate.d.ts +10 -0
- package/esm/models/components/workflowsworkerspecupdate.d.ts.map +1 -1
- package/esm/models/components/workflowsworkerspecupdate.js +4 -0
- package/esm/models/components/workflowsworkerspecupdate.js.map +1 -1
- package/esm/models/components/workflowtagsaddrequest.d.ts +15 -0
- package/esm/models/components/workflowtagsaddrequest.d.ts.map +1 -0
- package/esm/models/components/workflowtagsaddrequest.js +12 -0
- package/esm/models/components/workflowtagsaddrequest.js.map +1 -0
- package/esm/models/operations/addworkflowtagsv1workflowsworkflowidentifiertagspost.d.ts +15 -0
- package/esm/models/operations/addworkflowtagsv1workflowsworkflowidentifiertagspost.d.ts.map +1 -0
- package/esm/models/operations/addworkflowtagsv1workflowsworkflowidentifiertagspost.js +21 -0
- package/esm/models/operations/addworkflowtagsv1workflowsworkflowidentifiertagspost.js.map +1 -0
- package/esm/models/operations/deletetriggerv1triggerstriggeriddelete.d.ts +12 -0
- package/esm/models/operations/deletetriggerv1triggerstriggeriddelete.d.ts.map +1 -0
- package/esm/models/operations/deletetriggerv1triggerstriggeriddelete.js +17 -0
- package/esm/models/operations/deletetriggerv1triggerstriggeriddelete.js.map +1 -0
- package/esm/models/operations/deletewebhookv1webhookswebhookiddelete.d.ts +12 -0
- package/esm/models/operations/deletewebhookv1webhookswebhookiddelete.d.ts.map +1 -0
- package/esm/models/operations/deletewebhookv1webhookswebhookiddelete.js +17 -0
- package/esm/models/operations/deletewebhookv1webhookswebhookiddelete.js.map +1 -0
- package/esm/models/operations/getdeploymentarchivev1workflowsdeploymentsnamearchiveget.d.ts +12 -0
- package/esm/models/operations/getdeploymentarchivev1workflowsdeploymentsnamearchiveget.d.ts.map +1 -0
- package/esm/models/operations/getdeploymentarchivev1workflowsdeploymentsnamearchiveget.js +13 -0
- package/esm/models/operations/getdeploymentarchivev1workflowsdeploymentsnamearchiveget.js.map +1 -0
- package/esm/models/operations/gettriggerv1triggerstriggeridget.d.ts +12 -0
- package/esm/models/operations/gettriggerv1triggerstriggeridget.d.ts.map +1 -0
- package/esm/models/operations/gettriggerv1triggerstriggeridget.js +17 -0
- package/esm/models/operations/gettriggerv1triggerstriggeridget.js.map +1 -0
- package/esm/models/operations/getwebhooksigningsecretv1webhookswebhookidsigningsecretget.d.ts +12 -0
- package/esm/models/operations/getwebhooksigningsecretv1webhookswebhookidsigningsecretget.d.ts.map +1 -0
- package/esm/models/operations/getwebhooksigningsecretv1webhookswebhookidsigningsecretget.js +18 -0
- package/esm/models/operations/getwebhooksigningsecretv1webhookswebhookidsigningsecretget.js.map +1 -0
- package/esm/models/operations/getwebhookv1webhookswebhookidget.d.ts +12 -0
- package/esm/models/operations/getwebhookv1webhookswebhookidget.d.ts.map +1 -0
- package/esm/models/operations/getwebhookv1webhookswebhookidget.js +17 -0
- package/esm/models/operations/getwebhookv1webhookswebhookidget.js.map +1 -0
- package/esm/models/operations/index.d.ts +9 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +9 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/listtriggereventsv1triggerstriggerideventsget.d.ts +17 -0
- package/esm/models/operations/listtriggereventsv1triggerstriggerideventsget.d.ts.map +1 -0
- package/esm/models/operations/listtriggereventsv1triggerstriggerideventsget.js +18 -0
- package/esm/models/operations/listtriggereventsv1triggerstriggerideventsget.js.map +1 -0
- package/esm/models/operations/listtriggersv1triggersget.d.ts +26 -0
- package/esm/models/operations/listtriggersv1triggersget.d.ts.map +1 -0
- package/esm/models/operations/listtriggersv1triggersget.js +21 -0
- package/esm/models/operations/listtriggersv1triggersget.js.map +1 -0
- package/esm/models/operations/skillslist.d.ts +3 -0
- package/esm/models/operations/skillslist.d.ts.map +1 -1
- package/esm/models/operations/skillslist.js.map +1 -1
- package/esm/sdk/beta.d.ts +9 -0
- package/esm/sdk/beta.d.ts.map +1 -1
- package/esm/sdk/beta.js +15 -0
- package/esm/sdk/beta.js.map +1 -1
- package/esm/sdk/context.d.ts +7 -0
- package/esm/sdk/context.d.ts.map +1 -0
- package/esm/sdk/context.js +12 -0
- package/esm/sdk/context.js.map +1 -0
- package/esm/sdk/{managedindexes.d.ts → contextsearchindexes.d.ts} +2 -2
- package/esm/sdk/contextsearchindexes.d.ts.map +1 -0
- package/esm/sdk/{managedindexes.js → contextsearchindexes.js} +32 -32
- package/esm/sdk/contextsearchindexes.js.map +1 -0
- package/esm/sdk/deployments.d.ts +10 -0
- package/esm/sdk/deployments.d.ts.map +1 -1
- package/esm/sdk/deployments.js +13 -0
- package/esm/sdk/deployments.js.map +1 -1
- package/esm/sdk/rag.d.ts +2 -5
- package/esm/sdk/rag.d.ts.map +1 -1
- package/esm/sdk/rag.js +2 -7
- package/esm/sdk/rag.js.map +1 -1
- package/esm/sdk/{searchindexes.d.ts → ragsearchindexes.d.ts} +2 -2
- package/esm/sdk/ragsearchindexes.d.ts.map +1 -0
- package/esm/sdk/{searchindexes.js → ragsearchindexes.js} +2 -2
- package/esm/sdk/ragsearchindexes.js.map +1 -0
- package/esm/sdk/triggers.d.ts +26 -0
- package/esm/sdk/triggers.d.ts.map +1 -0
- package/esm/sdk/triggers.js +43 -0
- package/esm/sdk/triggers.js.map +1 -0
- package/esm/sdk/webhooks.d.ts +26 -0
- package/esm/sdk/webhooks.d.ts.map +1 -0
- package/esm/sdk/webhooks.js +43 -0
- package/esm/sdk/webhooks.js.map +1 -0
- package/esm/sdk/workflows.d.ts +4 -0
- package/esm/sdk/workflows.d.ts.map +1 -1
- package/esm/sdk/workflows.js +7 -0
- package/esm/sdk/workflows.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +11 -11
- package/packages/mistralai-azure/examples/chatComplete.example.ts +0 -1
- package/packages/mistralai-azure/src/core.ts +0 -1
- package/packages/mistralai-azure/src/funcs/chatComplete.ts +1 -2
- package/packages/mistralai-azure/src/funcs/chatStream.ts +1 -2
- package/packages/mistralai-azure/src/funcs/ocrProcess.ts +1 -2
- package/packages/mistralai-azure/src/hooks/hooks.ts +0 -1
- package/packages/mistralai-azure/src/hooks/index.ts +0 -1
- package/packages/mistralai-azure/src/hooks/types.ts +1 -1
- package/packages/mistralai-azure/src/index.ts +0 -1
- package/packages/mistralai-azure/src/lib/base64.ts +0 -1
- package/packages/mistralai-azure/src/lib/config.ts +7 -8
- package/packages/mistralai-azure/src/lib/encodings.ts +59 -25
- package/packages/mistralai-azure/src/lib/env.ts +7 -4
- package/packages/mistralai-azure/src/lib/event-streams.ts +46 -21
- package/packages/mistralai-azure/src/lib/files.ts +0 -1
- package/packages/mistralai-azure/src/lib/http.ts +3 -2
- package/packages/mistralai-azure/src/lib/logger.ts +0 -1
- package/packages/mistralai-azure/src/lib/matchers.ts +1 -2
- package/packages/mistralai-azure/src/lib/primitives.ts +16 -1
- package/packages/mistralai-azure/src/lib/retries.ts +8 -1
- package/packages/mistralai-azure/src/lib/schemas.ts +0 -1
- package/packages/mistralai-azure/src/lib/sdks.ts +54 -18
- package/packages/mistralai-azure/src/lib/security.ts +10 -6
- package/packages/mistralai-azure/src/lib/url.ts +0 -1
- package/packages/mistralai-azure/src/models/components/apikeyauth.ts +0 -1
- package/packages/mistralai-azure/src/models/components/assistantmessage.ts +0 -1
- package/packages/mistralai-azure/src/models/components/builtinconnectors.ts +1 -1
- package/packages/mistralai-azure/src/models/components/chatcompletionchoice.ts +12 -1
- package/packages/mistralai-azure/src/models/components/chatcompletionrequest.ts +28 -40
- package/packages/mistralai-azure/src/models/components/chatcompletionresponse.ts +0 -1
- package/packages/mistralai-azure/src/models/components/chatcompletionresponsechoicelogprobs.ts +35 -0
- package/packages/mistralai-azure/src/models/components/chatcompletionresponsetokenlogprobs.ts +42 -0
- package/packages/mistralai-azure/src/models/components/chatcompletionresponsetokenlogprobstopk.ts +56 -0
- package/packages/mistralai-azure/src/models/components/chatcompletionstreamrequest.ts +28 -40
- package/packages/mistralai-azure/src/models/components/completionchunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/completionevent.ts +2 -2
- package/packages/mistralai-azure/src/models/components/completionresponsestreamchoice.ts +12 -1
- package/packages/mistralai-azure/src/models/components/contentchunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/customconnector.ts +5 -1
- package/packages/mistralai-azure/src/models/components/deltamessage.ts +0 -1
- package/packages/mistralai-azure/src/models/components/documentlibrarytool.ts +0 -1
- package/packages/mistralai-azure/src/models/components/documenturlchunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/filechunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/function.ts +0 -1
- package/packages/mistralai-azure/src/models/components/functioncall.ts +0 -1
- package/packages/mistralai-azure/src/models/components/functionname.ts +0 -1
- package/packages/mistralai-azure/src/models/components/guardrailconfig.ts +0 -1
- package/packages/mistralai-azure/src/models/components/imagedetail.ts +0 -1
- package/packages/mistralai-azure/src/models/components/imagegenerationtool.ts +0 -1
- package/packages/mistralai-azure/src/models/components/imageurl.ts +0 -1
- package/packages/mistralai-azure/src/models/components/imageurlchunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/index.ts +17 -4
- package/packages/mistralai-azure/src/models/components/jsonschema.ts +0 -1
- package/packages/mistralai-azure/src/models/components/mistralpromptmode.ts +0 -1
- package/packages/mistralai-azure/src/models/components/moderationllmaction.ts +0 -1
- package/packages/mistralai-azure/src/models/components/moderationllmv1categorythresholds.ts +0 -1
- package/packages/mistralai-azure/src/models/components/moderationllmv1config.ts +0 -1
- package/packages/mistralai-azure/src/models/components/moderationllmv2categorythresholds.ts +0 -1
- package/packages/mistralai-azure/src/models/components/moderationllmv2config.ts +0 -1
- package/packages/mistralai-azure/src/models/components/oauth2tokenauth.ts +0 -1
- package/packages/mistralai-azure/src/models/components/ocrasidetextblock.ts +62 -0
- package/packages/mistralai-azure/src/models/components/ocrblockconfidencescores.ts +59 -0
- package/packages/mistralai-azure/src/models/components/ocrcaptionblock.ts +62 -0
- package/packages/mistralai-azure/src/models/components/ocrcodeblock.ts +60 -0
- package/packages/mistralai-azure/src/models/components/ocrconfidencescore.ts +0 -1
- package/packages/mistralai-azure/src/models/components/ocrequationblock.ts +62 -0
- package/packages/mistralai-azure/src/models/components/ocrfooterblock.ts +60 -0
- package/packages/mistralai-azure/src/models/components/ocrheaderblock.ts +60 -0
- package/packages/mistralai-azure/src/models/components/ocrimageblock.ts +66 -0
- package/packages/mistralai-azure/src/models/components/ocrimageobject.ts +0 -1
- package/packages/mistralai-azure/src/models/components/ocrlistblock.ts +60 -0
- package/packages/mistralai-azure/src/models/components/ocrpageconfidencescores.ts +8 -5
- package/packages/mistralai-azure/src/models/components/ocrpagedimensions.ts +0 -1
- package/packages/mistralai-azure/src/models/components/ocrpageobject.ts +117 -1
- package/packages/mistralai-azure/src/models/components/ocrreferencesblock.ts +62 -0
- package/packages/mistralai-azure/src/models/components/ocrrequest.ts +15 -2
- package/packages/mistralai-azure/src/models/components/ocrresponse.ts +0 -1
- package/packages/mistralai-azure/src/models/components/ocrsignatureblock.ts +65 -0
- package/packages/mistralai-azure/src/models/components/ocrtableblock.ts +66 -0
- package/packages/mistralai-azure/src/models/components/ocrtableobject.ts +0 -1
- package/packages/mistralai-azure/src/models/components/ocrtextblock.ts +60 -0
- package/packages/mistralai-azure/src/models/components/ocrtitleblock.ts +60 -0
- package/packages/mistralai-azure/src/models/components/ocrusageinfo.ts +0 -1
- package/packages/mistralai-azure/src/models/components/prediction.ts +0 -1
- package/packages/mistralai-azure/src/models/components/reasoningeffort.ts +5 -1
- package/packages/mistralai-azure/src/models/components/referencechunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/responseformat.ts +0 -1
- package/packages/mistralai-azure/src/models/components/responseformats.ts +0 -1
- package/packages/mistralai-azure/src/models/components/security.ts +0 -1
- package/packages/mistralai-azure/src/models/components/systemmessage.ts +0 -1
- package/packages/mistralai-azure/src/models/components/systemmessagecontentchunks.ts +0 -1
- package/packages/mistralai-azure/src/models/components/textchunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/thinkchunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/tool.ts +0 -1
- package/packages/mistralai-azure/src/models/components/toolcall.ts +3 -4
- package/packages/mistralai-azure/src/models/components/toolchoice.ts +2 -3
- package/packages/mistralai-azure/src/models/components/toolchoiceenum.ts +0 -1
- package/packages/mistralai-azure/src/models/components/toolconfiguration.ts +0 -1
- package/packages/mistralai-azure/src/models/components/toolmessage.ts +0 -1
- package/packages/mistralai-azure/src/models/components/toolreferencechunk.ts +0 -1
- package/packages/mistralai-azure/src/models/components/usageinfo.ts +0 -1
- package/packages/mistralai-azure/src/models/components/usermessage.ts +0 -1
- package/packages/mistralai-azure/src/models/components/validationerror.ts +0 -1
- package/packages/mistralai-azure/src/models/errors/httpclienterrors.ts +0 -1
- package/packages/mistralai-azure/src/models/errors/httpvalidationerror.ts +0 -1
- package/packages/mistralai-azure/src/models/errors/index.ts +0 -1
- package/packages/mistralai-azure/src/models/errors/mistralazureerror.ts +0 -1
- package/packages/mistralai-azure/src/models/errors/responsevalidationerror.ts +0 -1
- package/packages/mistralai-azure/src/models/errors/sdkerror.ts +0 -1
- package/packages/mistralai-azure/src/models/errors/sdkvalidationerror.ts +0 -1
- package/packages/mistralai-azure/src/sdk/chat.ts +0 -1
- package/packages/mistralai-azure/src/sdk/index.ts +0 -1
- package/packages/mistralai-azure/src/sdk/ocr.ts +0 -1
- package/packages/mistralai-azure/src/types/async.ts +0 -1
- package/packages/mistralai-azure/src/types/blobs.ts +0 -1
- package/packages/mistralai-azure/src/types/constdatetime.ts +0 -1
- package/packages/mistralai-azure/src/types/discriminatedUnion.ts +0 -1
- package/packages/mistralai-azure/src/types/enums.ts +0 -1
- package/packages/mistralai-azure/src/types/fp.ts +0 -1
- package/packages/mistralai-azure/src/types/index.ts +0 -1
- package/packages/mistralai-azure/src/types/operations.ts +0 -1
- package/packages/mistralai-azure/src/types/rfcdate.ts +0 -1
- package/packages/mistralai-azure/src/types/smartUnion.ts +0 -1
- package/packages/mistralai-azure/src/types/streams.ts +0 -1
- package/packages/mistralai-azure/src/types/unrecognized.ts +0 -1
- package/packages/mistralai-gcp/examples/chatComplete.example.ts +0 -1
- package/packages/mistralai-gcp/src/core.ts +0 -1
- package/packages/mistralai-gcp/src/funcs/chatComplete.ts +1 -2
- package/packages/mistralai-gcp/src/funcs/chatStream.ts +1 -2
- package/packages/mistralai-gcp/src/funcs/fimComplete.ts +1 -2
- package/packages/mistralai-gcp/src/funcs/fimStream.ts +1 -2
- package/packages/mistralai-gcp/src/hooks/hooks.ts +0 -1
- package/packages/mistralai-gcp/src/hooks/index.ts +0 -1
- package/packages/mistralai-gcp/src/hooks/types.ts +1 -1
- package/packages/mistralai-gcp/src/index.ts +0 -1
- package/packages/mistralai-gcp/src/lib/base64.ts +0 -1
- package/packages/mistralai-gcp/src/lib/config.ts +7 -8
- package/packages/mistralai-gcp/src/lib/encodings.ts +59 -25
- package/packages/mistralai-gcp/src/lib/event-streams.ts +46 -21
- package/packages/mistralai-gcp/src/lib/files.ts +0 -1
- package/packages/mistralai-gcp/src/lib/http.ts +3 -2
- package/packages/mistralai-gcp/src/lib/logger.ts +0 -1
- package/packages/mistralai-gcp/src/lib/matchers.ts +1 -2
- package/packages/mistralai-gcp/src/lib/primitives.ts +16 -1
- package/packages/mistralai-gcp/src/lib/retries.ts +8 -1
- package/packages/mistralai-gcp/src/lib/schemas.ts +0 -1
- package/packages/mistralai-gcp/src/lib/sdks.ts +54 -18
- package/packages/mistralai-gcp/src/lib/security.ts +10 -6
- package/packages/mistralai-gcp/src/lib/url.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/apikeyauth.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/assistantmessage.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/builtinconnectors.ts +1 -1
- package/packages/mistralai-gcp/src/models/components/chatcompletionchoice.ts +12 -1
- package/packages/mistralai-gcp/src/models/components/chatcompletionrequest.ts +28 -40
- package/packages/mistralai-gcp/src/models/components/chatcompletionresponse.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/chatcompletionresponsechoicelogprobs.ts +35 -0
- package/packages/mistralai-gcp/src/models/components/chatcompletionresponsetokenlogprobs.ts +42 -0
- package/packages/mistralai-gcp/src/models/components/chatcompletionresponsetokenlogprobstopk.ts +56 -0
- package/packages/mistralai-gcp/src/models/components/chatcompletionstreamrequest.ts +28 -40
- package/packages/mistralai-gcp/src/models/components/completionchunk.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/completionevent.ts +2 -2
- package/packages/mistralai-gcp/src/models/components/completionresponsestreamchoice.ts +12 -1
- package/packages/mistralai-gcp/src/models/components/contentchunk.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/customconnector.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/deltamessage.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/documentlibrarytool.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/fimcompletionrequest.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/fimcompletionresponse.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/fimcompletionstreamrequest.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/function.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/functioncall.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/functionname.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/guardrailconfig.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/imagedetail.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/imagegenerationtool.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/imageurl.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/imageurlchunk.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/index.ts +3 -4
- package/packages/mistralai-gcp/src/models/components/jsonschema.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/mistralpromptmode.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/moderationllmaction.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/moderationllmv1categorythresholds.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/moderationllmv1config.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/moderationllmv2categorythresholds.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/moderationllmv2config.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/oauth2tokenauth.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/prediction.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/reasoningeffort.ts +5 -1
- package/packages/mistralai-gcp/src/models/components/referencechunk.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/responseformat.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/responseformats.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/security.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/systemmessage.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/systemmessagecontentchunks.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/textchunk.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/thinkchunk.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/tool.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/toolcall.ts +3 -4
- package/packages/mistralai-gcp/src/models/components/toolchoice.ts +2 -3
- package/packages/mistralai-gcp/src/models/components/toolchoiceenum.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/toolconfiguration.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/toolmessage.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/toolreferencechunk.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/usageinfo.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/usermessage.ts +0 -1
- package/packages/mistralai-gcp/src/models/components/validationerror.ts +0 -1
- package/packages/mistralai-gcp/src/models/errors/httpclienterrors.ts +0 -1
- package/packages/mistralai-gcp/src/models/errors/httpvalidationerror.ts +0 -1
- package/packages/mistralai-gcp/src/models/errors/index.ts +0 -1
- package/packages/mistralai-gcp/src/models/errors/mistralgcperror.ts +0 -1
- package/packages/mistralai-gcp/src/models/errors/responsevalidationerror.ts +0 -1
- package/packages/mistralai-gcp/src/models/errors/sdkerror.ts +0 -1
- package/packages/mistralai-gcp/src/models/errors/sdkvalidationerror.ts +0 -1
- package/packages/mistralai-gcp/src/sdk/chat.ts +0 -1
- package/packages/mistralai-gcp/src/sdk/fim.ts +0 -1
- package/packages/mistralai-gcp/src/sdk/index.ts +0 -1
- package/packages/mistralai-gcp/src/types/async.ts +0 -1
- package/packages/mistralai-gcp/src/types/blobs.ts +0 -1
- package/packages/mistralai-gcp/src/types/constdatetime.ts +0 -1
- package/packages/mistralai-gcp/src/types/discriminatedUnion.ts +0 -1
- package/packages/mistralai-gcp/src/types/enums.ts +0 -1
- package/packages/mistralai-gcp/src/types/fp.ts +0 -1
- package/packages/mistralai-gcp/src/types/index.ts +0 -1
- package/packages/mistralai-gcp/src/types/operations.ts +0 -1
- package/packages/mistralai-gcp/src/types/rfcdate.ts +0 -1
- package/packages/mistralai-gcp/src/types/smartUnion.ts +0 -1
- package/packages/mistralai-gcp/src/types/streams.ts +0 -1
- package/packages/mistralai-gcp/src/types/unrecognized.ts +0 -1
- package/src/extra/realtime/connection.ts +88 -13
- package/src/extra/realtime/errors.ts +32 -0
- package/src/extra/realtime/index.ts +42 -1
- package/src/extra/realtime/speech.ts +646 -0
- package/src/extra/realtime/transcription.ts +22 -9
- package/src/extra/workflows/encoding/payload-encoder.ts +2 -1
- package/src/extra/workflows/encoding/python-json.ts +34 -8
- package/src/funcs/{betaRagManagedIndexesCreate.ts → betaContextSearchIndexesCreate.ts} +2 -2
- package/src/funcs/{betaRagManagedIndexesDelete.ts → betaContextSearchIndexesDelete.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesDeleteDocuments.ts → betaContextSearchIndexesDeleteDocuments.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesGenerateIndexSummary.ts → betaContextSearchIndexesGenerateIndexSummary.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesGet.ts → betaContextSearchIndexesGet.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesGetChunk.ts → betaContextSearchIndexesGetChunk.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesGetIndexSummary.ts → betaContextSearchIndexesGetIndexSummary.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesGrep.ts → betaContextSearchIndexesGrep.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesIngestDocuments.ts → betaContextSearchIndexesIngestDocuments.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesList.ts → betaContextSearchIndexesList.ts} +2 -2
- package/src/funcs/{betaRagManagedIndexesNavigate.ts → betaContextSearchIndexesNavigate.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesRead.ts → betaContextSearchIndexesRead.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesSearch.ts → betaContextSearchIndexesSearch.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesSetIndexSummary.ts → betaContextSearchIndexesSetIndexSummary.ts} +1 -1
- package/src/funcs/{betaRagManagedIndexesUpdate.ts → betaContextSearchIndexesUpdate.ts} +1 -1
- package/src/funcs/betaTriggersCreate.ts +168 -0
- package/src/funcs/betaTriggersDelete.ts +176 -0
- package/src/funcs/betaTriggersGet.ts +177 -0
- package/src/funcs/betaTriggersList.ts +178 -0
- package/src/funcs/betaTriggersListEvents.ts +182 -0
- package/src/funcs/betaWebhooksCreate.ts +168 -0
- package/src/funcs/betaWebhooksDelete.ts +176 -0
- package/src/funcs/betaWebhooksGet.ts +177 -0
- package/src/funcs/betaWebhooksGetSigningSecret.ts +182 -0
- package/src/funcs/betaWebhooksList.ts +142 -0
- package/src/funcs/workflowsAddWorkflowTags.ts +186 -0
- package/src/funcs/workflowsDeploymentsGetDeploymentArchive.ts +188 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/connectionpreference.ts +15 -5
- package/src/models/components/connectoropenapispec.ts +37 -0
- package/src/models/components/createtrigger.ts +69 -0
- package/src/models/components/createtriggeraction.ts +45 -0
- package/src/models/components/createwebhook.ts +121 -0
- package/src/models/components/deploymentarchiveresponse.ts +47 -0
- package/src/models/components/deploymentworkerspecinput.ts +20 -3
- package/src/models/components/deploymentworkerspecresponse.ts +12 -0
- package/src/models/components/getlog.ts +3 -0
- package/src/models/components/getspan.ts +3 -0
- package/src/models/components/getspanevaluation.ts +3 -0
- package/src/models/components/gettrace.ts +3 -0
- package/src/models/components/httpconnector.ts +10 -0
- package/src/models/components/index.ts +33 -5
- package/src/models/components/observabilityerrorcode.ts +2 -0
- package/src/models/components/openapifilesource.ts +35 -0
- package/src/models/components/openapispecsource.ts +42 -0
- package/src/models/components/openapiurlsource.ts +35 -0
- package/src/models/components/realtimespeecherror.ts +59 -0
- package/src/models/components/realtimespeecherrordetail.ts +100 -0
- package/src/models/components/realtimespeechinputtextappend.ts +55 -0
- package/src/models/components/realtimespeechinputtextend.ts +49 -0
- package/src/models/components/realtimespeechinputtextflush.ts +55 -0
- package/src/models/components/realtimespeechsession.ts +98 -0
- package/src/models/components/realtimespeechsessioncreated.ts +61 -0
- package/src/models/components/realtimespeechsessionupdated.ts +61 -0
- package/src/models/components/realtimespeechsessionupdatemessage.ts +62 -0
- package/src/models/components/realtimespeechsessionupdatepayload.ts +108 -0
- package/src/models/components/realtimespeechstreamingmode.ts +23 -0
- package/src/models/components/speechoutputformat.ts +5 -1
- package/src/models/components/speechstreamaudiodelta.ts +25 -0
- package/src/models/components/speechstreamdone.ts +28 -5
- package/src/models/components/systemv2.ts +4 -0
- package/src/models/components/trigger.ts +67 -0
- package/src/models/components/triggeraction.ts +39 -0
- package/src/models/components/triggeractiontype.ts +26 -0
- package/src/models/components/triggerevent.ts +62 -0
- package/src/models/components/triggereventlist.ts +31 -0
- package/src/models/components/triggerhandler.ts +21 -0
- package/src/models/components/triggersownertype.ts +24 -0
- package/src/models/components/triggerstatusvalue.ts +21 -0
- package/src/models/components/voicecreaterequest.ts +3 -5
- package/src/models/components/voiceupdaterequest.ts +3 -2
- package/src/models/components/webhook.ts +111 -0
- package/src/models/components/webhookprovider.ts +30 -0
- package/src/models/components/webhooksignatureencoding.ts +26 -0
- package/src/models/components/webhooksignaturehashalgorithm.ts +26 -0
- package/src/models/components/webhooksigningsecret.ts +38 -0
- package/src/models/components/workflowsworkerspecupdate.ts +14 -0
- package/src/models/components/workflowtagsaddrequest.ts +33 -0
- package/src/models/operations/addworkflowtagsv1workflowsworkflowidentifiertagspost.ts +44 -0
- package/src/models/operations/deletetriggerv1triggerstriggeriddelete.ts +39 -0
- package/src/models/operations/deletewebhookv1webhookswebhookiddelete.ts +39 -0
- package/src/models/operations/getdeploymentarchivev1workflowsdeploymentsnamearchiveget.ts +34 -0
- package/src/models/operations/gettriggerv1triggerstriggeridget.ts +38 -0
- package/src/models/operations/getwebhooksigningsecretv1webhookswebhookidsigningsecretget.ts +40 -0
- package/src/models/operations/getwebhookv1webhookswebhookidget.ts +38 -0
- package/src/models/operations/index.ts +9 -0
- package/src/models/operations/listtriggereventsv1triggerstriggerideventsget.ts +45 -0
- package/src/models/operations/listtriggersv1triggersget.ts +54 -0
- package/src/models/operations/skillslist.ts +3 -0
- package/src/sdk/beta.ts +18 -0
- package/src/sdk/context.ts +13 -0
- package/src/sdk/{managedindexes.ts → contextsearchindexes.ts} +31 -31
- package/src/sdk/deployments.ts +22 -0
- package/src/sdk/rag.ts +4 -10
- package/src/sdk/{searchindexes.ts → ragsearchindexes.ts} +1 -1
- package/src/sdk/triggers.ts +85 -0
- package/src/sdk/webhooks.ts +84 -0
- package/src/sdk/workflows.ts +16 -0
- package/tests/extra/realtime-speech-ws.test.ts +193 -0
- package/tests/extra/realtime-speech.test.ts +532 -0
- package/tests/extra/realtime.test.ts +217 -0
- package/tests/extra/workflow-encryption.test.ts +2 -2
- package/tests/hooks/workflow-encoding.test.ts +1 -1
- package/esm/funcs/betaRagManagedIndexesCreate.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesCreate.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesDelete.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesDeleteDocuments.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesDeleteDocuments.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGenerateIndexSummary.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGenerateIndexSummary.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGet.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGet.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGetChunk.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGetChunk.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGetIndexSummary.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGetIndexSummary.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGrep.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesGrep.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesIngestDocuments.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesIngestDocuments.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesList.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesList.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesNavigate.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesNavigate.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesRead.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesRead.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesSearch.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesSearch.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesSetIndexSummary.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesSetIndexSummary.js.map +0 -1
- package/esm/funcs/betaRagManagedIndexesUpdate.d.ts.map +0 -1
- package/esm/funcs/betaRagManagedIndexesUpdate.js.map +0 -1
- package/esm/models/components/completiontokensdetails.d.ts +0 -19
- package/esm/models/components/completiontokensdetails.d.ts.map +0 -1
- package/esm/models/components/completiontokensdetails.js +0 -18
- package/esm/models/components/completiontokensdetails.js.map +0 -1
- package/esm/models/components/messagetokens.d.ts +0 -18
- package/esm/models/components/messagetokens.d.ts.map +0 -1
- package/esm/models/components/messagetokens.js +0 -26
- package/esm/models/components/messagetokens.js.map +0 -1
- package/esm/models/components/prompttokensdetails.d.ts +0 -16
- package/esm/models/components/prompttokensdetails.d.ts.map +0 -1
- package/esm/models/components/prompttokensdetails.js +0 -22
- package/esm/models/components/prompttokensdetails.js.map +0 -1
- package/esm/models/components/roles.d.ts +0 -12
- package/esm/models/components/roles.d.ts.map +0 -1
- package/esm/models/components/roles.js +0 -14
- package/esm/models/components/roles.js.map +0 -1
- package/esm/models/components/usageinfodollardefs.d.ts +0 -24
- package/esm/models/components/usageinfodollardefs.d.ts.map +0 -1
- package/esm/models/components/usageinfodollardefs.js +0 -41
- package/esm/models/components/usageinfodollardefs.js.map +0 -1
- package/esm/sdk/managedindexes.d.ts.map +0 -1
- package/esm/sdk/managedindexes.js.map +0 -1
- package/esm/sdk/searchindexes.d.ts.map +0 -1
- package/esm/sdk/searchindexes.js.map +0 -1
- package/packages/mistralai-azure/src/lib/dlv.ts +0 -54
- package/packages/mistralai-azure/src/lib/is-plain-object.ts +0 -44
- package/packages/mistralai-azure/src/models/components/codeinterpretertool.ts +0 -44
- package/packages/mistralai-azure/src/models/components/websearchpremiumtool.ts +0 -44
- package/packages/mistralai-azure/src/models/components/websearchtool.ts +0 -40
- package/packages/mistralai-gcp/src/lib/dlv.ts +0 -54
- package/packages/mistralai-gcp/src/lib/is-plain-object.ts +0 -44
- package/packages/mistralai-gcp/src/models/components/codeinterpretertool.ts +0 -44
- package/packages/mistralai-gcp/src/models/components/websearchpremiumtool.ts +0 -44
- package/packages/mistralai-gcp/src/models/components/websearchtool.ts +0 -40
- package/src/models/components/completiontokensdetails.ts +0 -44
- package/src/models/components/messagetokens.ts +0 -47
- package/src/models/components/prompttokensdetails.ts +0 -44
- package/src/models/components/roles.ts +0 -19
- package/src/models/components/usageinfodollardefs.ts +0 -76
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import type WebSocket from "ws";
|
|
2
|
+
import * as wsMock from "ws";
|
|
3
|
+
import { RealtimeSpeechSessionUpdatePayload$inboundSchema } from "../../src/models/components/realtimespeechsessionupdatepayload.js";
|
|
4
|
+
import { RealtimeTranscriptionSessionUpdatePayload$inboundSchema } from "../../src/models/components/realtimetranscriptionsessionupdatepayload.js";
|
|
5
|
+
|
|
6
|
+
vi.mock("ws", () => {
|
|
7
|
+
class MockWebSocket {
|
|
8
|
+
readyState = 1;
|
|
9
|
+
url: string | undefined;
|
|
10
|
+
options: unknown;
|
|
11
|
+
sent: string[] = [];
|
|
12
|
+
closeArgs: { code?: number; reason?: string } | null = null;
|
|
13
|
+
failTextSendWith: Error | undefined;
|
|
14
|
+
private listeners = new Map<string, Set<(event: any) => void>>();
|
|
15
|
+
|
|
16
|
+
addEventListener(event: string, handler: (event: any) => void): void {
|
|
17
|
+
if (!this.listeners.has(event)) {
|
|
18
|
+
this.listeners.set(event, new Set());
|
|
19
|
+
}
|
|
20
|
+
this.listeners.get(event)?.add(handler);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
removeEventListener(event: string, handler: (event: any) => void): void {
|
|
24
|
+
this.listeners.get(event)?.delete(handler);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
send(data: string, cb?: (err?: Error) => void): void {
|
|
28
|
+
if (this.failTextSendWith && JSON.parse(data).type === "input_text.append") {
|
|
29
|
+
cb?.(this.failTextSendWith);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.sent.push(data);
|
|
33
|
+
cb?.();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
close(code?: number, reason?: string): void {
|
|
37
|
+
if (this.readyState === 3) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.closeArgs = { code, reason };
|
|
41
|
+
this.readyState = 3;
|
|
42
|
+
this.emit("close", { code, reason });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
serverClose(code: number, reason: string): void {
|
|
46
|
+
this.readyState = 3;
|
|
47
|
+
this.emit("close", { code, reason });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
emit(event: string, data: any): void {
|
|
51
|
+
for (const handler of [...(this.listeners.get(event) ?? [])]) {
|
|
52
|
+
handler(data);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
emitMessage(payload: unknown): void {
|
|
57
|
+
const data = typeof payload === "string" ? payload : JSON.stringify(payload);
|
|
58
|
+
this.emit("message", { data });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
let lastSocket: MockWebSocket | undefined;
|
|
63
|
+
|
|
64
|
+
class WebSocket extends MockWebSocket {
|
|
65
|
+
constructor(url?: string, options?: unknown) {
|
|
66
|
+
super();
|
|
67
|
+
this.url = url;
|
|
68
|
+
this.options = options;
|
|
69
|
+
lastSocket = this;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
default: WebSocket,
|
|
75
|
+
MockWebSocket,
|
|
76
|
+
getLastSocket: () => lastSocket,
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
type MockWebSocketInstance = {
|
|
81
|
+
readyState: number;
|
|
82
|
+
url: string | undefined;
|
|
83
|
+
options: any;
|
|
84
|
+
sent: string[];
|
|
85
|
+
closeArgs: { code?: number; reason?: string } | null;
|
|
86
|
+
failTextSendWith: Error | undefined;
|
|
87
|
+
send(data: string, cb?: (err?: Error) => void): void;
|
|
88
|
+
close(code?: number, reason?: string): void;
|
|
89
|
+
serverClose(code: number, reason: string): void;
|
|
90
|
+
emitMessage(payload: unknown): void;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
type Realtime = typeof import("../../src/extra/realtime/index.js");
|
|
94
|
+
type Speech = typeof import("../../src/extra/realtime/speech.js");
|
|
95
|
+
let realtime: Realtime;
|
|
96
|
+
let speech: Speech;
|
|
97
|
+
|
|
98
|
+
beforeAll(async () => {
|
|
99
|
+
realtime = await import("../../src/extra/realtime/index.js");
|
|
100
|
+
speech = await import("../../src/extra/realtime/speech.js");
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const MODEL = "voxtral-mini-tts-3";
|
|
104
|
+
const SESSION = {
|
|
105
|
+
request_id: "ws-123",
|
|
106
|
+
model: MODEL,
|
|
107
|
+
voice: "voice_447",
|
|
108
|
+
is_ref_audio: false,
|
|
109
|
+
streaming_mode: "responsive",
|
|
110
|
+
response_format: "wav",
|
|
111
|
+
expressiveness: 2.0,
|
|
112
|
+
};
|
|
113
|
+
const SESSION_CREATED = { type: "session.created", session: SESSION };
|
|
114
|
+
const AUDIO_DELTA = { type: "speech.audio.delta", audio_data: "AAAAAA==" };
|
|
115
|
+
const AUDIO_DONE = {
|
|
116
|
+
type: "speech.audio.done",
|
|
117
|
+
usage: { prompt_tokens: 3, completion_tokens: 10, total_tokens: 13 },
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
function mockModule(): {
|
|
121
|
+
MockWebSocket: new () => MockWebSocketInstance;
|
|
122
|
+
getLastSocket: () => MockWebSocketInstance | undefined;
|
|
123
|
+
} {
|
|
124
|
+
return wsMock as unknown as ReturnType<typeof mockModule>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function sent(ws: MockWebSocketInstance): unknown[] {
|
|
128
|
+
return ws.sent.map((message) => JSON.parse(message));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function newConnection(): {
|
|
132
|
+
ws: MockWebSocketInstance;
|
|
133
|
+
connection: InstanceType<Realtime["RealtimeSpeechConnection"]>;
|
|
134
|
+
} {
|
|
135
|
+
const ws = new (mockModule().MockWebSocket)();
|
|
136
|
+
const created = speech.parseRealtimeSpeechEvent(SESSION_CREATED);
|
|
137
|
+
if (speech.isUnknownRealtimeSpeechEvent(created) || !("session" in created)) {
|
|
138
|
+
throw new Error("bad fixture");
|
|
139
|
+
}
|
|
140
|
+
const connection = new realtime.RealtimeSpeechConnection(
|
|
141
|
+
ws as unknown as WebSocket,
|
|
142
|
+
created.session,
|
|
143
|
+
);
|
|
144
|
+
return { ws, connection };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function client() {
|
|
148
|
+
return new realtime.RealtimeSpeech({ apiKey: "test", serverURL: "https://example.com" });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
async function nextSocket(previous?: MockWebSocketInstance): Promise<MockWebSocketInstance> {
|
|
152
|
+
for (let i = 0; i < 20; i += 1) {
|
|
153
|
+
const ws = mockModule().getLastSocket();
|
|
154
|
+
if (ws && ws !== previous) {
|
|
155
|
+
await tick();
|
|
156
|
+
return ws;
|
|
157
|
+
}
|
|
158
|
+
await tick();
|
|
159
|
+
}
|
|
160
|
+
throw new Error("WebSocket was not created");
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function tick(): Promise<void> {
|
|
164
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function connectWith(
|
|
168
|
+
options: Parameters<InstanceType<Realtime["RealtimeSpeech"]>["connect"]>[1] = {},
|
|
169
|
+
) {
|
|
170
|
+
const previous = mockModule().getLastSocket();
|
|
171
|
+
const connectPromise = client().connect(MODEL, options);
|
|
172
|
+
const ws = await nextSocket(previous);
|
|
173
|
+
ws.emitMessage(SESSION_CREATED);
|
|
174
|
+
return { ws, connection: await connectPromise };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async function* textOf(...chunks: string[]): AsyncIterable<string> {
|
|
178
|
+
for (const chunk of chunks) {
|
|
179
|
+
yield chunk;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
describe("parseRealtimeSpeechEvent", () => {
|
|
184
|
+
it.each([
|
|
185
|
+
[SESSION_CREATED, "session.created"],
|
|
186
|
+
[{ type: "session.updated", session: SESSION }, "session.updated"],
|
|
187
|
+
[{ type: "error", error: { message: "bad", code: 400 } }, "error"],
|
|
188
|
+
[AUDIO_DELTA, "speech.audio.delta"],
|
|
189
|
+
[AUDIO_DONE, "speech.audio.done"],
|
|
190
|
+
])("parses %j into a typed event", (payload, type) => {
|
|
191
|
+
const event = speech.parseRealtimeSpeechEvent(payload);
|
|
192
|
+
expect(speech.isUnknownRealtimeSpeechEvent(event)).toBe(false);
|
|
193
|
+
expect(event.type).toBe(type);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it.each([
|
|
197
|
+
[{ type: "speech.surprise" }, "speech.surprise"],
|
|
198
|
+
[{ type: "constructor" }, "constructor"],
|
|
199
|
+
[{ type: "toString" }, "toString"],
|
|
200
|
+
[{ type: "speech.audio.delta" }, "speech.audio.delta"],
|
|
201
|
+
[["not", "an", "object"], "unknown"],
|
|
202
|
+
[{ no: "type" }, "unknown"],
|
|
203
|
+
])("returns an unknown event for %j", (payload, type) => {
|
|
204
|
+
const event = speech.parseRealtimeSpeechEvent(payload);
|
|
205
|
+
expect(speech.isUnknownRealtimeSpeechEvent(event)).toBe(true);
|
|
206
|
+
expect(event).toMatchObject({ type, raw: payload });
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it("decodes audio deltas", () => {
|
|
210
|
+
const event = speech.parseRealtimeSpeechEvent(AUDIO_DELTA);
|
|
211
|
+
if (event.type !== "speech.audio.delta" || !("audioData" in event)) {
|
|
212
|
+
throw new Error("expected an audio delta");
|
|
213
|
+
}
|
|
214
|
+
expect(realtime.audioBytes(event)).toEqual(new Uint8Array([0, 0, 0, 0]));
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
describe("RealtimeSpeechConnection", () => {
|
|
219
|
+
it("sends text, flush and end messages", async () => {
|
|
220
|
+
const { ws, connection } = newConnection();
|
|
221
|
+
|
|
222
|
+
await connection.sendText("Hello, ");
|
|
223
|
+
await connection.flush();
|
|
224
|
+
await connection.flush("last words.");
|
|
225
|
+
await connection.end();
|
|
226
|
+
|
|
227
|
+
expect(sent(ws)).toEqual([
|
|
228
|
+
{ type: "input_text.append", text: "Hello, " },
|
|
229
|
+
{ type: "input_text.flush" },
|
|
230
|
+
{ type: "input_text.flush", text: "last words." },
|
|
231
|
+
{ type: "input_text.end" },
|
|
232
|
+
]);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it("sends only the set session fields, in snake_case", async () => {
|
|
236
|
+
const { ws, connection } = newConnection();
|
|
237
|
+
|
|
238
|
+
await connection.updateSession({
|
|
239
|
+
voiceId: "my-voice",
|
|
240
|
+
responseFormat: "pcm",
|
|
241
|
+
streamingMode: "long_form",
|
|
242
|
+
expressiveness: 1.5,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
expect(sent(ws)).toEqual([
|
|
246
|
+
{
|
|
247
|
+
type: "session.update",
|
|
248
|
+
session: {
|
|
249
|
+
voice: "my-voice",
|
|
250
|
+
response_format: "pcm",
|
|
251
|
+
streaming_mode: "long_form",
|
|
252
|
+
expressiveness: 1.5,
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
]);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it("rejects an empty update", async () => {
|
|
259
|
+
const { ws, connection } = newConnection();
|
|
260
|
+
|
|
261
|
+
await expect(connection.updateSession({})).rejects.toThrow(
|
|
262
|
+
"At least one session field must be provided",
|
|
263
|
+
);
|
|
264
|
+
expect(ws.sent).toEqual([]);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("ends iteration quietly when the client closes with a custom code", async () => {
|
|
268
|
+
const { connection } = newConnection();
|
|
269
|
+
const iterator = connection[Symbol.asyncIterator]();
|
|
270
|
+
|
|
271
|
+
const next = iterator.next();
|
|
272
|
+
await connection.close(4000, "stop");
|
|
273
|
+
|
|
274
|
+
await expect(next).resolves.toMatchObject({ done: true });
|
|
275
|
+
await expect(connection[Symbol.asyncIterator]().next()).resolves.toMatchObject({ done: true });
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it("rejects a second concurrent iterator", async () => {
|
|
279
|
+
const { ws, connection } = newConnection();
|
|
280
|
+
const first = connection.events();
|
|
281
|
+
const pending = first.next();
|
|
282
|
+
|
|
283
|
+
await expect(connection.events().next()).rejects.toThrow("already being iterated");
|
|
284
|
+
|
|
285
|
+
ws.close();
|
|
286
|
+
await pending;
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
it("keeps messages that arrive before iteration starts", async () => {
|
|
290
|
+
const { ws, connection } = newConnection();
|
|
291
|
+
ws.emitMessage({ type: "error", error: { message: "bad expressiveness", code: 3051 } });
|
|
292
|
+
ws.serverClose(1000, "");
|
|
293
|
+
|
|
294
|
+
const events = [];
|
|
295
|
+
for await (const event of connection) {
|
|
296
|
+
events.push(event);
|
|
297
|
+
}
|
|
298
|
+
expect(events.map((event) => event.type)).toEqual(["error"]);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
it("tracks session.updated events", async () => {
|
|
302
|
+
const { ws, connection } = newConnection();
|
|
303
|
+
const iterator = connection[Symbol.asyncIterator]();
|
|
304
|
+
|
|
305
|
+
const next = iterator.next();
|
|
306
|
+
ws.emitMessage({ type: "session.updated", session: { ...SESSION, voice: "voice_478" } });
|
|
307
|
+
expect((await next).value.type).toBe("session.updated");
|
|
308
|
+
expect(connection.session.voice).toBe("voice_478");
|
|
309
|
+
|
|
310
|
+
const done = iterator.next();
|
|
311
|
+
ws.close();
|
|
312
|
+
await done;
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
describe("RealtimeSpeech.connect", () => {
|
|
317
|
+
it("opens the realtime speech URL and sends one session.update", async () => {
|
|
318
|
+
const { ws, connection } = await connectWith({ voiceId: "my-voice", responseFormat: "pcm" });
|
|
319
|
+
|
|
320
|
+
expect(ws.url).toBe("https://example.com/v1/audio/speech/realtime?model=voxtral-mini-tts-3");
|
|
321
|
+
expect(ws.options.headers["Authorization"]).toBe("Bearer test");
|
|
322
|
+
expect(sent(ws)).toEqual([
|
|
323
|
+
{ type: "session.update", session: { voice: "my-voice", response_format: "pcm" } },
|
|
324
|
+
]);
|
|
325
|
+
expect(connection.requestId).toBe("ws-123");
|
|
326
|
+
await connection.close();
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it.each<[string, Record<string, unknown>]>([
|
|
330
|
+
["only connection options", { timeoutMs: 5000, httpHeaders: { "x-test": "1" } }],
|
|
331
|
+
["unknown options", { timeoutMs: 5000, voice: "snake", ref_audio: "x" }],
|
|
332
|
+
])("sends no session.update with %s", async (_label, options) => {
|
|
333
|
+
const { ws, connection } = await connectWith(options);
|
|
334
|
+
expect(ws.sent).toEqual([]);
|
|
335
|
+
await connection.close();
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
it("throws RealtimeSpeechWSError on a handshake error", async () => {
|
|
339
|
+
const previous = mockModule().getLastSocket();
|
|
340
|
+
const connectPromise = client().connect(MODEL);
|
|
341
|
+
const ws = await nextSocket(previous);
|
|
342
|
+
ws.emitMessage({ type: "error", error: { message: "bad request", code: 1500 } });
|
|
343
|
+
|
|
344
|
+
const error = await connectPromise.catch((err: unknown) => err);
|
|
345
|
+
expect(error).toBeInstanceOf(realtime.RealtimeSpeechWSError);
|
|
346
|
+
expect(error).toMatchObject({ message: "bad request", code: 1500 });
|
|
347
|
+
expect(ws.readyState).toBe(3);
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
describe("RealtimeSpeech.speakStream", () => {
|
|
352
|
+
async function run(
|
|
353
|
+
text: AsyncIterable<string>,
|
|
354
|
+
onSocket: (ws: MockWebSocketInstance) => void | Promise<void>,
|
|
355
|
+
options: Parameters<InstanceType<Realtime["RealtimeSpeech"]>["connect"]>[1] = {},
|
|
356
|
+
) {
|
|
357
|
+
const previous = mockModule().getLastSocket();
|
|
358
|
+
const events: Array<{ type?: string | undefined }> = [];
|
|
359
|
+
const consumed = (async () => {
|
|
360
|
+
for await (const event of client().speakStream(text, MODEL, options)) {
|
|
361
|
+
events.push(event);
|
|
362
|
+
}
|
|
363
|
+
})();
|
|
364
|
+
consumed.catch(() => undefined);
|
|
365
|
+
const ws = await nextSocket(previous);
|
|
366
|
+
ws.emitMessage(SESSION_CREATED);
|
|
367
|
+
await tick();
|
|
368
|
+
await onSocket(ws);
|
|
369
|
+
return { ws, events, consumed };
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
it("sends text, ends the input, and stops on speech.audio.done", async () => {
|
|
373
|
+
const { ws, events, consumed } = await run(
|
|
374
|
+
textOf("Hello, ", "world."),
|
|
375
|
+
(socket) => {
|
|
376
|
+
socket.emitMessage(AUDIO_DELTA);
|
|
377
|
+
socket.emitMessage(AUDIO_DONE);
|
|
378
|
+
socket.emitMessage(AUDIO_DELTA);
|
|
379
|
+
},
|
|
380
|
+
{ voiceId: "my-voice" },
|
|
381
|
+
);
|
|
382
|
+
await consumed;
|
|
383
|
+
|
|
384
|
+
expect(events.map((event) => event.type)).toEqual([
|
|
385
|
+
"session.created",
|
|
386
|
+
"speech.audio.delta",
|
|
387
|
+
"speech.audio.done",
|
|
388
|
+
]);
|
|
389
|
+
expect(sent(ws)).toEqual([
|
|
390
|
+
{ type: "session.update", session: { voice: "my-voice" } },
|
|
391
|
+
{ type: "input_text.append", text: "Hello, " },
|
|
392
|
+
{ type: "input_text.append", text: "world." },
|
|
393
|
+
{ type: "input_text.end" },
|
|
394
|
+
]);
|
|
395
|
+
expect(ws.closeArgs?.code).toBe(1000);
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
it.each([false, true])(
|
|
399
|
+
"raises the server close as RealtimeSpeechException (failing send: %s)",
|
|
400
|
+
async (failTextSend) => {
|
|
401
|
+
const { consumed } = await run(textOf("Hi."), (socket) => {
|
|
402
|
+
if (failTextSend) {
|
|
403
|
+
socket.failTextSendWith = new Error("socket closed");
|
|
404
|
+
}
|
|
405
|
+
socket.serverClose(1008, "Voice 'nope' not found.");
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
const error = await consumed.then(() => undefined, (err: unknown) => err);
|
|
409
|
+
expect(error).toBeInstanceOf(realtime.RealtimeSpeechException);
|
|
410
|
+
expect(error).toMatchObject({ message: "Voice 'nope' not found.", code: 1008 });
|
|
411
|
+
},
|
|
412
|
+
);
|
|
413
|
+
|
|
414
|
+
it("ends quietly on a clean server close while sending", async () => {
|
|
415
|
+
async function* slowText() {
|
|
416
|
+
yield "Hi.";
|
|
417
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
418
|
+
yield "More.";
|
|
419
|
+
}
|
|
420
|
+
const { events, consumed } = await run(slowText(), (socket) => {
|
|
421
|
+
socket.failTextSendWith = new Error("socket closed");
|
|
422
|
+
socket.serverClose(1000, "");
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
await expect(consumed).resolves.toBeUndefined();
|
|
426
|
+
expect(events.map((event) => event.type)).toEqual(["session.created"]);
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
it("returns when the consumer stops while the text stream is waiting", async () => {
|
|
430
|
+
let returned = false;
|
|
431
|
+
const stalled: AsyncIterable<string> = {
|
|
432
|
+
[Symbol.asyncIterator]: () => {
|
|
433
|
+
let first = true;
|
|
434
|
+
return {
|
|
435
|
+
next: () => {
|
|
436
|
+
if (first) {
|
|
437
|
+
first = false;
|
|
438
|
+
return Promise.resolve({ done: false, value: "Hi." });
|
|
439
|
+
}
|
|
440
|
+
return new Promise<IteratorResult<string>>(() => undefined);
|
|
441
|
+
},
|
|
442
|
+
return: () => {
|
|
443
|
+
returned = true;
|
|
444
|
+
return Promise.resolve({ done: true, value: undefined });
|
|
445
|
+
},
|
|
446
|
+
};
|
|
447
|
+
},
|
|
448
|
+
};
|
|
449
|
+
const { ws, consumed } = await run(stalled, (socket) => socket.emitMessage(AUDIO_DONE));
|
|
450
|
+
|
|
451
|
+
const outcome = await Promise.race([
|
|
452
|
+
consumed.then(() => "returned"),
|
|
453
|
+
new Promise((resolve) => setTimeout(() => resolve("hung"), 1000)),
|
|
454
|
+
]);
|
|
455
|
+
expect(outcome).toBe("returned");
|
|
456
|
+
expect(returned).toBe(true);
|
|
457
|
+
expect(sent(ws).map((message) => (message as { type: string }).type)).toEqual([
|
|
458
|
+
"input_text.append",
|
|
459
|
+
]);
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
it("raises a text stream error instead of waiting for events", async () => {
|
|
463
|
+
async function* failingText(): AsyncIterable<string> {
|
|
464
|
+
yield "Hi.";
|
|
465
|
+
throw new Error("LLM stream failed");
|
|
466
|
+
}
|
|
467
|
+
const { ws, consumed } = await run(failingText(), () => undefined);
|
|
468
|
+
|
|
469
|
+
const outcome = await Promise.race([
|
|
470
|
+
consumed.then(() => "resolved", (err: Error) => err.message),
|
|
471
|
+
new Promise((resolve) => setTimeout(() => resolve("hung"), 1000)),
|
|
472
|
+
]);
|
|
473
|
+
expect(outcome).toBe("LLM stream failed");
|
|
474
|
+
expect(ws.readyState).toBe(3);
|
|
475
|
+
});
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
describe("session options match the generated payload", () => {
|
|
479
|
+
// Fails when a regen adds or removes a session field the helper doesn't expose.
|
|
480
|
+
function wireFields(schema: unknown): string[] {
|
|
481
|
+
const zodSchema = schema as { in?: { shape: object }; shape?: object };
|
|
482
|
+
return Object.keys((zodSchema.in ?? zodSchema).shape ?? {}).sort();
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const ALL_SPEECH_OPTIONS = {
|
|
486
|
+
voiceId: "v",
|
|
487
|
+
refAudio: "UklGRg==",
|
|
488
|
+
responseFormat: "pcm",
|
|
489
|
+
streamingMode: "responsive",
|
|
490
|
+
expressiveness: 1.5,
|
|
491
|
+
} as const;
|
|
492
|
+
|
|
493
|
+
it("covers every realtime speech session field in updateSession and connect", async () => {
|
|
494
|
+
const expected = wireFields(RealtimeSpeechSessionUpdatePayload$inboundSchema);
|
|
495
|
+
expect(expected.length).toBeGreaterThan(0);
|
|
496
|
+
|
|
497
|
+
const { ws, connection } = newConnection();
|
|
498
|
+
await connection.updateSession(ALL_SPEECH_OPTIONS);
|
|
499
|
+
const viaUpdate = sent(ws)[0] as { session: object };
|
|
500
|
+
expect(Object.keys(viaUpdate.session).sort()).toEqual(expected);
|
|
501
|
+
|
|
502
|
+
const connected = await connectWith(ALL_SPEECH_OPTIONS);
|
|
503
|
+
const viaConnect = sent(connected.ws)[0] as { session: object };
|
|
504
|
+
expect(Object.keys(viaConnect.session).sort()).toEqual(expected);
|
|
505
|
+
await connected.connection.close();
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
it("covers every realtime transcription session field", async () => {
|
|
509
|
+
const ws = new (mockModule().MockWebSocket)();
|
|
510
|
+
const connection = new realtime.RealtimeConnection(ws as unknown as WebSocket, {
|
|
511
|
+
requestId: "ws-123",
|
|
512
|
+
model: "voxtral-mini-transcribe-realtime-3",
|
|
513
|
+
audioFormat: { encoding: "pcm_s16le", sampleRate: 16000 },
|
|
514
|
+
});
|
|
515
|
+
await connection.updateSession(
|
|
516
|
+
{ encoding: "pcm_s16le", sampleRate: 16000 },
|
|
517
|
+
{
|
|
518
|
+
targetStreamingDelayMs: 480,
|
|
519
|
+
diarize: true,
|
|
520
|
+
contextBias: ["Voxtral"],
|
|
521
|
+
language: "en",
|
|
522
|
+
speakerReferences: { alice: "UklGRg==" },
|
|
523
|
+
turnDetection: {},
|
|
524
|
+
},
|
|
525
|
+
);
|
|
526
|
+
|
|
527
|
+
const message = sent(ws)[0] as { session: object };
|
|
528
|
+
expect(Object.keys(message.session).sort()).toEqual(
|
|
529
|
+
wireFields(RealtimeTranscriptionSessionUpdatePayload$inboundSchema),
|
|
530
|
+
);
|
|
531
|
+
});
|
|
532
|
+
});
|