From e0234885f23ed946e9904cf05c06112d7af1cdf7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 22:09:06 +0100 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.434.4 (#42) Co-authored-by: speakeasybot --- .speakeasy/gen.lock | 73 +++- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 20 +- .speakeasy/workflow.yaml | 6 +- README.md | 16 + RELEASES.md | 12 +- .../agentscompletionrequestmessages.md | 10 +- .../agentscompletionrequesttoolchoice.md | 2 +- .../agentscompletionstreamrequestmessages.md | 6 +- ...agentscompletionstreamrequesttoolchoice.md | 2 +- docs/models/components/apiendpoint.md | 15 + .../components/assistantmessagecontent.md | 4 +- docs/models/components/batcherror.md | 18 + docs/models/components/batchjobin.md | 25 ++ docs/models/components/batchjobout.md | 49 +++ docs/models/components/batchjoboutobject.md | 15 + docs/models/components/batchjobsout.md | 19 ++ docs/models/components/batchjobsoutobject.md | 15 + docs/models/components/batchjobstatus.md | 15 + .../components/chatclassificationrequest.md | 8 +- .../chatclassificationrequestinputs.md | 12 +- .../models/components/chatcompletionchoice.md | 10 +- .../chatcompletionrequesttoolchoice.md | 2 +- .../chatcompletionstreamrequestmessages.md | 12 +- .../chatcompletionstreamrequesttoolchoice.md | 2 +- docs/models/components/completionchunk.md | 6 +- docs/models/components/completionevent.md | 4 +- .../completionresponsestreamchoice.md | 4 +- ...pletionresponsestreamchoicefinishreason.md | 2 +- docs/models/components/content.md | 4 +- docs/models/components/contentchunk.md | 4 +- docs/models/components/imageurl.md | 2 +- docs/models/components/imageurlchunk.md | 2 +- .../components/imageurlchunkimageurl.md | 2 +- docs/models/components/responseformats.md | 2 +- docs/models/components/two.md | 6 +- docs/models/components/usermessage.md | 8 +- docs/models/components/usermessagecontent.md | 2 +- .../filesapiroutesdownloadfilerequest.md | 17 + ...jobsapiroutesbatchcancelbatchjobrequest.md | 17 + .../jobsapiroutesbatchgetbatchjobrequest.md | 17 + .../jobsapiroutesbatchgetbatchjobsrequest.md | 21 ++ ...tesfinetuningcancelfinetuningjobrequest.md | 2 +- ...esfinetuningcreatefinetuningjobresponse.md | 12 +- ...routesfinetuninggetfinetuningjobrequest.md | 2 +- ...utesfinetuningstartfinetuningjobrequest.md | 2 +- ...responseretrievemodelv1modelsmodelidget.md | 2 +- docs/models/operations/status.md | 2 +- docs/sdks/batch/README.md | 2 + docs/sdks/files/README.md | 77 +++++ docs/sdks/mistraljobs/README.md | 319 ++++++++++++++++++ jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/funcs/batchJobsCancel.ts | 130 +++++++ src/funcs/batchJobsCreate.ts | 120 +++++++ src/funcs/batchJobsGet.ts | 130 +++++++ src/funcs/batchJobsList.ts | 133 ++++++++ src/funcs/filesDownload.ts | 128 +++++++ src/lib/config.ts | 4 +- src/models/components/apiendpoint.ts | 33 ++ src/models/components/batcherror.ts | 49 +++ src/models/components/batchjobin.ts | 77 +++++ src/models/components/batchjobout.ts | 174 ++++++++++ src/models/components/batchjobsout.ts | 86 +++++ src/models/components/batchjobstatus.ts | 38 +++ src/models/components/chatcompletionchoice.ts | 18 +- src/models/components/index.ts | 6 + .../operations/filesapiroutesdownloadfile.ts | 55 +++ src/models/operations/index.ts | 4 + .../jobsapiroutesbatchcancelbatchjob.ts | 56 +++ .../jobsapiroutesbatchgetbatchjob.ts | 56 +++ .../jobsapiroutesbatchgetbatchjobs.ts | 87 +++++ src/sdk/batch.ts | 13 + src/sdk/files.ts | 18 + src/sdk/mistraljobs.ts | 82 +++++ src/sdk/sdk.ts | 6 + 77 files changed, 2316 insertions(+), 105 deletions(-) create mode 100644 docs/models/components/apiendpoint.md create mode 100644 docs/models/components/batcherror.md create mode 100644 docs/models/components/batchjobin.md create mode 100644 docs/models/components/batchjobout.md create mode 100644 docs/models/components/batchjoboutobject.md create mode 100644 docs/models/components/batchjobsout.md create mode 100644 docs/models/components/batchjobsoutobject.md create mode 100644 docs/models/components/batchjobstatus.md create mode 100644 docs/models/operations/filesapiroutesdownloadfilerequest.md create mode 100644 docs/models/operations/jobsapiroutesbatchcancelbatchjobrequest.md create mode 100644 docs/models/operations/jobsapiroutesbatchgetbatchjobrequest.md create mode 100644 docs/models/operations/jobsapiroutesbatchgetbatchjobsrequest.md create mode 100644 docs/sdks/batch/README.md create mode 100644 docs/sdks/mistraljobs/README.md create mode 100644 src/funcs/batchJobsCancel.ts create mode 100644 src/funcs/batchJobsCreate.ts create mode 100644 src/funcs/batchJobsGet.ts create mode 100644 src/funcs/batchJobsList.ts create mode 100644 src/funcs/filesDownload.ts create mode 100644 src/models/components/apiendpoint.ts create mode 100644 src/models/components/batcherror.ts create mode 100644 src/models/components/batchjobin.ts create mode 100644 src/models/components/batchjobout.ts create mode 100644 src/models/components/batchjobsout.ts create mode 100644 src/models/components/batchjobstatus.ts create mode 100644 src/models/operations/filesapiroutesdownloadfile.ts create mode 100644 src/models/operations/jobsapiroutesbatchcancelbatchjob.ts create mode 100644 src/models/operations/jobsapiroutesbatchgetbatchjob.ts create mode 100644 src/models/operations/jobsapiroutesbatchgetbatchjobs.ts create mode 100644 src/sdk/batch.ts create mode 100644 src/sdk/mistraljobs.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 72d460b..a67d3df 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 81b65c50-f2e3-40a3-bd65-346524007b3d management: - docChecksum: 8dbd12dc531838bb25980ce33654c8bf + docChecksum: ee15d853ecc28d415d6b33191893a6ff docVersion: 0.0.2 - speakeasyVersion: 1.434.2 + speakeasyVersion: 1.434.4 generationVersion: 2.452.0 - releaseVersion: 1.2.0 - configChecksum: 0f0d4b73e436e4fc46a2b3b9856dcfa3 + releaseVersion: 1.3.0 + configChecksum: d6bf2d23bd8b094865db557c870ba6fc repoURL: https://github.com/mistralai/client-ts.git installationURL: https://github.com/mistralai/client-ts published: true @@ -17,6 +17,7 @@ features: core: 3.18.3 defaultEnabledRetries: 0.1.0 devContainers: 2.90.0 + downloadStreams: 0.1.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 examples: 2.81.4 @@ -56,6 +57,7 @@ generatedFiles: - docs/models/components/agentscompletionstreamrequestmessages.md - docs/models/components/agentscompletionstreamrequeststop.md - docs/models/components/agentscompletionstreamrequesttoolchoice.md + - docs/models/components/apiendpoint.md - docs/models/components/archiveftmodelout.md - docs/models/components/archiveftmodeloutobject.md - docs/models/components/arguments.md @@ -63,6 +65,13 @@ generatedFiles: - docs/models/components/assistantmessagecontent.md - docs/models/components/assistantmessagerole.md - docs/models/components/basemodelcard.md + - docs/models/components/batcherror.md + - docs/models/components/batchjobin.md + - docs/models/components/batchjobout.md + - docs/models/components/batchjoboutobject.md + - docs/models/components/batchjobsout.md + - docs/models/components/batchjobsoutobject.md + - docs/models/components/batchjobstatus.md - docs/models/components/chatclassificationrequest.md - docs/models/components/chatclassificationrequestinputs.md - docs/models/components/chatcompletionchoice.md @@ -183,10 +192,14 @@ generatedFiles: - docs/models/errors/httpvalidationerror.md - docs/models/operations/deletemodelv1modelsmodeliddeleterequest.md - docs/models/operations/filesapiroutesdeletefilerequest.md + - docs/models/operations/filesapiroutesdownloadfilerequest.md - docs/models/operations/filesapirouteslistfilesrequest.md - docs/models/operations/filesapiroutesretrievefilerequest.md - docs/models/operations/filesapiroutesuploadfilemultipartbodyparams.md - docs/models/operations/filet.md + - docs/models/operations/jobsapiroutesbatchcancelbatchjobrequest.md + - docs/models/operations/jobsapiroutesbatchgetbatchjobrequest.md + - docs/models/operations/jobsapiroutesbatchgetbatchjobsrequest.md - docs/models/operations/jobsapiroutesfinetuningarchivefinetunedmodelrequest.md - docs/models/operations/jobsapiroutesfinetuningcancelfinetuningjobrequest.md - docs/models/operations/jobsapiroutesfinetuningcreatefinetuningjobresponse.md @@ -199,6 +212,7 @@ generatedFiles: - docs/models/operations/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md - docs/models/operations/status.md - docs/sdks/agents/README.md + - docs/sdks/batch/README.md - docs/sdks/chat/README.md - docs/sdks/classifiers/README.md - docs/sdks/embeddings/README.md @@ -207,18 +221,24 @@ generatedFiles: - docs/sdks/finetuning/README.md - docs/sdks/jobs/README.md - docs/sdks/mistral/README.md + - docs/sdks/mistraljobs/README.md - docs/sdks/models/README.md - jsr.json - package.json - src/core.ts - src/funcs/agentsComplete.ts - src/funcs/agentsStream.ts + - src/funcs/batchJobsCancel.ts + - src/funcs/batchJobsCreate.ts + - src/funcs/batchJobsGet.ts + - src/funcs/batchJobsList.ts - src/funcs/chatComplete.ts - src/funcs/chatStream.ts - src/funcs/classifiersModerate.ts - src/funcs/classifiersModerateChat.ts - src/funcs/embeddingsCreate.ts - src/funcs/filesDelete.ts + - src/funcs/filesDownload.ts - src/funcs/filesList.ts - src/funcs/filesRetrieve.ts - src/funcs/filesUpload.ts @@ -258,9 +278,15 @@ generatedFiles: - src/lib/url.ts - src/models/components/agentscompletionrequest.ts - src/models/components/agentscompletionstreamrequest.ts + - src/models/components/apiendpoint.ts - src/models/components/archiveftmodelout.ts - src/models/components/assistantmessage.ts - src/models/components/basemodelcard.ts + - src/models/components/batcherror.ts + - src/models/components/batchjobin.ts + - src/models/components/batchjobout.ts + - src/models/components/batchjobsout.ts + - src/models/components/batchjobstatus.ts - src/models/components/chatclassificationrequest.ts - src/models/components/chatcompletionchoice.ts - src/models/components/chatcompletionrequest.ts @@ -340,10 +366,14 @@ generatedFiles: - src/models/errors/sdkvalidationerror.ts - src/models/operations/deletemodelv1modelsmodeliddelete.ts - src/models/operations/filesapiroutesdeletefile.ts + - src/models/operations/filesapiroutesdownloadfile.ts - src/models/operations/filesapirouteslistfiles.ts - src/models/operations/filesapiroutesretrievefile.ts - src/models/operations/filesapiroutesuploadfile.ts - src/models/operations/index.ts + - src/models/operations/jobsapiroutesbatchcancelbatchjob.ts + - src/models/operations/jobsapiroutesbatchgetbatchjob.ts + - src/models/operations/jobsapiroutesbatchgetbatchjobs.ts - src/models/operations/jobsapiroutesfinetuningarchivefinetunedmodel.ts - src/models/operations/jobsapiroutesfinetuningcancelfinetuningjob.ts - src/models/operations/jobsapiroutesfinetuningcreatefinetuningjob.ts @@ -354,6 +384,7 @@ generatedFiles: - src/models/operations/jobsapiroutesfinetuningupdatefinetunedmodel.ts - src/models/operations/retrievemodelv1modelsmodelidget.ts - src/sdk/agents.ts + - src/sdk/batch.ts - src/sdk/chat.ts - src/sdk/classifiers.ts - src/sdk/embeddings.ts @@ -362,6 +393,7 @@ generatedFiles: - src/sdk/finetuning.ts - src/sdk/index.ts - src/sdk/jobs.ts + - src/sdk/mistraljobs.ts - src/sdk/models.ts - src/sdk/sdk.ts - src/types/blobs.ts @@ -542,3 +574,36 @@ examples: "200": application/json: {"id": "mod-e5cc70bb28c444948073e77776eb30ef"} "422": {} + files_api_routes_download_file: + speakeasy-default-files-api-routes-download-file: + parameters: + path: + file_id: "" + jobs_api_routes_batch_get_batch_jobs: + speakeasy-default-jobs-api-routes-batch-get-batch-jobs: + responses: + "200": + application/json: {"total": 768578} + jobs_api_routes_batch_create_batch_job: + speakeasy-default-jobs-api-routes-batch-create-batch-job: + requestBody: + application/json: {"input_files": ["a621cf02-1cd9-4cf5-8403-315211a509a3"], "endpoint": "/v1/fim/completions", "model": "2"} + responses: + "200": + application/json: {"id": "", "input_files": ["8e774c2b-ecc3-4769-b177-5e024985613d", "0ee803d5-6a1d-4f94-836b-fd39494798bc"], "endpoint": "", "model": "Impala", "errors": [{"message": ""}, {"message": ""}, {"message": ""}], "status": "RUNNING", "created_at": 770370, "total_requests": 350586, "completed_requests": 95214, "succeeded_requests": 930830, "failed_requests": 617761} + jobs_api_routes_batch_get_batch_job: + speakeasy-default-jobs-api-routes-batch-get-batch-job: + parameters: + path: + job_id: "b888f774-3e7c-4135-a18c-6b985523c4bc" + responses: + "200": + application/json: {"id": "", "input_files": ["50f76228-1da8-44bc-b661-c8a99c6b71b6", "cd62b8f7-112a-4af0-bab4-e43b4cca3716", "620807aa-1f8c-4f05-ad89-d58ee381f6b4"], "endpoint": "", "model": "Golf", "errors": [{"message": ""}, {"message": ""}], "status": "SUCCESS", "created_at": 790898, "total_requests": 55097, "completed_requests": 578320, "succeeded_requests": 856562, "failed_requests": 328633} + jobs_api_routes_batch_cancel_batch_job: + speakeasy-default-jobs-api-routes-batch-cancel-batch-job: + parameters: + path: + job_id: "0f713502-9233-41c6-9ebd-c570b7edb496" + responses: + "200": + application/json: {"id": "", "input_files": ["50fbe4e3-e326-4135-8744-d82f3fd6b3c1", "eb45e247-ac10-4cdc-8311-2f7cc9241230", "4afaa0f8-4bd4-4945-9116-89d07a64aa72"], "endpoint": "", "model": "Alpine", "errors": [{"message": ""}, {"message": ""}], "status": "QUEUED", "created_at": 709109, "total_requests": 275794, "completed_requests": 158938, "succeeded_requests": 12381, "failed_requests": 11864} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index d8112ae..f45462b 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -16,7 +16,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false typescript: - version: 1.2.0 + version: 1.3.0 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d21b258..d9802c1 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.434.2 +speakeasyVersion: 1.434.4 sources: mistral-azure-source: sourceNamespace: mistral-openapi-azure @@ -16,8 +16,8 @@ sources: - main mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:32a9827b9fab491a738a995ecc3121a91e368750dea9c9232cd506d787505305 - sourceBlobDigest: sha256:4d0e31797809ba3ebec9a32308e2828b0605a3865efd64c4338d13d98427e02d + sourceRevisionDigest: sha256:e658442ebfc83351cbb7873fb17b03f07ff9edebd8eddfce5577e2c5c7bfafce + sourceBlobDigest: sha256:559403eaaa97c021eaf0022adddb1066694d879a946c87057e942806d5a2a2a2 tags: - latest - main @@ -35,10 +35,10 @@ targets: mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:32a9827b9fab491a738a995ecc3121a91e368750dea9c9232cd506d787505305 - sourceBlobDigest: sha256:4d0e31797809ba3ebec9a32308e2828b0605a3865efd64c4338d13d98427e02d - codeSamplesNamespace: mistral-openapi - codeSamplesRevisionDigest: sha256:cd68cb25021eab25cd6125ed9e7b67c80b406bc84fb5423efb6554bf954d56de + sourceRevisionDigest: sha256:e658442ebfc83351cbb7873fb17b03f07ff9edebd8eddfce5577e2c5c7bfafce + sourceBlobDigest: sha256:559403eaaa97c021eaf0022adddb1066694d879a946c87057e942806d5a2a2a2 + codeSamplesNamespace: mistral-openapi-code-samples + codeSamplesRevisionDigest: sha256:040e9e9020d7edd595d15e2879b2bc64e21dc00bea1952375373fef9e132f2fe workflow: workflowVersion: 1.0.0 speakeasyVersion: latest @@ -68,7 +68,7 @@ workflow: token: $npm_token codeSamples: registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main-code-samples + location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure-code-samples blocking: false mistralai-gcp-sdk: target: typescript @@ -79,7 +79,7 @@ workflow: token: $npm_token codeSamples: registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main-code-samples + location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud-code-samples blocking: false mistralai-sdk: target: typescript @@ -89,5 +89,5 @@ workflow: token: $npm_token codeSamples: registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main-code-samples + location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-code-samples blocking: false diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 25a0651..87b5178 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -26,7 +26,7 @@ targets: token: $npm_token codeSamples: registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure:main-code-samples + location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-azure-code-samples blocking: false mistralai-gcp-sdk: target: typescript @@ -37,7 +37,7 @@ targets: token: $npm_token codeSamples: registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud:main-code-samples + location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-google-cloud-code-samples blocking: false mistralai-sdk: target: typescript @@ -47,5 +47,5 @@ targets: token: $npm_token codeSamples: registry: - location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi:main-code-samples + location: registry.speakeasyapi.dev/mistral-dev/mistral-dev/mistral-openapi-code-samples blocking: false diff --git a/README.md b/README.md index f2f3048..e3d48ea 100644 --- a/README.md +++ b/README.md @@ -215,6 +215,16 @@ We have dedicated SDKs for the following providers: * [complete](docs/sdks/agents/README.md#complete) - Agents Completion * [stream](docs/sdks/agents/README.md#stream) - Stream Agents completion +### [batch](docs/sdks/batch/README.md) + + +#### [batch.jobs](docs/sdks/mistraljobs/README.md) + +* [list](docs/sdks/mistraljobs/README.md#list) - Get Batch Jobs +* [create](docs/sdks/mistraljobs/README.md#create) - Create Batch Job +* [get](docs/sdks/mistraljobs/README.md#get) - Get Batch Job +* [cancel](docs/sdks/mistraljobs/README.md#cancel) - Cancel Batch Job + ### [chat](docs/sdks/chat/README.md) * [complete](docs/sdks/chat/README.md#complete) - Chat Completion @@ -235,6 +245,7 @@ We have dedicated SDKs for the following providers: * [list](docs/sdks/files/README.md#list) - List Files * [retrieve](docs/sdks/files/README.md#retrieve) - Retrieve File * [delete](docs/sdks/files/README.md#delete) - Delete File +* [download](docs/sdks/files/README.md#download) - Download File ### [fim](docs/sdks/fim/README.md) @@ -635,12 +646,17 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`agentsComplete`](docs/sdks/agents/README.md#complete) - Agents Completion - [`agentsStream`](docs/sdks/agents/README.md#stream) - Stream Agents completion +- [`batchJobsCancel`](docs/sdks/mistraljobs/README.md#cancel) - Cancel Batch Job +- [`batchJobsCreate`](docs/sdks/mistraljobs/README.md#create) - Create Batch Job +- [`batchJobsGet`](docs/sdks/mistraljobs/README.md#get) - Get Batch Job +- [`batchJobsList`](docs/sdks/mistraljobs/README.md#list) - Get Batch Jobs - [`chatComplete`](docs/sdks/chat/README.md#complete) - Chat Completion - [`chatStream`](docs/sdks/chat/README.md#stream) - Stream chat completion - [`classifiersModerate`](docs/sdks/classifiers/README.md#moderate) - Moderations - [`classifiersModerateChat`](docs/sdks/classifiers/README.md#moderatechat) - Moderations Chat - [`embeddingsCreate`](docs/sdks/embeddings/README.md#create) - Embeddings - [`filesDelete`](docs/sdks/files/README.md#delete) - Delete File +- [`filesDownload`](docs/sdks/files/README.md#download) - Download File - [`filesList`](docs/sdks/files/README.md#list) - List Files - [`filesRetrieve`](docs/sdks/files/README.md#retrieve) - Retrieve File - [`filesUpload`](docs/sdks/files/README.md#upload) - Upload File diff --git a/RELEASES.md b/RELEASES.md index 3d27ac0..c885ee9 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -68,4 +68,14 @@ Based on: ### Generated - [typescript v1.2.0] . ### Releases -- [NPM v1.2.0] https://www.npmjs.com/package/@mistralai/mistralai/v/1.2.0 - . \ No newline at end of file +- [NPM v1.2.0] https://www.npmjs.com/package/@mistralai/mistralai/v/1.2.0 - . + +## 2024-11-07 20:58:48 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.434.4 (2.452.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.3.0] . +### Releases +- [NPM v1.3.0] https://www.npmjs.com/package/@mistralai/mistralai/v/1.3.0 - . \ No newline at end of file diff --git a/docs/models/components/agentscompletionrequestmessages.md b/docs/models/components/agentscompletionrequestmessages.md index 45ed6fa..56d01a3 100644 --- a/docs/models/components/agentscompletionrequestmessages.md +++ b/docs/models/components/agentscompletionrequestmessages.md @@ -13,11 +13,7 @@ const value: components.AssistantMessage = {}; ```typescript const value: components.SystemMessage = { - content: [ - { - text: "", - }, - ], + content: "", }; ``` @@ -35,9 +31,7 @@ const value: components.ToolMessage = { const value: components.UserMessage = { content: [ { - imageUrl: { - url: "https://worse-interviewer.info/", - }, + text: "", }, ], }; diff --git a/docs/models/components/agentscompletionrequesttoolchoice.md b/docs/models/components/agentscompletionrequesttoolchoice.md index 8c61756..5a2e54e 100644 --- a/docs/models/components/agentscompletionrequesttoolchoice.md +++ b/docs/models/components/agentscompletionrequesttoolchoice.md @@ -16,6 +16,6 @@ const value: components.ToolChoice = { ### `components.ToolChoiceEnum` ```typescript -const value: components.ToolChoiceEnum = "any"; +const value: components.ToolChoiceEnum = "none"; ``` diff --git a/docs/models/components/agentscompletionstreamrequestmessages.md b/docs/models/components/agentscompletionstreamrequestmessages.md index db42e9d..b7471e8 100644 --- a/docs/models/components/agentscompletionstreamrequestmessages.md +++ b/docs/models/components/agentscompletionstreamrequestmessages.md @@ -13,7 +13,11 @@ const value: components.AssistantMessage = {}; ```typescript const value: components.SystemMessage = { - content: "", + content: [ + { + text: "", + }, + ], }; ``` diff --git a/docs/models/components/agentscompletionstreamrequesttoolchoice.md b/docs/models/components/agentscompletionstreamrequesttoolchoice.md index bc66a7a..3e52744 100644 --- a/docs/models/components/agentscompletionstreamrequesttoolchoice.md +++ b/docs/models/components/agentscompletionstreamrequesttoolchoice.md @@ -16,6 +16,6 @@ const value: components.ToolChoice = { ### `components.ToolChoiceEnum` ```typescript -const value: components.ToolChoiceEnum = "required"; +const value: components.ToolChoiceEnum = "any"; ``` diff --git a/docs/models/components/apiendpoint.md b/docs/models/components/apiendpoint.md new file mode 100644 index 0000000..e4a3689 --- /dev/null +++ b/docs/models/components/apiendpoint.md @@ -0,0 +1,15 @@ +# ApiEndpoint + +## Example Usage + +```typescript +import { ApiEndpoint } from "@mistralai/mistralai/models/components"; + +let value: ApiEndpoint = "/v1/moderations"; +``` + +## Values + +```typescript +"/v1/chat/completions" | "/v1/embeddings" | "/v1/fim/completions" | "/v1/moderations" +``` \ No newline at end of file diff --git a/docs/models/components/assistantmessagecontent.md b/docs/models/components/assistantmessagecontent.md index 604ac72..5a0e060 100644 --- a/docs/models/components/assistantmessagecontent.md +++ b/docs/models/components/assistantmessagecontent.md @@ -14,7 +14,9 @@ const value: string = ""; ```typescript const value: components.ContentChunk[] = [ { - imageUrl: "https://spirited-earth.name", + imageUrl: { + url: "https://entire-ceramics.com/", + }, }, ]; ``` diff --git a/docs/models/components/batcherror.md b/docs/models/components/batcherror.md new file mode 100644 index 0000000..b0229f3 --- /dev/null +++ b/docs/models/components/batcherror.md @@ -0,0 +1,18 @@ +# BatchError + +## Example Usage + +```typescript +import { BatchError } from "@mistralai/mistralai/models/components"; + +let value: BatchError = { + message: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `message` | *string* | :heavy_check_mark: | N/A | +| `count` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/batchjobin.md b/docs/models/components/batchjobin.md new file mode 100644 index 0000000..77eca9e --- /dev/null +++ b/docs/models/components/batchjobin.md @@ -0,0 +1,25 @@ +# BatchJobIn + +## Example Usage + +```typescript +import { BatchJobIn } from "@mistralai/mistralai/models/components"; + +let value: BatchJobIn = { + inputFiles: [ + "17fe5f3f-fcad-44d9-b052-f77a52d3831d", + ], + endpoint: "/v1/moderations", + model: "Taurus", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `inputFiles` | *string*[] | :heavy_check_mark: | N/A | +| `endpoint` | [components.ApiEndpoint](../../models/components/apiendpoint.md) | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_check_mark: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `timeoutHours` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/batchjobout.md b/docs/models/components/batchjobout.md new file mode 100644 index 0000000..512b0e8 --- /dev/null +++ b/docs/models/components/batchjobout.md @@ -0,0 +1,49 @@ +# BatchJobOut + +## Example Usage + +```typescript +import { BatchJobOut } from "@mistralai/mistralai/models/components"; + +let value: BatchJobOut = { + id: "", + inputFiles: [ + "b4380365-749d-4182-9b69-2275fcbe189f", + ], + endpoint: "", + model: "Camry", + errors: [ + { + message: "", + }, + ], + status: "QUEUED", + createdAt: 16429, + totalRequests: 929530, + completedRequests: 669917, + succeededRequests: 785153, + failedRequests: 281730, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `object` | [components.BatchJobOutObject](../../models/components/batchjoboutobject.md) | :heavy_minus_sign: | N/A | +| `inputFiles` | *string*[] | :heavy_check_mark: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `endpoint` | *string* | :heavy_check_mark: | N/A | +| `model` | *string* | :heavy_check_mark: | N/A | +| `outputFile` | *string* | :heavy_minus_sign: | N/A | +| `errorFile` | *string* | :heavy_minus_sign: | N/A | +| `errors` | [components.BatchError](../../models/components/batcherror.md)[] | :heavy_check_mark: | N/A | +| `status` | [components.BatchJobStatus](../../models/components/batchjobstatus.md) | :heavy_check_mark: | N/A | +| `createdAt` | *number* | :heavy_check_mark: | N/A | +| `totalRequests` | *number* | :heavy_check_mark: | N/A | +| `completedRequests` | *number* | :heavy_check_mark: | N/A | +| `succeededRequests` | *number* | :heavy_check_mark: | N/A | +| `failedRequests` | *number* | :heavy_check_mark: | N/A | +| `startedAt` | *number* | :heavy_minus_sign: | N/A | +| `completedAt` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/batchjoboutobject.md b/docs/models/components/batchjoboutobject.md new file mode 100644 index 0000000..35ce12c --- /dev/null +++ b/docs/models/components/batchjoboutobject.md @@ -0,0 +1,15 @@ +# BatchJobOutObject + +## Example Usage + +```typescript +import { BatchJobOutObject } from "@mistralai/mistralai/models/components"; + +let value: BatchJobOutObject = "batch"; +``` + +## Values + +```typescript +"batch" +``` \ No newline at end of file diff --git a/docs/models/components/batchjobsout.md b/docs/models/components/batchjobsout.md new file mode 100644 index 0000000..c2fd935 --- /dev/null +++ b/docs/models/components/batchjobsout.md @@ -0,0 +1,19 @@ +# BatchJobsOut + +## Example Usage + +```typescript +import { BatchJobsOut } from "@mistralai/mistralai/models/components"; + +let value: BatchJobsOut = { + total: 947371, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `data` | [components.BatchJobOut](../../models/components/batchjobout.md)[] | :heavy_minus_sign: | N/A | +| `object` | [components.BatchJobsOutObject](../../models/components/batchjobsoutobject.md) | :heavy_minus_sign: | N/A | +| `total` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/batchjobsoutobject.md b/docs/models/components/batchjobsoutobject.md new file mode 100644 index 0000000..60bd196 --- /dev/null +++ b/docs/models/components/batchjobsoutobject.md @@ -0,0 +1,15 @@ +# BatchJobsOutObject + +## Example Usage + +```typescript +import { BatchJobsOutObject } from "@mistralai/mistralai/models/components"; + +let value: BatchJobsOutObject = "list"; +``` + +## Values + +```typescript +"list" +``` \ No newline at end of file diff --git a/docs/models/components/batchjobstatus.md b/docs/models/components/batchjobstatus.md new file mode 100644 index 0000000..8ce39a3 --- /dev/null +++ b/docs/models/components/batchjobstatus.md @@ -0,0 +1,15 @@ +# BatchJobStatus + +## Example Usage + +```typescript +import { BatchJobStatus } from "@mistralai/mistralai/models/components"; + +let value: BatchJobStatus = "TIMEOUT_EXCEEDED"; +``` + +## Values + +```typescript +"QUEUED" | "RUNNING" | "SUCCESS" | "FAILED" | "TIMEOUT_EXCEEDED" | "CANCELLATION_REQUESTED" | "CANCELLED" +``` \ No newline at end of file diff --git a/docs/models/components/chatclassificationrequest.md b/docs/models/components/chatclassificationrequest.md index 4566678..511cbe9 100644 --- a/docs/models/components/chatclassificationrequest.md +++ b/docs/models/components/chatclassificationrequest.md @@ -7,9 +7,13 @@ import { ChatClassificationRequest } from "@mistralai/mistralai/models/component let value: ChatClassificationRequest = { inputs: [ - {}, + [ + { + content: "", + }, + ], ], - model: "Alpine", + model: "Impala", }; ``` diff --git a/docs/models/components/chatclassificationrequestinputs.md b/docs/models/components/chatclassificationrequestinputs.md index 55c42d1..526df9f 100644 --- a/docs/models/components/chatclassificationrequestinputs.md +++ b/docs/models/components/chatclassificationrequestinputs.md @@ -9,13 +9,7 @@ Chat to classify ```typescript const value: components.One[] = [ - { - content: [ - { - text: "", - }, - ], - }, + {}, ]; ``` @@ -24,9 +18,7 @@ const value: components.One[] = [ ```typescript const value: components.Two[][] = [ [ - { - content: "", - }, + {}, ], ]; ``` diff --git a/docs/models/components/chatcompletionchoice.md b/docs/models/components/chatcompletionchoice.md index cca18ce..49c2173 100644 --- a/docs/models/components/chatcompletionchoice.md +++ b/docs/models/components/chatcompletionchoice.md @@ -14,8 +14,8 @@ let value: ChatCompletionChoice = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `index` | *number* | :heavy_check_mark: | N/A | 0 | -| `message` | [components.DeltaMessage](../../models/components/deltamessage.md) | :heavy_check_mark: | N/A | | -| `finishReason` | [components.FinishReason](../../models/components/finishreason.md) | :heavy_check_mark: | N/A | stop | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `index` | *number* | :heavy_check_mark: | N/A | 0 | +| `message` | [components.AssistantMessage](../../models/components/assistantmessage.md) | :heavy_check_mark: | N/A | | +| `finishReason` | [components.FinishReason](../../models/components/finishreason.md) | :heavy_check_mark: | N/A | stop | \ No newline at end of file diff --git a/docs/models/components/chatcompletionrequesttoolchoice.md b/docs/models/components/chatcompletionrequesttoolchoice.md index 8750103..7914b53 100644 --- a/docs/models/components/chatcompletionrequesttoolchoice.md +++ b/docs/models/components/chatcompletionrequesttoolchoice.md @@ -16,6 +16,6 @@ const value: components.ToolChoice = { ### `components.ToolChoiceEnum` ```typescript -const value: components.ToolChoiceEnum = "required"; +const value: components.ToolChoiceEnum = "auto"; ``` diff --git a/docs/models/components/chatcompletionstreamrequestmessages.md b/docs/models/components/chatcompletionstreamrequestmessages.md index 8c2b510..467c336 100644 --- a/docs/models/components/chatcompletionstreamrequestmessages.md +++ b/docs/models/components/chatcompletionstreamrequestmessages.md @@ -13,11 +13,7 @@ const value: components.AssistantMessage = {}; ```typescript const value: components.SystemMessage = { - content: [ - { - text: "", - }, - ], + content: "", }; ``` @@ -33,11 +29,7 @@ const value: components.ToolMessage = { ```typescript const value: components.UserMessage = { - content: [ - { - text: "", - }, - ], + content: "", }; ``` diff --git a/docs/models/components/chatcompletionstreamrequesttoolchoice.md b/docs/models/components/chatcompletionstreamrequesttoolchoice.md index 4d4a29f..9f19e8c 100644 --- a/docs/models/components/chatcompletionstreamrequesttoolchoice.md +++ b/docs/models/components/chatcompletionstreamrequesttoolchoice.md @@ -16,6 +16,6 @@ const value: components.ToolChoice = { ### `components.ToolChoiceEnum` ```typescript -const value: components.ToolChoiceEnum = "none"; +const value: components.ToolChoiceEnum = "required"; ``` diff --git a/docs/models/components/completionchunk.md b/docs/models/components/completionchunk.md index 82fbf76..1b339ee 100644 --- a/docs/models/components/completionchunk.md +++ b/docs/models/components/completionchunk.md @@ -7,7 +7,7 @@ import { CompletionChunk } from "@mistralai/mistralai/models/components"; let value: CompletionChunk = { id: "", - model: "Silverado", + model: "A8", usage: { promptTokens: 16, completionTokens: 34, @@ -15,9 +15,9 @@ let value: CompletionChunk = { }, choices: [ { - index: 338159, + index: 518835, delta: {}, - finishReason: "tool_calls", + finishReason: "length", }, ], }; diff --git a/docs/models/components/completionevent.md b/docs/models/components/completionevent.md index 9a50efc..b1ed970 100644 --- a/docs/models/components/completionevent.md +++ b/docs/models/components/completionevent.md @@ -8,7 +8,7 @@ import { CompletionEvent } from "@mistralai/mistralai/models/components"; let value: CompletionEvent = { data: { id: "", - model: "A4", + model: "Explorer", usage: { promptTokens: 16, completionTokens: 34, @@ -16,7 +16,7 @@ let value: CompletionEvent = { }, choices: [ { - index: 485628, + index: 44612, delta: {}, finishReason: "tool_calls", }, diff --git a/docs/models/components/completionresponsestreamchoice.md b/docs/models/components/completionresponsestreamchoice.md index db0f13c..6a83774 100644 --- a/docs/models/components/completionresponsestreamchoice.md +++ b/docs/models/components/completionresponsestreamchoice.md @@ -6,9 +6,9 @@ import { CompletionResponseStreamChoice } from "@mistralai/mistralai/models/components"; let value: CompletionResponseStreamChoice = { - index: 949319, + index: 959434, delta: {}, - finishReason: "tool_calls", + finishReason: "error", }; ``` diff --git a/docs/models/components/completionresponsestreamchoicefinishreason.md b/docs/models/components/completionresponsestreamchoicefinishreason.md index a6042ab..c724d59 100644 --- a/docs/models/components/completionresponsestreamchoicefinishreason.md +++ b/docs/models/components/completionresponsestreamchoicefinishreason.md @@ -5,7 +5,7 @@ ```typescript import { CompletionResponseStreamChoiceFinishReason } from "@mistralai/mistralai/models/components"; -let value: CompletionResponseStreamChoiceFinishReason = "stop"; +let value: CompletionResponseStreamChoiceFinishReason = "error"; ``` ## Values diff --git a/docs/models/components/content.md b/docs/models/components/content.md index 99ff58d..381e8f3 100644 --- a/docs/models/components/content.md +++ b/docs/models/components/content.md @@ -14,7 +14,9 @@ const value: string = ""; ```typescript const value: components.ContentChunk[] = [ { - text: "", + imageUrl: { + url: "https://muted-pleasure.biz", + }, }, ]; ``` diff --git a/docs/models/components/contentchunk.md b/docs/models/components/contentchunk.md index 74a352a..8a0214d 100644 --- a/docs/models/components/contentchunk.md +++ b/docs/models/components/contentchunk.md @@ -7,9 +7,7 @@ ```typescript const value: components.ImageURLChunk = { - imageUrl: { - url: "https://all-crocodile.info", - }, + imageUrl: "https://bony-bonnet.net/", }; ``` diff --git a/docs/models/components/imageurl.md b/docs/models/components/imageurl.md index 5f2ff0f..80f96d3 100644 --- a/docs/models/components/imageurl.md +++ b/docs/models/components/imageurl.md @@ -6,7 +6,7 @@ import { ImageURL } from "@mistralai/mistralai/models/components"; let value: ImageURL = { - url: "https://oblong-contractor.com/", + url: "https://lasting-plugin.net/", }; ``` diff --git a/docs/models/components/imageurlchunk.md b/docs/models/components/imageurlchunk.md index 860050a..039ae6b 100644 --- a/docs/models/components/imageurlchunk.md +++ b/docs/models/components/imageurlchunk.md @@ -8,7 +8,7 @@ import { ImageURLChunk } from "@mistralai/mistralai/models/components"; let value: ImageURLChunk = { - imageUrl: "https://minor-ceramics.net/", + imageUrl: "https://competent-awareness.biz/", }; ``` diff --git a/docs/models/components/imageurlchunkimageurl.md b/docs/models/components/imageurlchunkimageurl.md index c9504ce..9ce9b41 100644 --- a/docs/models/components/imageurlchunkimageurl.md +++ b/docs/models/components/imageurlchunkimageurl.md @@ -7,7 +7,7 @@ ```typescript const value: components.ImageURL = { - url: "https://left-dusk.name/", + url: "https://innocent-masterpiece.org/", }; ``` diff --git a/docs/models/components/responseformats.md b/docs/models/components/responseformats.md index c13e204..0d8a19a 100644 --- a/docs/models/components/responseformats.md +++ b/docs/models/components/responseformats.md @@ -7,7 +7,7 @@ An object specifying the format that the model must output. Setting to `{ "type" ```typescript import { ResponseFormats } from "@mistralai/mistralai/models/components"; -let value: ResponseFormats = "json_object"; +let value: ResponseFormats = "text"; ``` ## Values diff --git a/docs/models/components/two.md b/docs/models/components/two.md index 00e7d6e..6150aa9 100644 --- a/docs/models/components/two.md +++ b/docs/models/components/two.md @@ -33,7 +33,11 @@ const value: components.ToolMessage = { ```typescript const value: components.UserMessage = { - content: "", + content: [ + { + text: "", + }, + ], }; ``` diff --git a/docs/models/components/usermessage.md b/docs/models/components/usermessage.md index f139966..4fc0859 100644 --- a/docs/models/components/usermessage.md +++ b/docs/models/components/usermessage.md @@ -6,7 +6,13 @@ import { UserMessage } from "@mistralai/mistralai/models/components"; let value: UserMessage = { - content: "", + content: [ + { + imageUrl: { + url: "https://first-gallery.biz", + }, + }, + ], }; ``` diff --git a/docs/models/components/usermessagecontent.md b/docs/models/components/usermessagecontent.md index a75360d..f949165 100644 --- a/docs/models/components/usermessagecontent.md +++ b/docs/models/components/usermessagecontent.md @@ -14,7 +14,7 @@ const value: string = ""; ```typescript const value: components.ContentChunk[] = [ { - imageUrl: "https://whispered-embarrassment.biz", + text: "", }, ]; ``` diff --git a/docs/models/operations/filesapiroutesdownloadfilerequest.md b/docs/models/operations/filesapiroutesdownloadfilerequest.md new file mode 100644 index 0000000..a87040c --- /dev/null +++ b/docs/models/operations/filesapiroutesdownloadfilerequest.md @@ -0,0 +1,17 @@ +# FilesApiRoutesDownloadFileRequest + +## Example Usage + +```typescript +import { FilesApiRoutesDownloadFileRequest } from "@mistralai/mistralai/models/operations"; + +let value: FilesApiRoutesDownloadFileRequest = { + fileId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `fileId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/jobsapiroutesbatchcancelbatchjobrequest.md b/docs/models/operations/jobsapiroutesbatchcancelbatchjobrequest.md new file mode 100644 index 0000000..1a062cc --- /dev/null +++ b/docs/models/operations/jobsapiroutesbatchcancelbatchjobrequest.md @@ -0,0 +1,17 @@ +# JobsApiRoutesBatchCancelBatchJobRequest + +## Example Usage + +```typescript +import { JobsApiRoutesBatchCancelBatchJobRequest } from "@mistralai/mistralai/models/operations"; + +let value: JobsApiRoutesBatchCancelBatchJobRequest = { + jobId: "f42e7e2a-71b3-4000-aebe-a84f576f25a1", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `jobId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/jobsapiroutesbatchgetbatchjobrequest.md b/docs/models/operations/jobsapiroutesbatchgetbatchjobrequest.md new file mode 100644 index 0000000..43c99a6 --- /dev/null +++ b/docs/models/operations/jobsapiroutesbatchgetbatchjobrequest.md @@ -0,0 +1,17 @@ +# JobsApiRoutesBatchGetBatchJobRequest + +## Example Usage + +```typescript +import { JobsApiRoutesBatchGetBatchJobRequest } from "@mistralai/mistralai/models/operations"; + +let value: JobsApiRoutesBatchGetBatchJobRequest = { + jobId: "9f0bd85c-178b-4136-99e9-2fd8e8edfe02", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `jobId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/jobsapiroutesbatchgetbatchjobsrequest.md b/docs/models/operations/jobsapiroutesbatchgetbatchjobsrequest.md new file mode 100644 index 0000000..c2d4193 --- /dev/null +++ b/docs/models/operations/jobsapiroutesbatchgetbatchjobsrequest.md @@ -0,0 +1,21 @@ +# JobsApiRoutesBatchGetBatchJobsRequest + +## Example Usage + +```typescript +import { JobsApiRoutesBatchGetBatchJobsRequest } from "@mistralai/mistralai/models/operations"; + +let value: JobsApiRoutesBatchGetBatchJobsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `pageSize` | *number* | :heavy_minus_sign: | N/A | +| `model` | *string* | :heavy_minus_sign: | N/A | +| `metadata` | Record | :heavy_minus_sign: | N/A | +| `createdAfter` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | +| `createdByMe` | *boolean* | :heavy_minus_sign: | N/A | +| `status` | [components.BatchJobStatus](../../models/components/batchjobstatus.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/jobsapiroutesfinetuningcancelfinetuningjobrequest.md b/docs/models/operations/jobsapiroutesfinetuningcancelfinetuningjobrequest.md index b442d30..669bc59 100644 --- a/docs/models/operations/jobsapiroutesfinetuningcancelfinetuningjobrequest.md +++ b/docs/models/operations/jobsapiroutesfinetuningcancelfinetuningjobrequest.md @@ -6,7 +6,7 @@ import { JobsApiRoutesFineTuningCancelFineTuningJobRequest } from "@mistralai/mistralai/models/operations"; let value: JobsApiRoutesFineTuningCancelFineTuningJobRequest = { - jobId: "90061434-2019-4ff6-a2a7-f1c43a3a8684", + jobId: "426296ef-849e-4684-9763-8458c5ed0471", }; ``` diff --git a/docs/models/operations/jobsapiroutesfinetuningcreatefinetuningjobresponse.md b/docs/models/operations/jobsapiroutesfinetuningcreatefinetuningjobresponse.md index 05ba802..6762031 100644 --- a/docs/models/operations/jobsapiroutesfinetuningcreatefinetuningjobresponse.md +++ b/docs/models/operations/jobsapiroutesfinetuningcreatefinetuningjobresponse.md @@ -9,16 +9,16 @@ OK ```typescript const value: components.JobOut = { - id: "211a368d-b420-4447-8ab4-62c0bcc45945", + id: "ded2a616-4d0f-4550-826e-1fd753900614", autoStart: false, hyperparameters: {}, - model: "codestral-latest", - status: "QUEUED", + model: "mistral-small-latest", + status: "STARTED", jobType: "", - createdAt: 799796, - modifiedAt: 76956, + createdAt: 12036, + modifiedAt: 115484, trainingFiles: [ - "849fa068-8a42-46f2-be87-e7b6ebb5ca32", + "9ff62a7f-1c43-4a3a-b868-4b65de035dff", ], }; ``` diff --git a/docs/models/operations/jobsapiroutesfinetuninggetfinetuningjobrequest.md b/docs/models/operations/jobsapiroutesfinetuninggetfinetuningjobrequest.md index ac00a3b..916c028 100644 --- a/docs/models/operations/jobsapiroutesfinetuninggetfinetuningjobrequest.md +++ b/docs/models/operations/jobsapiroutesfinetuninggetfinetuningjobrequest.md @@ -6,7 +6,7 @@ import { JobsApiRoutesFineTuningGetFineTuningJobRequest } from "@mistralai/mistralai/models/operations"; let value: JobsApiRoutesFineTuningGetFineTuningJobRequest = { - jobId: "f79d7f9d-ed2a-4616-84d0-f55026e1fd75", + jobId: "4f31f3b0-be46-45b3-8274-d38fadfcbff7", }; ``` diff --git a/docs/models/operations/jobsapiroutesfinetuningstartfinetuningjobrequest.md b/docs/models/operations/jobsapiroutesfinetuningstartfinetuningjobrequest.md index acf7b46..38bddf6 100644 --- a/docs/models/operations/jobsapiroutesfinetuningstartfinetuningjobrequest.md +++ b/docs/models/operations/jobsapiroutesfinetuningstartfinetuningjobrequest.md @@ -6,7 +6,7 @@ import { JobsApiRoutesFineTuningStartFineTuningJobRequest } from "@mistralai/mistralai/models/operations"; let value: JobsApiRoutesFineTuningStartFineTuningJobRequest = { - jobId: "65de035d-ffe4-4f31-8f3b-0be465b3274d", + jobId: "ba9b35ae-840b-4058-ae16-0594319baf0a", }; ``` diff --git a/docs/models/operations/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md b/docs/models/operations/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md index 84053ab..d6fdb3d 100644 --- a/docs/models/operations/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md +++ b/docs/models/operations/retrievemodelv1modelsmodelidgetresponseretrievemodelv1modelsmodelidget.md @@ -20,7 +20,7 @@ const value: components.BaseModelCard = { const value: components.FTModelCard = { id: "", capabilities: {}, - job: "Senior Assurance Supervisor", + job: "Human Division Representative", root: "", }; ``` diff --git a/docs/models/operations/status.md b/docs/models/operations/status.md index a46ddcf..ff534f8 100644 --- a/docs/models/operations/status.md +++ b/docs/models/operations/status.md @@ -7,7 +7,7 @@ The current job state to filter on. When set, the other results are not displaye ```typescript import { Status } from "@mistralai/mistralai/models/operations"; -let value: Status = "SUCCESS"; +let value: Status = "FAILED_VALIDATION"; ``` ## Values diff --git a/docs/sdks/batch/README.md b/docs/sdks/batch/README.md new file mode 100644 index 0000000..55a9c13 --- /dev/null +++ b/docs/sdks/batch/README.md @@ -0,0 +1,2 @@ +# Batch +(*batch*) \ No newline at end of file diff --git a/docs/sdks/files/README.md b/docs/sdks/files/README.md index d6dad70..9cae0a5 100644 --- a/docs/sdks/files/README.md +++ b/docs/sdks/files/README.md @@ -11,6 +11,7 @@ Files API * [list](#list) - List Files * [retrieve](#retrieve) - Retrieve File * [delete](#delete) - Delete File +* [download](#download) - Download File ## upload @@ -314,6 +315,82 @@ run(); ### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## download + +Download a file + +### Example Usage + +```typescript +import { Mistral } from "@mistralai/mistralai"; + +const mistral = new Mistral({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const result = await mistral.files.download({ + fileId: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { MistralCore } from "@mistralai/mistralai/core.js"; +import { filesDownload } from "@mistralai/mistralai/funcs/filesDownload.js"; + +// Use `MistralCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const mistral = new MistralCore({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const res = await filesDownload(mistral, { + fileId: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.FilesApiRoutesDownloadFileRequest](../../models/operations/filesapiroutesdownloadfilerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[ReadableStream](../../models/.md)\>** + +### Errors + | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/mistraljobs/README.md b/docs/sdks/mistraljobs/README.md new file mode 100644 index 0000000..a1a5b57 --- /dev/null +++ b/docs/sdks/mistraljobs/README.md @@ -0,0 +1,319 @@ +# MistralJobs +(*batch.jobs*) + +## Overview + +### Available Operations + +* [list](#list) - Get Batch Jobs +* [create](#create) - Create Batch Job +* [get](#get) - Get Batch Job +* [cancel](#cancel) - Cancel Batch Job + +## list + +Get a list of batch jobs for your organization and user. + +### Example Usage + +```typescript +import { Mistral } from "@mistralai/mistralai"; + +const mistral = new Mistral({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const result = await mistral.batch.jobs.list(); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { MistralCore } from "@mistralai/mistralai/core.js"; +import { batchJobsList } from "@mistralai/mistralai/funcs/batchJobsList.js"; + +// Use `MistralCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const mistral = new MistralCore({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchJobsList(mistral); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.JobsApiRoutesBatchGetBatchJobsRequest](../../models/operations/jobsapiroutesbatchgetbatchjobsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.BatchJobsOut](../../models/components/batchjobsout.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Create a new batch job, it will be queued for processing. + +### Example Usage + +```typescript +import { Mistral } from "@mistralai/mistralai"; + +const mistral = new Mistral({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const result = await mistral.batch.jobs.create({ + inputFiles: [ + "a621cf02-1cd9-4cf5-8403-315211a509a3", + ], + endpoint: "/v1/fim/completions", + model: "2", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { MistralCore } from "@mistralai/mistralai/core.js"; +import { batchJobsCreate } from "@mistralai/mistralai/funcs/batchJobsCreate.js"; + +// Use `MistralCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const mistral = new MistralCore({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchJobsCreate(mistral, { + inputFiles: [ + "a621cf02-1cd9-4cf5-8403-315211a509a3", + ], + endpoint: "/v1/fim/completions", + model: "2", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.BatchJobIn](../../models/components/batchjobin.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.BatchJobOut](../../models/components/batchjobout.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get a batch job details by its UUID. + +### Example Usage + +```typescript +import { Mistral } from "@mistralai/mistralai"; + +const mistral = new Mistral({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const result = await mistral.batch.jobs.get({ + jobId: "b888f774-3e7c-4135-a18c-6b985523c4bc", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { MistralCore } from "@mistralai/mistralai/core.js"; +import { batchJobsGet } from "@mistralai/mistralai/funcs/batchJobsGet.js"; + +// Use `MistralCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const mistral = new MistralCore({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchJobsGet(mistral, { + jobId: "b888f774-3e7c-4135-a18c-6b985523c4bc", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.JobsApiRoutesBatchGetBatchJobRequest](../../models/operations/jobsapiroutesbatchgetbatchjobrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.BatchJobOut](../../models/components/batchjobout.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## cancel + +Request the cancellation of a batch job. + +### Example Usage + +```typescript +import { Mistral } from "@mistralai/mistralai"; + +const mistral = new Mistral({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const result = await mistral.batch.jobs.cancel({ + jobId: "0f713502-9233-41c6-9ebd-c570b7edb496", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { MistralCore } from "@mistralai/mistralai/core.js"; +import { batchJobsCancel } from "@mistralai/mistralai/funcs/batchJobsCancel.js"; + +// Use `MistralCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const mistral = new MistralCore({ + apiKey: process.env["MISTRAL_API_KEY"] ?? "", +}); + +async function run() { + const res = await batchJobsCancel(mistral, { + jobId: "0f713502-9233-41c6-9ebd-c570b7edb496", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.JobsApiRoutesBatchCancelBatchJobRequest](../../models/operations/jobsapiroutesbatchcancelbatchjobrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.BatchJobOut](../../models/components/batchjobout.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/jsr.json b/jsr.json index e2ea147..beacbda 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@mistralai/mistralai", - "version": "1.2.0", + "version": "1.3.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index f932dde..b1efd57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mistralai/mistralai", - "version": "1.2.0", + "version": "1.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mistralai/mistralai", - "version": "1.2.0", + "version": "1.3.0", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index 1590937..12b1bfe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mistralai/mistralai", - "version": "1.2.0", + "version": "1.3.0", "author": "Speakeasy", "main": "./index.js", "sideEffects": false, diff --git a/src/funcs/batchJobsCancel.ts b/src/funcs/batchJobsCancel.ts new file mode 100644 index 0000000..46b614e --- /dev/null +++ b/src/funcs/batchJobsCancel.ts @@ -0,0 +1,130 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { MistralCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Cancel Batch Job + * + * @remarks + * Request the cancellation of a batch job. + */ +export async function batchJobsCancel( + client: MistralCore, + request: operations.JobsApiRoutesBatchCancelBatchJobRequest, + options?: RequestOptions, +): Promise< + Result< + components.BatchJobOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const parsed = safeParse( + request, + (value) => + operations.JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + job_id: encodeSimple("job_id", payload.job_id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/batch/jobs/{job_id}/cancel")(pathParams); + + const headers = new Headers({ + Accept: "application/json", + }); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + operationID: "jobs_api_routes_batch_cancel_batch_job", + oAuth2Scopes: [], + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result] = await M.match< + components.BatchJobOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, components.BatchJobOut$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/funcs/batchJobsCreate.ts b/src/funcs/batchJobsCreate.ts new file mode 100644 index 0000000..d7e095c --- /dev/null +++ b/src/funcs/batchJobsCreate.ts @@ -0,0 +1,120 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { MistralCore } from "../core.js"; +import { encodeJSON } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { Result } from "../types/fp.js"; + +/** + * Create Batch Job + * + * @remarks + * Create a new batch job, it will be queued for processing. + */ +export async function batchJobsCreate( + client: MistralCore, + request: components.BatchJobIn, + options?: RequestOptions, +): Promise< + Result< + components.BatchJobOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const parsed = safeParse( + request, + (value) => components.BatchJobIn$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = encodeJSON("body", payload, { explode: true }); + + const path = pathToFunc("/v1/batch/jobs")(); + + const headers = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + operationID: "jobs_api_routes_batch_create_batch_job", + oAuth2Scopes: [], + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result] = await M.match< + components.BatchJobOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, components.BatchJobOut$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/funcs/batchJobsGet.ts b/src/funcs/batchJobsGet.ts new file mode 100644 index 0000000..b991839 --- /dev/null +++ b/src/funcs/batchJobsGet.ts @@ -0,0 +1,130 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { MistralCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get Batch Job + * + * @remarks + * Get a batch job details by its UUID. + */ +export async function batchJobsGet( + client: MistralCore, + request: operations.JobsApiRoutesBatchGetBatchJobRequest, + options?: RequestOptions, +): Promise< + Result< + components.BatchJobOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const parsed = safeParse( + request, + (value) => + operations.JobsApiRoutesBatchGetBatchJobRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + job_id: encodeSimple("job_id", payload.job_id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/batch/jobs/{job_id}")(pathParams); + + const headers = new Headers({ + Accept: "application/json", + }); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + operationID: "jobs_api_routes_batch_get_batch_job", + oAuth2Scopes: [], + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result] = await M.match< + components.BatchJobOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, components.BatchJobOut$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/funcs/batchJobsList.ts b/src/funcs/batchJobsList.ts new file mode 100644 index 0000000..bba9ee7 --- /dev/null +++ b/src/funcs/batchJobsList.ts @@ -0,0 +1,133 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { MistralCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Get Batch Jobs + * + * @remarks + * Get a list of batch jobs for your organization and user. + */ +export async function batchJobsList( + client: MistralCore, + request?: operations.JobsApiRoutesBatchGetBatchJobsRequest | undefined, + options?: RequestOptions, +): Promise< + Result< + components.BatchJobsOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const parsed = safeParse( + request, + (value) => + operations.JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema.optional() + .parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/v1/batch/jobs")(); + + const query = encodeFormQuery({ + "created_after": payload?.created_after, + "created_by_me": payload?.created_by_me, + "metadata": payload?.metadata, + "model": payload?.model, + "page": payload?.page, + "page_size": payload?.page_size, + "status": payload?.status, + }); + + const headers = new Headers({ + Accept: "application/json", + }); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + operationID: "jobs_api_routes_batch_get_batch_jobs", + oAuth2Scopes: [], + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + path: path, + headers: headers, + query: query, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result] = await M.match< + components.BatchJobsOut, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, components.BatchJobsOut$inboundSchema), + M.fail(["4XX", "5XX"]), + )(response); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/funcs/filesDownload.ts b/src/funcs/filesDownload.ts new file mode 100644 index 0000000..72a3a26 --- /dev/null +++ b/src/funcs/filesDownload.ts @@ -0,0 +1,128 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { MistralCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { SDKError } from "../models/errors/sdkerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { Result } from "../types/fp.js"; + +/** + * Download File + * + * @remarks + * Download a file + */ +export async function filesDownload( + client: MistralCore, + request: operations.FilesApiRoutesDownloadFileRequest, + options?: RequestOptions, +): Promise< + Result< + ReadableStream, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const parsed = safeParse( + request, + (value) => + operations.FilesApiRoutesDownloadFileRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return parsed; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + file_id: encodeSimple("file_id", payload.file_id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/files/{file_id}/content")(pathParams); + + const headers = new Headers({ + Accept: "application/octet-stream", + }); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + operationID: "files_api_routes_download_file", + oAuth2Scopes: [], + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + path: path, + headers: headers, + body: body, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return requestRes; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result] = await M.match< + ReadableStream, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.stream(200, z.instanceof(ReadableStream)), + M.fail(["4XX", "5XX"]), + )(response); + if (!result.ok) { + return result; + } + + return result; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index d8eb9cc..781345c 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -55,8 +55,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.2", - sdkVersion: "1.2.0", + sdkVersion: "1.3.0", genVersion: "2.452.0", userAgent: - "speakeasy-sdk/typescript 1.2.0 2.452.0 0.0.2 @mistralai/mistralai", + "speakeasy-sdk/typescript 1.3.0 2.452.0 0.0.2 @mistralai/mistralai", } as const; diff --git a/src/models/components/apiendpoint.ts b/src/models/components/apiendpoint.ts new file mode 100644 index 0000000..245d55a --- /dev/null +++ b/src/models/components/apiendpoint.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +export const ApiEndpoint = { + RootV1ChatCompletions: "/v1/chat/completions", + RootV1Embeddings: "/v1/embeddings", + RootV1FimCompletions: "/v1/fim/completions", + RootV1Moderations: "/v1/moderations", +} as const; +export type ApiEndpoint = ClosedEnum; + +/** @internal */ +export const ApiEndpoint$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(ApiEndpoint); + +/** @internal */ +export const ApiEndpoint$outboundSchema: z.ZodNativeEnum = + ApiEndpoint$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ApiEndpoint$ { + /** @deprecated use `ApiEndpoint$inboundSchema` instead. */ + export const inboundSchema = ApiEndpoint$inboundSchema; + /** @deprecated use `ApiEndpoint$outboundSchema` instead. */ + export const outboundSchema = ApiEndpoint$outboundSchema; +} diff --git a/src/models/components/batcherror.ts b/src/models/components/batcherror.ts new file mode 100644 index 0000000..7b7cf3d --- /dev/null +++ b/src/models/components/batcherror.ts @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export type BatchError = { + message: string; + count?: number | undefined; +}; + +/** @internal */ +export const BatchError$inboundSchema: z.ZodType< + BatchError, + z.ZodTypeDef, + unknown +> = z.object({ + message: z.string(), + count: z.number().int().default(1), +}); + +/** @internal */ +export type BatchError$Outbound = { + message: string; + count: number; +}; + +/** @internal */ +export const BatchError$outboundSchema: z.ZodType< + BatchError$Outbound, + z.ZodTypeDef, + BatchError +> = z.object({ + message: z.string(), + count: z.number().int().default(1), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchError$ { + /** @deprecated use `BatchError$inboundSchema` instead. */ + export const inboundSchema = BatchError$inboundSchema; + /** @deprecated use `BatchError$outboundSchema` instead. */ + export const outboundSchema = BatchError$outboundSchema; + /** @deprecated use `BatchError$Outbound` instead. */ + export type Outbound = BatchError$Outbound; +} diff --git a/src/models/components/batchjobin.ts b/src/models/components/batchjobin.ts new file mode 100644 index 0000000..459f3f3 --- /dev/null +++ b/src/models/components/batchjobin.ts @@ -0,0 +1,77 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { + ApiEndpoint, + ApiEndpoint$inboundSchema, + ApiEndpoint$outboundSchema, +} from "./apiendpoint.js"; + +export type BatchJobIn = { + inputFiles: Array; + endpoint: ApiEndpoint; + model: string; + metadata?: { [k: string]: string } | null | undefined; + timeoutHours?: number | undefined; +}; + +/** @internal */ +export const BatchJobIn$inboundSchema: z.ZodType< + BatchJobIn, + z.ZodTypeDef, + unknown +> = z.object({ + input_files: z.array(z.string()), + endpoint: ApiEndpoint$inboundSchema, + model: z.string(), + metadata: z.nullable(z.record(z.string())).optional(), + timeout_hours: z.number().int().default(24), +}).transform((v) => { + return remap$(v, { + "input_files": "inputFiles", + "timeout_hours": "timeoutHours", + }); +}); + +/** @internal */ +export type BatchJobIn$Outbound = { + input_files: Array; + endpoint: string; + model: string; + metadata?: { [k: string]: string } | null | undefined; + timeout_hours: number; +}; + +/** @internal */ +export const BatchJobIn$outboundSchema: z.ZodType< + BatchJobIn$Outbound, + z.ZodTypeDef, + BatchJobIn +> = z.object({ + inputFiles: z.array(z.string()), + endpoint: ApiEndpoint$outboundSchema, + model: z.string(), + metadata: z.nullable(z.record(z.string())).optional(), + timeoutHours: z.number().int().default(24), +}).transform((v) => { + return remap$(v, { + inputFiles: "input_files", + timeoutHours: "timeout_hours", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchJobIn$ { + /** @deprecated use `BatchJobIn$inboundSchema` instead. */ + export const inboundSchema = BatchJobIn$inboundSchema; + /** @deprecated use `BatchJobIn$outboundSchema` instead. */ + export const outboundSchema = BatchJobIn$outboundSchema; + /** @deprecated use `BatchJobIn$Outbound` instead. */ + export type Outbound = BatchJobIn$Outbound; +} diff --git a/src/models/components/batchjobout.ts b/src/models/components/batchjobout.ts new file mode 100644 index 0000000..8c53094 --- /dev/null +++ b/src/models/components/batchjobout.ts @@ -0,0 +1,174 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { + BatchError, + BatchError$inboundSchema, + BatchError$Outbound, + BatchError$outboundSchema, +} from "./batcherror.js"; +import { + BatchJobStatus, + BatchJobStatus$inboundSchema, + BatchJobStatus$outboundSchema, +} from "./batchjobstatus.js"; + +export const BatchJobOutObject = { + Batch: "batch", +} as const; +export type BatchJobOutObject = ClosedEnum; + +export type BatchJobOut = { + id: string; + object?: "batch" | undefined; + inputFiles: Array; + metadata?: { [k: string]: any } | null | undefined; + endpoint: string; + model: string; + outputFile?: string | null | undefined; + errorFile?: string | null | undefined; + errors: Array; + status: BatchJobStatus; + createdAt: number; + totalRequests: number; + completedRequests: number; + succeededRequests: number; + failedRequests: number; + startedAt?: number | null | undefined; + completedAt?: number | null | undefined; +}; + +/** @internal */ +export const BatchJobOutObject$inboundSchema: z.ZodNativeEnum< + typeof BatchJobOutObject +> = z.nativeEnum(BatchJobOutObject); + +/** @internal */ +export const BatchJobOutObject$outboundSchema: z.ZodNativeEnum< + typeof BatchJobOutObject +> = BatchJobOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchJobOutObject$ { + /** @deprecated use `BatchJobOutObject$inboundSchema` instead. */ + export const inboundSchema = BatchJobOutObject$inboundSchema; + /** @deprecated use `BatchJobOutObject$outboundSchema` instead. */ + export const outboundSchema = BatchJobOutObject$outboundSchema; +} + +/** @internal */ +export const BatchJobOut$inboundSchema: z.ZodType< + BatchJobOut, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + object: z.literal("batch").default("batch"), + input_files: z.array(z.string()), + metadata: z.nullable(z.record(z.any())).optional(), + endpoint: z.string(), + model: z.string(), + output_file: z.nullable(z.string()).optional(), + error_file: z.nullable(z.string()).optional(), + errors: z.array(BatchError$inboundSchema), + status: BatchJobStatus$inboundSchema, + created_at: z.number().int(), + total_requests: z.number().int(), + completed_requests: z.number().int(), + succeeded_requests: z.number().int(), + failed_requests: z.number().int(), + started_at: z.nullable(z.number().int()).optional(), + completed_at: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + "input_files": "inputFiles", + "output_file": "outputFile", + "error_file": "errorFile", + "created_at": "createdAt", + "total_requests": "totalRequests", + "completed_requests": "completedRequests", + "succeeded_requests": "succeededRequests", + "failed_requests": "failedRequests", + "started_at": "startedAt", + "completed_at": "completedAt", + }); +}); + +/** @internal */ +export type BatchJobOut$Outbound = { + id: string; + object: "batch"; + input_files: Array; + metadata?: { [k: string]: any } | null | undefined; + endpoint: string; + model: string; + output_file?: string | null | undefined; + error_file?: string | null | undefined; + errors: Array; + status: string; + created_at: number; + total_requests: number; + completed_requests: number; + succeeded_requests: number; + failed_requests: number; + started_at?: number | null | undefined; + completed_at?: number | null | undefined; +}; + +/** @internal */ +export const BatchJobOut$outboundSchema: z.ZodType< + BatchJobOut$Outbound, + z.ZodTypeDef, + BatchJobOut +> = z.object({ + id: z.string(), + object: z.literal("batch").default("batch"), + inputFiles: z.array(z.string()), + metadata: z.nullable(z.record(z.any())).optional(), + endpoint: z.string(), + model: z.string(), + outputFile: z.nullable(z.string()).optional(), + errorFile: z.nullable(z.string()).optional(), + errors: z.array(BatchError$outboundSchema), + status: BatchJobStatus$outboundSchema, + createdAt: z.number().int(), + totalRequests: z.number().int(), + completedRequests: z.number().int(), + succeededRequests: z.number().int(), + failedRequests: z.number().int(), + startedAt: z.nullable(z.number().int()).optional(), + completedAt: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + inputFiles: "input_files", + outputFile: "output_file", + errorFile: "error_file", + createdAt: "created_at", + totalRequests: "total_requests", + completedRequests: "completed_requests", + succeededRequests: "succeeded_requests", + failedRequests: "failed_requests", + startedAt: "started_at", + completedAt: "completed_at", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchJobOut$ { + /** @deprecated use `BatchJobOut$inboundSchema` instead. */ + export const inboundSchema = BatchJobOut$inboundSchema; + /** @deprecated use `BatchJobOut$outboundSchema` instead. */ + export const outboundSchema = BatchJobOut$outboundSchema; + /** @deprecated use `BatchJobOut$Outbound` instead. */ + export type Outbound = BatchJobOut$Outbound; +} diff --git a/src/models/components/batchjobsout.ts b/src/models/components/batchjobsout.ts new file mode 100644 index 0000000..39e2c5f --- /dev/null +++ b/src/models/components/batchjobsout.ts @@ -0,0 +1,86 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; +import { + BatchJobOut, + BatchJobOut$inboundSchema, + BatchJobOut$Outbound, + BatchJobOut$outboundSchema, +} from "./batchjobout.js"; + +export const BatchJobsOutObject = { + List: "list", +} as const; +export type BatchJobsOutObject = ClosedEnum; + +export type BatchJobsOut = { + data?: Array | undefined; + object?: "list" | undefined; + total: number; +}; + +/** @internal */ +export const BatchJobsOutObject$inboundSchema: z.ZodNativeEnum< + typeof BatchJobsOutObject +> = z.nativeEnum(BatchJobsOutObject); + +/** @internal */ +export const BatchJobsOutObject$outboundSchema: z.ZodNativeEnum< + typeof BatchJobsOutObject +> = BatchJobsOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchJobsOutObject$ { + /** @deprecated use `BatchJobsOutObject$inboundSchema` instead. */ + export const inboundSchema = BatchJobsOutObject$inboundSchema; + /** @deprecated use `BatchJobsOutObject$outboundSchema` instead. */ + export const outboundSchema = BatchJobsOutObject$outboundSchema; +} + +/** @internal */ +export const BatchJobsOut$inboundSchema: z.ZodType< + BatchJobsOut, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.array(BatchJobOut$inboundSchema).optional(), + object: z.literal("list").default("list"), + total: z.number().int(), +}); + +/** @internal */ +export type BatchJobsOut$Outbound = { + data?: Array | undefined; + object: "list"; + total: number; +}; + +/** @internal */ +export const BatchJobsOut$outboundSchema: z.ZodType< + BatchJobsOut$Outbound, + z.ZodTypeDef, + BatchJobsOut +> = z.object({ + data: z.array(BatchJobOut$outboundSchema).optional(), + object: z.literal("list").default("list"), + total: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchJobsOut$ { + /** @deprecated use `BatchJobsOut$inboundSchema` instead. */ + export const inboundSchema = BatchJobsOut$inboundSchema; + /** @deprecated use `BatchJobsOut$outboundSchema` instead. */ + export const outboundSchema = BatchJobsOut$outboundSchema; + /** @deprecated use `BatchJobsOut$Outbound` instead. */ + export type Outbound = BatchJobsOut$Outbound; +} diff --git a/src/models/components/batchjobstatus.ts b/src/models/components/batchjobstatus.ts new file mode 100644 index 0000000..16ca41a --- /dev/null +++ b/src/models/components/batchjobstatus.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +export const BatchJobStatus = { + Queued: "QUEUED", + Running: "RUNNING", + Success: "SUCCESS", + Failed: "FAILED", + TimeoutExceeded: "TIMEOUT_EXCEEDED", + CancellationRequested: "CANCELLATION_REQUESTED", + Cancelled: "CANCELLED", +} as const; +export type BatchJobStatus = ClosedEnum; + +/** @internal */ +export const BatchJobStatus$inboundSchema: z.ZodNativeEnum< + typeof BatchJobStatus +> = z.nativeEnum(BatchJobStatus); + +/** @internal */ +export const BatchJobStatus$outboundSchema: z.ZodNativeEnum< + typeof BatchJobStatus +> = BatchJobStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchJobStatus$ { + /** @deprecated use `BatchJobStatus$inboundSchema` instead. */ + export const inboundSchema = BatchJobStatus$inboundSchema; + /** @deprecated use `BatchJobStatus$outboundSchema` instead. */ + export const outboundSchema = BatchJobStatus$outboundSchema; +} diff --git a/src/models/components/chatcompletionchoice.ts b/src/models/components/chatcompletionchoice.ts index a761741..612d87d 100644 --- a/src/models/components/chatcompletionchoice.ts +++ b/src/models/components/chatcompletionchoice.ts @@ -10,11 +10,11 @@ import { Unrecognized, } from "../../types/enums.js"; import { - DeltaMessage, - DeltaMessage$inboundSchema, - DeltaMessage$Outbound, - DeltaMessage$outboundSchema, -} from "./deltamessage.js"; + AssistantMessage, + AssistantMessage$inboundSchema, + AssistantMessage$Outbound, + AssistantMessage$outboundSchema, +} from "./assistantmessage.js"; export const FinishReason = { Stop: "stop", @@ -27,7 +27,7 @@ export type FinishReason = OpenEnum; export type ChatCompletionChoice = { index: number; - message: DeltaMessage; + message: AssistantMessage; finishReason: FinishReason; }; @@ -70,7 +70,7 @@ export const ChatCompletionChoice$inboundSchema: z.ZodType< unknown > = z.object({ index: z.number().int(), - message: DeltaMessage$inboundSchema, + message: AssistantMessage$inboundSchema, finish_reason: FinishReason$inboundSchema, }).transform((v) => { return remap$(v, { @@ -81,7 +81,7 @@ export const ChatCompletionChoice$inboundSchema: z.ZodType< /** @internal */ export type ChatCompletionChoice$Outbound = { index: number; - message: DeltaMessage$Outbound; + message: AssistantMessage$Outbound; finish_reason: string; }; @@ -92,7 +92,7 @@ export const ChatCompletionChoice$outboundSchema: z.ZodType< ChatCompletionChoice > = z.object({ index: z.number().int(), - message: DeltaMessage$outboundSchema, + message: AssistantMessage$outboundSchema, finishReason: FinishReason$outboundSchema, }).transform((v) => { return remap$(v, { diff --git a/src/models/components/index.ts b/src/models/components/index.ts index fb51a98..3b4180b 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -4,9 +4,15 @@ export * from "./agentscompletionrequest.js"; export * from "./agentscompletionstreamrequest.js"; +export * from "./apiendpoint.js"; export * from "./archiveftmodelout.js"; export * from "./assistantmessage.js"; export * from "./basemodelcard.js"; +export * from "./batcherror.js"; +export * from "./batchjobin.js"; +export * from "./batchjobout.js"; +export * from "./batchjobsout.js"; +export * from "./batchjobstatus.js"; export * from "./chatclassificationrequest.js"; export * from "./chatcompletionchoice.js"; export * from "./chatcompletionrequest.js"; diff --git a/src/models/operations/filesapiroutesdownloadfile.ts b/src/models/operations/filesapiroutesdownloadfile.ts new file mode 100644 index 0000000..23f06f8 --- /dev/null +++ b/src/models/operations/filesapiroutesdownloadfile.ts @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; + +export type FilesApiRoutesDownloadFileRequest = { + fileId: string; +}; + +/** @internal */ +export const FilesApiRoutesDownloadFileRequest$inboundSchema: z.ZodType< + FilesApiRoutesDownloadFileRequest, + z.ZodTypeDef, + unknown +> = z.object({ + file_id: z.string(), +}).transform((v) => { + return remap$(v, { + "file_id": "fileId", + }); +}); + +/** @internal */ +export type FilesApiRoutesDownloadFileRequest$Outbound = { + file_id: string; +}; + +/** @internal */ +export const FilesApiRoutesDownloadFileRequest$outboundSchema: z.ZodType< + FilesApiRoutesDownloadFileRequest$Outbound, + z.ZodTypeDef, + FilesApiRoutesDownloadFileRequest +> = z.object({ + fileId: z.string(), +}).transform((v) => { + return remap$(v, { + fileId: "file_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FilesApiRoutesDownloadFileRequest$ { + /** @deprecated use `FilesApiRoutesDownloadFileRequest$inboundSchema` instead. */ + export const inboundSchema = FilesApiRoutesDownloadFileRequest$inboundSchema; + /** @deprecated use `FilesApiRoutesDownloadFileRequest$outboundSchema` instead. */ + export const outboundSchema = + FilesApiRoutesDownloadFileRequest$outboundSchema; + /** @deprecated use `FilesApiRoutesDownloadFileRequest$Outbound` instead. */ + export type Outbound = FilesApiRoutesDownloadFileRequest$Outbound; +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index d0e9ad3..291ac2c 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -4,9 +4,13 @@ export * from "./deletemodelv1modelsmodeliddelete.js"; export * from "./filesapiroutesdeletefile.js"; +export * from "./filesapiroutesdownloadfile.js"; export * from "./filesapirouteslistfiles.js"; export * from "./filesapiroutesretrievefile.js"; export * from "./filesapiroutesuploadfile.js"; +export * from "./jobsapiroutesbatchcancelbatchjob.js"; +export * from "./jobsapiroutesbatchgetbatchjob.js"; +export * from "./jobsapiroutesbatchgetbatchjobs.js"; export * from "./jobsapiroutesfinetuningarchivefinetunedmodel.js"; export * from "./jobsapiroutesfinetuningcancelfinetuningjob.js"; export * from "./jobsapiroutesfinetuningcreatefinetuningjob.js"; diff --git a/src/models/operations/jobsapiroutesbatchcancelbatchjob.ts b/src/models/operations/jobsapiroutesbatchcancelbatchjob.ts new file mode 100644 index 0000000..71a068d --- /dev/null +++ b/src/models/operations/jobsapiroutesbatchcancelbatchjob.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; + +export type JobsApiRoutesBatchCancelBatchJobRequest = { + jobId: string; +}; + +/** @internal */ +export const JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema: z.ZodType< + JobsApiRoutesBatchCancelBatchJobRequest, + z.ZodTypeDef, + unknown +> = z.object({ + job_id: z.string(), +}).transform((v) => { + return remap$(v, { + "job_id": "jobId", + }); +}); + +/** @internal */ +export type JobsApiRoutesBatchCancelBatchJobRequest$Outbound = { + job_id: string; +}; + +/** @internal */ +export const JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema: z.ZodType< + JobsApiRoutesBatchCancelBatchJobRequest$Outbound, + z.ZodTypeDef, + JobsApiRoutesBatchCancelBatchJobRequest +> = z.object({ + jobId: z.string(), +}).transform((v) => { + return remap$(v, { + jobId: "job_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace JobsApiRoutesBatchCancelBatchJobRequest$ { + /** @deprecated use `JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema` instead. */ + export const inboundSchema = + JobsApiRoutesBatchCancelBatchJobRequest$inboundSchema; + /** @deprecated use `JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema` instead. */ + export const outboundSchema = + JobsApiRoutesBatchCancelBatchJobRequest$outboundSchema; + /** @deprecated use `JobsApiRoutesBatchCancelBatchJobRequest$Outbound` instead. */ + export type Outbound = JobsApiRoutesBatchCancelBatchJobRequest$Outbound; +} diff --git a/src/models/operations/jobsapiroutesbatchgetbatchjob.ts b/src/models/operations/jobsapiroutesbatchgetbatchjob.ts new file mode 100644 index 0000000..b86809e --- /dev/null +++ b/src/models/operations/jobsapiroutesbatchgetbatchjob.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; + +export type JobsApiRoutesBatchGetBatchJobRequest = { + jobId: string; +}; + +/** @internal */ +export const JobsApiRoutesBatchGetBatchJobRequest$inboundSchema: z.ZodType< + JobsApiRoutesBatchGetBatchJobRequest, + z.ZodTypeDef, + unknown +> = z.object({ + job_id: z.string(), +}).transform((v) => { + return remap$(v, { + "job_id": "jobId", + }); +}); + +/** @internal */ +export type JobsApiRoutesBatchGetBatchJobRequest$Outbound = { + job_id: string; +}; + +/** @internal */ +export const JobsApiRoutesBatchGetBatchJobRequest$outboundSchema: z.ZodType< + JobsApiRoutesBatchGetBatchJobRequest$Outbound, + z.ZodTypeDef, + JobsApiRoutesBatchGetBatchJobRequest +> = z.object({ + jobId: z.string(), +}).transform((v) => { + return remap$(v, { + jobId: "job_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace JobsApiRoutesBatchGetBatchJobRequest$ { + /** @deprecated use `JobsApiRoutesBatchGetBatchJobRequest$inboundSchema` instead. */ + export const inboundSchema = + JobsApiRoutesBatchGetBatchJobRequest$inboundSchema; + /** @deprecated use `JobsApiRoutesBatchGetBatchJobRequest$outboundSchema` instead. */ + export const outboundSchema = + JobsApiRoutesBatchGetBatchJobRequest$outboundSchema; + /** @deprecated use `JobsApiRoutesBatchGetBatchJobRequest$Outbound` instead. */ + export type Outbound = JobsApiRoutesBatchGetBatchJobRequest$Outbound; +} diff --git a/src/models/operations/jobsapiroutesbatchgetbatchjobs.ts b/src/models/operations/jobsapiroutesbatchgetbatchjobs.ts new file mode 100644 index 0000000..84e2cd3 --- /dev/null +++ b/src/models/operations/jobsapiroutesbatchgetbatchjobs.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; + +export type JobsApiRoutesBatchGetBatchJobsRequest = { + page?: number | undefined; + pageSize?: number | undefined; + model?: string | null | undefined; + metadata?: { [k: string]: any } | null | undefined; + createdAfter?: Date | null | undefined; + createdByMe?: boolean | undefined; + status?: components.BatchJobStatus | null | undefined; +}; + +/** @internal */ +export const JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema: z.ZodType< + JobsApiRoutesBatchGetBatchJobsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + page: z.number().int().default(0), + page_size: z.number().int().default(100), + model: z.nullable(z.string()).optional(), + metadata: z.nullable(z.record(z.any())).optional(), + created_after: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + created_by_me: z.boolean().default(false), + status: z.nullable(components.BatchJobStatus$inboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + "page_size": "pageSize", + "created_after": "createdAfter", + "created_by_me": "createdByMe", + }); +}); + +/** @internal */ +export type JobsApiRoutesBatchGetBatchJobsRequest$Outbound = { + page: number; + page_size: number; + model?: string | null | undefined; + metadata?: { [k: string]: any } | null | undefined; + created_after?: string | null | undefined; + created_by_me: boolean; + status?: string | null | undefined; +}; + +/** @internal */ +export const JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema: z.ZodType< + JobsApiRoutesBatchGetBatchJobsRequest$Outbound, + z.ZodTypeDef, + JobsApiRoutesBatchGetBatchJobsRequest +> = z.object({ + page: z.number().int().default(0), + pageSize: z.number().int().default(100), + model: z.nullable(z.string()).optional(), + metadata: z.nullable(z.record(z.any())).optional(), + createdAfter: z.nullable(z.date().transform(v => v.toISOString())).optional(), + createdByMe: z.boolean().default(false), + status: z.nullable(components.BatchJobStatus$outboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + pageSize: "page_size", + createdAfter: "created_after", + createdByMe: "created_by_me", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace JobsApiRoutesBatchGetBatchJobsRequest$ { + /** @deprecated use `JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema` instead. */ + export const inboundSchema = + JobsApiRoutesBatchGetBatchJobsRequest$inboundSchema; + /** @deprecated use `JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema` instead. */ + export const outboundSchema = + JobsApiRoutesBatchGetBatchJobsRequest$outboundSchema; + /** @deprecated use `JobsApiRoutesBatchGetBatchJobsRequest$Outbound` instead. */ + export type Outbound = JobsApiRoutesBatchGetBatchJobsRequest$Outbound; +} diff --git a/src/sdk/batch.ts b/src/sdk/batch.ts new file mode 100644 index 0000000..d8a7c67 --- /dev/null +++ b/src/sdk/batch.ts @@ -0,0 +1,13 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "../lib/sdks.js"; +import { MistralJobs } from "./mistraljobs.js"; + +export class Batch extends ClientSDK { + private _jobs?: MistralJobs; + get jobs(): MistralJobs { + return (this._jobs ??= new MistralJobs(this._options)); + } +} diff --git a/src/sdk/files.ts b/src/sdk/files.ts index 78082f4..957b707 100644 --- a/src/sdk/files.ts +++ b/src/sdk/files.ts @@ -3,6 +3,7 @@ */ import { filesDelete } from "../funcs/filesDelete.js"; +import { filesDownload } from "../funcs/filesDownload.js"; import { filesList } from "../funcs/filesList.js"; import { filesRetrieve } from "../funcs/filesRetrieve.js"; import { filesUpload } from "../funcs/filesUpload.js"; @@ -83,4 +84,21 @@ export class Files extends ClientSDK { options, )); } + + /** + * Download File + * + * @remarks + * Download a file + */ + async download( + request: operations.FilesApiRoutesDownloadFileRequest, + options?: RequestOptions, + ): Promise> { + return unwrapAsync(filesDownload( + this, + request, + options, + )); + } } diff --git a/src/sdk/mistraljobs.ts b/src/sdk/mistraljobs.ts new file mode 100644 index 0000000..921aae9 --- /dev/null +++ b/src/sdk/mistraljobs.ts @@ -0,0 +1,82 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { batchJobsCancel } from "../funcs/batchJobsCancel.js"; +import { batchJobsCreate } from "../funcs/batchJobsCreate.js"; +import { batchJobsGet } from "../funcs/batchJobsGet.js"; +import { batchJobsList } from "../funcs/batchJobsList.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class MistralJobs extends ClientSDK { + /** + * Get Batch Jobs + * + * @remarks + * Get a list of batch jobs for your organization and user. + */ + async list( + request?: operations.JobsApiRoutesBatchGetBatchJobsRequest | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(batchJobsList( + this, + request, + options, + )); + } + + /** + * Create Batch Job + * + * @remarks + * Create a new batch job, it will be queued for processing. + */ + async create( + request: components.BatchJobIn, + options?: RequestOptions, + ): Promise { + return unwrapAsync(batchJobsCreate( + this, + request, + options, + )); + } + + /** + * Get Batch Job + * + * @remarks + * Get a batch job details by its UUID. + */ + async get( + request: operations.JobsApiRoutesBatchGetBatchJobRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(batchJobsGet( + this, + request, + options, + )); + } + + /** + * Cancel Batch Job + * + * @remarks + * Request the cancellation of a batch job. + */ + async cancel( + request: operations.JobsApiRoutesBatchCancelBatchJobRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(batchJobsCancel( + this, + request, + options, + )); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 4b85871..5453f22 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -4,6 +4,7 @@ import { ClientSDK } from "../lib/sdks.js"; import { Agents } from "./agents.js"; +import { Batch } from "./batch.js"; import { Chat } from "./chat.js"; import { Classifiers } from "./classifiers.js"; import { Embeddings } from "./embeddings.js"; @@ -28,6 +29,11 @@ export class Mistral extends ClientSDK { return (this._fineTuning ??= new FineTuning(this._options)); } + private _batch?: Batch; + get batch(): Batch { + return (this._batch ??= new Batch(this._options)); + } + private _chat?: Chat; get chat(): Chat { return (this._chat ??= new Chat(this._options));