diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a8eb963..80ef7b5 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,20 +1,20 @@ lockVersion: 2.0.0 id: 81b65c50-f2e3-40a3-bd65-346524007b3d management: - docChecksum: 87135817a5a746d7466c41070e5f581e + docChecksum: ad1a7d6946828a089ca3831e257d307d docVersion: 0.0.2 - speakeasyVersion: 1.373.1 - generationVersion: 2.399.0 - releaseVersion: 1.1.3 - configChecksum: 82af20b5faaac173abb6d630c7f4194f + speakeasyVersion: 1.376.0 + generationVersion: 2.402.5 + releaseVersion: 1.0.3 + configChecksum: 29f53c823f9a93ba50ba681063a0f8e8 repoURL: https://github.com/mistralai/client-ts.git installationURL: https://github.com/mistralai/client-ts published: true features: typescript: additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.8 - core: 3.13.2 + constsAndDefaults: 0.1.10 + core: 3.14.1 defaultEnabledRetries: 0.1.0 devContainers: 2.90.0 envVarSecurityUsage: 0.1.1 @@ -187,33 +187,53 @@ generatedFiles: - docs/models/components/loc.md - docs/models/components/validationerror.md - docs/models/components/deletemodelout.md + - docs/models/components/ftmodeloutobject.md - docs/models/components/ftmodelout.md - docs/models/components/ftmodelcapabilitiesout.md - docs/models/components/updateftmodelin.md + - docs/models/components/archiveftmodeloutobject.md - docs/models/components/archiveftmodelout.md + - docs/models/components/unarchiveftmodeloutobject.md - docs/models/components/unarchiveftmodelout.md + - docs/models/components/purpose.md - docs/models/components/uploadfileout.md - docs/models/components/source.md - docs/models/components/sampletype.md - docs/models/components/listfilesout.md + - docs/models/components/fileschemapurpose.md - docs/models/components/fileschema.md + - docs/models/components/retrievefileoutpurpose.md - docs/models/components/retrievefileout.md - docs/models/components/deletefileout.md + - docs/models/components/jobsoutobject.md - docs/models/components/jobsout.md - docs/models/components/status.md + - docs/models/components/objectt.md + - docs/models/components/integrations.md + - docs/models/components/repositories.md - docs/models/components/jobout.md - docs/models/components/jobmetadataout.md + - docs/models/components/githubrepositoryouttype.md - docs/models/components/githubrepositoryout.md + - docs/models/components/type.md - docs/models/components/wandbintegrationout.md - docs/models/components/finetuneablemodel.md - docs/models/components/trainingparameters.md + - docs/models/components/legacyjobmetadataoutobject.md - docs/models/components/legacyjobmetadataout.md + - docs/models/components/jobinintegrations.md + - docs/models/components/jobinrepositories.md - docs/models/components/jobin.md + - docs/models/components/githubrepositoryintype.md - docs/models/components/githubrepositoryin.md + - docs/models/components/wandbintegrationtype.md - docs/models/components/wandbintegration.md - docs/models/components/trainingparametersin.md - docs/models/components/trainingfile.md - docs/models/components/detailedjoboutstatus.md + - docs/models/components/detailedjoboutobject.md + - docs/models/components/detailedjoboutintegrations.md + - docs/models/components/detailedjoboutrepositories.md - docs/models/components/detailedjobout.md - docs/models/components/checkpointout.md - docs/models/components/metricout.md @@ -280,6 +300,7 @@ generatedFiles: - docs/models/operations/jobsapiroutesfinetuningupdatefinetunedmodelrequest.md - docs/models/operations/jobsapiroutesfinetuningarchivefinetunedmodelrequest.md - docs/models/operations/jobsapiroutesfinetuningunarchivefinetunedmodelrequest.md + - docs/models/operations/purpose.md - docs/models/operations/filet.md - docs/models/operations/filesapiroutesuploadfilemultipartbodyparams.md - docs/models/operations/filesapiroutesretrievefilerequest.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index db7ed65..a60ce30 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -15,7 +15,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true typescript: - version: 1.1.3 + version: 1.0.3 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 607c25a..784c19e 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.373.1 +speakeasyVersion: 1.376.0 sources: mistral-azure-source: sourceNamespace: mistral-openapi-azure @@ -14,10 +14,11 @@ sources: - latest mistral-openapi: sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:088d899162941380ec90445852dc7e8c65a8e2eab6b32f552fd7f4fc6f152e76 - sourceBlobDigest: sha256:feb2a952c0f5757a656e8fed5614e28bc4da195cbeb548b5aaf4fc09aee4ddac + sourceRevisionDigest: sha256:421a4bd55fd50ba00d6ebf2db603888009e9996b642b0499110c223fd6ca21c2 + sourceBlobDigest: sha256:1c87b4b8287f6a3083167c13ab59c5e7ac180ab7e19ad1532f3f46495cc12a26 tags: - latest + - main targets: mistralai-azure-sdk: source: mistral-azure-source @@ -34,9 +35,9 @@ targets: mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi - sourceRevisionDigest: sha256:088d899162941380ec90445852dc7e8c65a8e2eab6b32f552fd7f4fc6f152e76 - sourceBlobDigest: sha256:feb2a952c0f5757a656e8fed5614e28bc4da195cbeb548b5aaf4fc09aee4ddac - outLocation: /Users/gaspard/public-mistral/client-ts + sourceRevisionDigest: sha256:421a4bd55fd50ba00d6ebf2db603888009e9996b642b0499110c223fd6ca21c2 + sourceBlobDigest: sha256:1c87b4b8287f6a3083167c13ab59c5e7ac180ab7e19ad1532f3f46495cc12a26 + outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 9a2a29f..1475735 100644 --- a/README.md +++ b/README.md @@ -577,7 +577,9 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). ## Debugging -To log HTTP requests and responses, you can pass a logger that matches `console`'s interface as an SDK option. +You can setup your SDK to emit debug logs for SDK requests and responses. + +You can pass a logger that matches `console`'s interface as an SDK option. > [!WARNING] > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production. @@ -587,6 +589,8 @@ import { Mistral } from "@mistralai/mistralai"; const sdk = new Mistral({ debugLogger: console }); ``` + +You can also enable a default debug logger by setting an environment variable `MISTRAL_DEBUG` to true. diff --git a/RELEASES.md b/RELEASES.md index 0f1809c..c31b0ae 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -28,4 +28,14 @@ Based on: ### Generated - [typescript v1.0.2] . ### Releases -- [NPM v1.0.2] https://www.npmjs.com/package/@mistralai/mistralai/v/1.0.2 - . \ No newline at end of file +- [NPM v1.0.2] https://www.npmjs.com/package/@mistralai/mistralai/v/1.0.2 - . + +## 2024-08-20 08:43:27 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.376.0 (2.402.5) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.0.3] . +### Releases +- [NPM v1.0.3] https://www.npmjs.com/package/@mistralai/mistralai/v/1.0.3 - . \ No newline at end of file diff --git a/docs/models/components/archiveftmodelout.md b/docs/models/components/archiveftmodelout.md index 1addbed..28f6c63 100644 --- a/docs/models/components/archiveftmodelout.md +++ b/docs/models/components/archiveftmodelout.md @@ -12,8 +12,8 @@ let value: ArchiveFTModelOut = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `object` | *string* | :heavy_minus_sign: | N/A | -| `archived` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `object` | [components.ArchiveFTModelOutObject](../../models/components/archiveftmodeloutobject.md) | :heavy_minus_sign: | N/A | +| `archived` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/archiveftmodeloutobject.md b/docs/models/components/archiveftmodeloutobject.md new file mode 100644 index 0000000..151f852 --- /dev/null +++ b/docs/models/components/archiveftmodeloutobject.md @@ -0,0 +1,15 @@ +# ArchiveFTModelOutObject + +## Example Usage + +```typescript +import { ArchiveFTModelOutObject } from "@mistralai/mistralai/models/components"; + +let value: ArchiveFTModelOutObject = "model"; +``` + +## Values + +```typescript +"model" +``` \ No newline at end of file diff --git a/docs/models/components/detailedjobout.md b/docs/models/components/detailedjobout.md index 586a64e..c06611b 100644 --- a/docs/models/components/detailedjobout.md +++ b/docs/models/components/detailedjobout.md @@ -39,12 +39,12 @@ let value: DetailedJobOut = { | `modifiedAt` | *number* | :heavy_check_mark: | N/A | | `trainingFiles` | *string*[] | :heavy_check_mark: | N/A | | `validationFiles` | *string*[] | :heavy_minus_sign: | N/A | -| `object` | *string* | :heavy_minus_sign: | N/A | +| `object` | [components.DetailedJobOutObject](../../models/components/detailedjoboutobject.md) | :heavy_minus_sign: | N/A | | `fineTunedModel` | *string* | :heavy_minus_sign: | N/A | | `suffix` | *string* | :heavy_minus_sign: | N/A | -| `integrations` | [components.WandbIntegrationOut](../../models/components/wandbintegrationout.md)[] | :heavy_minus_sign: | N/A | +| `integrations` | *components.DetailedJobOutIntegrations*[] | :heavy_minus_sign: | N/A | | `trainedTokens` | *number* | :heavy_minus_sign: | N/A | -| `repositories` | [components.GithubRepositoryOut](../../models/components/githubrepositoryout.md)[] | :heavy_minus_sign: | N/A | +| `repositories` | *components.DetailedJobOutRepositories*[] | :heavy_minus_sign: | N/A | | `metadata` | [components.JobMetadataOut](../../models/components/jobmetadataout.md) | :heavy_minus_sign: | N/A | | `events` | [components.EventOut](../../models/components/eventout.md)[] | :heavy_minus_sign: | Event items are created every time the status of a fine-tuning job changes. The timestamped list of all events is accessible here. | | `checkpoints` | [components.CheckpointOut](../../models/components/checkpointout.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/detailedjoboutintegrations.md b/docs/models/components/detailedjoboutintegrations.md new file mode 100644 index 0000000..9ff0b4e --- /dev/null +++ b/docs/models/components/detailedjoboutintegrations.md @@ -0,0 +1,20 @@ +# DetailedJobOutIntegrations + +## Example Usage + +```typescript +import { DetailedJobOutIntegrations } from "@mistralai/mistralai/models/components"; + +let value: DetailedJobOutIntegrations = { + project: "", +}; +``` + +## Supported Types + +### `components.WandbIntegrationOut` + +```typescript +const value: components.WandbIntegrationOut = /* values here */ +``` + diff --git a/docs/models/components/detailedjoboutobject.md b/docs/models/components/detailedjoboutobject.md new file mode 100644 index 0000000..58204be --- /dev/null +++ b/docs/models/components/detailedjoboutobject.md @@ -0,0 +1,15 @@ +# DetailedJobOutObject + +## Example Usage + +```typescript +import { DetailedJobOutObject } from "@mistralai/mistralai/models/components"; + +let value: DetailedJobOutObject = "job"; +``` + +## Values + +```typescript +"job" +``` \ No newline at end of file diff --git a/docs/models/components/detailedjoboutrepositories.md b/docs/models/components/detailedjoboutrepositories.md new file mode 100644 index 0000000..d7a3b57 --- /dev/null +++ b/docs/models/components/detailedjoboutrepositories.md @@ -0,0 +1,22 @@ +# DetailedJobOutRepositories + +## Example Usage + +```typescript +import { DetailedJobOutRepositories } from "@mistralai/mistralai/models/components"; + +let value: DetailedJobOutRepositories = { + name: "", + owner: "", + commitId: "", +}; +``` + +## Supported Types + +### `components.GithubRepositoryOut` + +```typescript +const value: components.GithubRepositoryOut = /* values here */ +``` + diff --git a/docs/models/components/fileschema.md b/docs/models/components/fileschema.md index 49f8bb5..26488cc 100644 --- a/docs/models/components/fileschema.md +++ b/docs/models/components/fileschema.md @@ -25,7 +25,7 @@ let value: FileSchema = { | `bytes` | *number* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | | `createdAt` | *number* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | | `filename` | *string* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | -| `purpose` | *string* | :heavy_check_mark: | The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. | fine-tune | +| `purpose` | [components.FileSchemaPurpose](../../models/components/fileschemapurpose.md) | :heavy_check_mark: | The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. | fine-tune | | `sampleType` | [components.SampleType](../../models/components/sampletype.md) | :heavy_check_mark: | N/A | | | `numLines` | *number* | :heavy_minus_sign: | N/A | | | `source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/fileschemapurpose.md b/docs/models/components/fileschemapurpose.md new file mode 100644 index 0000000..2387b1e --- /dev/null +++ b/docs/models/components/fileschemapurpose.md @@ -0,0 +1,19 @@ +# FileSchemaPurpose + +The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. + +## Example Usage + +```typescript +import { FileSchemaPurpose } from "@mistralai/mistralai/models/components"; + +let value: FileSchemaPurpose = "fine-tune"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"fine-tune" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/ftmodelout.md b/docs/models/components/ftmodelout.md index 9df4a5f..873f48f 100644 --- a/docs/models/components/ftmodelout.md +++ b/docs/models/components/ftmodelout.md @@ -21,7 +21,7 @@ let value: FTModelOut = { | Field | Type | Required | Description | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | `id` | *string* | :heavy_check_mark: | N/A | -| `object` | *string* | :heavy_minus_sign: | N/A | +| `object` | [components.FTModelOutObject](../../models/components/ftmodeloutobject.md) | :heavy_minus_sign: | N/A | | `created` | *number* | :heavy_check_mark: | N/A | | `ownedBy` | *string* | :heavy_check_mark: | N/A | | `root` | *string* | :heavy_check_mark: | N/A | diff --git a/docs/models/components/ftmodeloutobject.md b/docs/models/components/ftmodeloutobject.md new file mode 100644 index 0000000..7a85a02 --- /dev/null +++ b/docs/models/components/ftmodeloutobject.md @@ -0,0 +1,15 @@ +# FTModelOutObject + +## Example Usage + +```typescript +import { FTModelOutObject } from "@mistralai/mistralai/models/components"; + +let value: FTModelOutObject = "model"; +``` + +## Values + +```typescript +"model" +``` \ No newline at end of file diff --git a/docs/models/components/githubrepositoryin.md b/docs/models/components/githubrepositoryin.md index 1b9b8dc..23f1150 100644 --- a/docs/models/components/githubrepositoryin.md +++ b/docs/models/components/githubrepositoryin.md @@ -14,11 +14,11 @@ let value: GithubRepositoryIn = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `type` | *string* | :heavy_minus_sign: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `owner` | *string* | :heavy_check_mark: | N/A | -| `ref` | *string* | :heavy_minus_sign: | N/A | -| `weight` | *number* | :heavy_minus_sign: | N/A | -| `token` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `type` | [components.GithubRepositoryInType](../../models/components/githubrepositoryintype.md) | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `owner` | *string* | :heavy_check_mark: | N/A | +| `ref` | *string* | :heavy_minus_sign: | N/A | +| `weight` | *number* | :heavy_minus_sign: | N/A | +| `token` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/githubrepositoryintype.md b/docs/models/components/githubrepositoryintype.md new file mode 100644 index 0000000..0b59065 --- /dev/null +++ b/docs/models/components/githubrepositoryintype.md @@ -0,0 +1,15 @@ +# GithubRepositoryInType + +## Example Usage + +```typescript +import { GithubRepositoryInType } from "@mistralai/mistralai/models/components"; + +let value: GithubRepositoryInType = "github"; +``` + +## Values + +```typescript +"github" +``` \ No newline at end of file diff --git a/docs/models/components/githubrepositoryout.md b/docs/models/components/githubrepositoryout.md index f1b78b9..ea41207 100644 --- a/docs/models/components/githubrepositoryout.md +++ b/docs/models/components/githubrepositoryout.md @@ -14,11 +14,11 @@ let value: GithubRepositoryOut = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `type` | *string* | :heavy_minus_sign: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `owner` | *string* | :heavy_check_mark: | N/A | -| `ref` | *string* | :heavy_minus_sign: | N/A | -| `weight` | *number* | :heavy_minus_sign: | N/A | -| `commitId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `type` | [components.GithubRepositoryOutType](../../models/components/githubrepositoryouttype.md) | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `owner` | *string* | :heavy_check_mark: | N/A | +| `ref` | *string* | :heavy_minus_sign: | N/A | +| `weight` | *number* | :heavy_minus_sign: | N/A | +| `commitId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/githubrepositoryouttype.md b/docs/models/components/githubrepositoryouttype.md new file mode 100644 index 0000000..69727c9 --- /dev/null +++ b/docs/models/components/githubrepositoryouttype.md @@ -0,0 +1,15 @@ +# GithubRepositoryOutType + +## Example Usage + +```typescript +import { GithubRepositoryOutType } from "@mistralai/mistralai/models/components"; + +let value: GithubRepositoryOutType = "github"; +``` + +## Values + +```typescript +"github" +``` \ No newline at end of file diff --git a/docs/models/components/integrations.md b/docs/models/components/integrations.md new file mode 100644 index 0000000..10c51a7 --- /dev/null +++ b/docs/models/components/integrations.md @@ -0,0 +1,20 @@ +# Integrations + +## Example Usage + +```typescript +import { Integrations } from "@mistralai/mistralai/models/components"; + +let value: Integrations = { + project: "", +}; +``` + +## Supported Types + +### `components.WandbIntegrationOut` + +```typescript +const value: components.WandbIntegrationOut = /* values here */ +``` + diff --git a/docs/models/components/jobin.md b/docs/models/components/jobin.md index 5c7803b..1de3ebe 100644 --- a/docs/models/components/jobin.md +++ b/docs/models/components/jobin.md @@ -20,6 +20,6 @@ let value: JobIn = { | `validationFiles` | *string*[] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files. | | `hyperparameters` | [components.TrainingParametersIn](../../models/components/trainingparametersin.md) | :heavy_check_mark: | The fine-tuning hyperparameter settings used in a fine-tune job. | | `suffix` | *string* | :heavy_minus_sign: | A string that will be added to your fine-tuning model name. For example, a suffix of "my-great-model" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...` | -| `integrations` | [components.WandbIntegration](../../models/components/wandbintegration.md)[] | :heavy_minus_sign: | A list of integrations to enable for your fine-tuning job. | -| `repositories` | [components.GithubRepositoryIn](../../models/components/githubrepositoryin.md)[] | :heavy_minus_sign: | N/A | +| `integrations` | *components.JobInIntegrations*[] | :heavy_minus_sign: | A list of integrations to enable for your fine-tuning job. | +| `repositories` | *components.JobInRepositories*[] | :heavy_minus_sign: | N/A | | `autoStart` | *boolean* | :heavy_minus_sign: | This field will be required in a future release. | \ No newline at end of file diff --git a/docs/models/components/jobinintegrations.md b/docs/models/components/jobinintegrations.md new file mode 100644 index 0000000..584a928 --- /dev/null +++ b/docs/models/components/jobinintegrations.md @@ -0,0 +1,21 @@ +# JobInIntegrations + +## Example Usage + +```typescript +import { JobInIntegrations } from "@mistralai/mistralai/models/components"; + +let value: JobInIntegrations = { + project: "", + apiKey: "", +}; +``` + +## Supported Types + +### `components.WandbIntegration` + +```typescript +const value: components.WandbIntegration = /* values here */ +``` + diff --git a/docs/models/components/jobinrepositories.md b/docs/models/components/jobinrepositories.md new file mode 100644 index 0000000..efdc8fa --- /dev/null +++ b/docs/models/components/jobinrepositories.md @@ -0,0 +1,22 @@ +# JobInRepositories + +## Example Usage + +```typescript +import { JobInRepositories } from "@mistralai/mistralai/models/components"; + +let value: JobInRepositories = { + name: "", + owner: "", + token: "", +}; +``` + +## Supported Types + +### `components.GithubRepositoryIn` + +```typescript +const value: components.GithubRepositoryIn = /* values here */ +``` + diff --git a/docs/models/components/jobout.md b/docs/models/components/jobout.md index be42b57..235588a 100644 --- a/docs/models/components/jobout.md +++ b/docs/models/components/jobout.md @@ -32,10 +32,10 @@ let value: JobOut = { | `modifiedAt` | *number* | :heavy_check_mark: | The UNIX timestamp (in seconds) for when the fine-tuning job was last modified. | | `trainingFiles` | *string*[] | :heavy_check_mark: | A list containing the IDs of uploaded files that contain training data. | | `validationFiles` | *string*[] | :heavy_minus_sign: | A list containing the IDs of uploaded files that contain validation data. | -| `object` | *string* | :heavy_minus_sign: | The object type of the fine-tuning job. | +| `object` | [components.ObjectT](../../models/components/objectt.md) | :heavy_minus_sign: | The object type of the fine-tuning job. | | `fineTunedModel` | *string* | :heavy_minus_sign: | The name of the fine-tuned model that is being created. The value will be `null` if the fine-tuning job is still running. | | `suffix` | *string* | :heavy_minus_sign: | Optional text/code that adds more context for the model. When given a `prompt` and a `suffix` the model will fill what is between them. When `suffix` is not provided, the model will simply execute completion starting with `prompt`. | -| `integrations` | [components.WandbIntegrationOut](../../models/components/wandbintegrationout.md)[] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | +| `integrations` | *components.Integrations*[] | :heavy_minus_sign: | A list of integrations enabled for your fine-tuning job. | | `trainedTokens` | *number* | :heavy_minus_sign: | Total number of tokens trained. | -| `repositories` | [components.GithubRepositoryOut](../../models/components/githubrepositoryout.md)[] | :heavy_minus_sign: | N/A | +| `repositories` | *components.Repositories*[] | :heavy_minus_sign: | N/A | | `metadata` | [components.JobMetadataOut](../../models/components/jobmetadataout.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/jobsout.md b/docs/models/components/jobsout.md index 7ea67bd..903d807 100644 --- a/docs/models/components/jobsout.md +++ b/docs/models/components/jobsout.md @@ -12,8 +12,8 @@ let value: JobsOut = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `data` | [components.JobOut](../../models/components/jobout.md)[] | :heavy_minus_sign: | N/A | -| `object` | *string* | :heavy_minus_sign: | N/A | -| `total` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `data` | [components.JobOut](../../models/components/jobout.md)[] | :heavy_minus_sign: | N/A | +| `object` | [components.JobsOutObject](../../models/components/jobsoutobject.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/jobsoutobject.md b/docs/models/components/jobsoutobject.md new file mode 100644 index 0000000..ddc7e07 --- /dev/null +++ b/docs/models/components/jobsoutobject.md @@ -0,0 +1,15 @@ +# JobsOutObject + +## Example Usage + +```typescript +import { JobsOutObject } from "@mistralai/mistralai/models/components"; + +let value: JobsOutObject = "list"; +``` + +## Values + +```typescript +"list" +``` \ No newline at end of file diff --git a/docs/models/components/legacyjobmetadataout.md b/docs/models/components/legacyjobmetadataout.md index 1a08864..fdec6f1 100644 --- a/docs/models/components/legacyjobmetadataout.md +++ b/docs/models/components/legacyjobmetadataout.md @@ -33,4 +33,4 @@ let value: LegacyJobMetadataOut = { | `details` | *string* | :heavy_check_mark: | N/A | | | `epochs` | *number* | :heavy_minus_sign: | The number of complete passes through the entire training dataset. | 4.2922 | | `trainingSteps` | *number* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | 10 | -| `object` | *string* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `object` | [components.LegacyJobMetadataOutObject](../../models/components/legacyjobmetadataoutobject.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/legacyjobmetadataoutobject.md b/docs/models/components/legacyjobmetadataoutobject.md new file mode 100644 index 0000000..be3b937 --- /dev/null +++ b/docs/models/components/legacyjobmetadataoutobject.md @@ -0,0 +1,15 @@ +# LegacyJobMetadataOutObject + +## Example Usage + +```typescript +import { LegacyJobMetadataOutObject } from "@mistralai/mistralai/models/components"; + +let value: LegacyJobMetadataOutObject = "job.metadata"; +``` + +## Values + +```typescript +"job.metadata" +``` \ No newline at end of file diff --git a/docs/models/components/objectt.md b/docs/models/components/objectt.md new file mode 100644 index 0000000..941ec6f --- /dev/null +++ b/docs/models/components/objectt.md @@ -0,0 +1,17 @@ +# ObjectT + +The object type of the fine-tuning job. + +## Example Usage + +```typescript +import { ObjectT } from "@mistralai/mistralai/models/components"; + +let value: ObjectT = "job"; +``` + +## Values + +```typescript +"job" +``` \ No newline at end of file diff --git a/docs/models/components/purpose.md b/docs/models/components/purpose.md new file mode 100644 index 0000000..0991cef --- /dev/null +++ b/docs/models/components/purpose.md @@ -0,0 +1,19 @@ +# Purpose + +The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. + +## Example Usage + +```typescript +import { Purpose } from "@mistralai/mistralai/models/components"; + +let value: Purpose = "fine-tune"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"fine-tune" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/repositories.md b/docs/models/components/repositories.md new file mode 100644 index 0000000..71b934c --- /dev/null +++ b/docs/models/components/repositories.md @@ -0,0 +1,22 @@ +# Repositories + +## Example Usage + +```typescript +import { Repositories } from "@mistralai/mistralai/models/components"; + +let value: Repositories = { + name: "", + owner: "", + commitId: "", +}; +``` + +## Supported Types + +### `components.GithubRepositoryOut` + +```typescript +const value: components.GithubRepositoryOut = /* values here */ +``` + diff --git a/docs/models/components/retrievefileout.md b/docs/models/components/retrievefileout.md index 8086d23..fee27e4 100644 --- a/docs/models/components/retrievefileout.md +++ b/docs/models/components/retrievefileout.md @@ -25,7 +25,7 @@ let value: RetrieveFileOut = { | `bytes` | *number* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | | `createdAt` | *number* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | | `filename` | *string* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | -| `purpose` | *string* | :heavy_check_mark: | The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. | fine-tune | +| `purpose` | [components.RetrieveFileOutPurpose](../../models/components/retrievefileoutpurpose.md) | :heavy_check_mark: | The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. | fine-tune | | `sampleType` | [components.SampleType](../../models/components/sampletype.md) | :heavy_check_mark: | N/A | | | `numLines` | *number* | :heavy_minus_sign: | N/A | | | `source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/retrievefileoutpurpose.md b/docs/models/components/retrievefileoutpurpose.md new file mode 100644 index 0000000..302e8a3 --- /dev/null +++ b/docs/models/components/retrievefileoutpurpose.md @@ -0,0 +1,19 @@ +# RetrieveFileOutPurpose + +The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. + +## Example Usage + +```typescript +import { RetrieveFileOutPurpose } from "@mistralai/mistralai/models/components"; + +let value: RetrieveFileOutPurpose = "fine-tune"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"fine-tune" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/trainingparameters.md b/docs/models/components/trainingparameters.md index 7c415e1..83b6350 100644 --- a/docs/models/components/trainingparameters.md +++ b/docs/models/components/trainingparameters.md @@ -14,5 +14,7 @@ let value: TrainingParameters = {}; | ------------------ | ------------------ | ------------------ | ------------------ | | `trainingSteps` | *number* | :heavy_minus_sign: | N/A | | `learningRate` | *number* | :heavy_minus_sign: | N/A | +| `weightDecay` | *number* | :heavy_minus_sign: | N/A | +| `warmupFraction` | *number* | :heavy_minus_sign: | N/A | | `epochs` | *number* | :heavy_minus_sign: | N/A | | `fimRatio` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/trainingparametersin.md b/docs/models/components/trainingparametersin.md index 46a3e59..0377afc 100644 --- a/docs/models/components/trainingparametersin.md +++ b/docs/models/components/trainingparametersin.md @@ -12,9 +12,11 @@ let value: TrainingParametersIn = {}; ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `trainingSteps` | *number* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | -| `learningRate` | *number* | :heavy_minus_sign: | A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. | -| `epochs` | *number* | :heavy_minus_sign: | N/A | -| `fimRatio` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `trainingSteps` | *number* | :heavy_minus_sign: | The number of training steps to perform. A training step refers to a single update of the model weights during the fine-tuning process. This update is typically calculated using a batch of samples from the training dataset. | +| `learningRate` | *number* | :heavy_minus_sign: | A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. | +| `weightDecay` | *number* | :heavy_minus_sign: | (Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large. | +| `warmupFraction` | *number* | :heavy_minus_sign: | (Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune) | +| `epochs` | *number* | :heavy_minus_sign: | N/A | +| `fimRatio` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/type.md b/docs/models/components/type.md new file mode 100644 index 0000000..4b5557e --- /dev/null +++ b/docs/models/components/type.md @@ -0,0 +1,15 @@ +# Type + +## Example Usage + +```typescript +import { Type } from "@mistralai/mistralai/models/components"; + +let value: Type = "wandb"; +``` + +## Values + +```typescript +"wandb" +``` \ No newline at end of file diff --git a/docs/models/components/unarchiveftmodelout.md b/docs/models/components/unarchiveftmodelout.md index c7c0bc3..f4cdd2f 100644 --- a/docs/models/components/unarchiveftmodelout.md +++ b/docs/models/components/unarchiveftmodelout.md @@ -12,8 +12,8 @@ let value: UnarchiveFTModelOut = { ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `object` | *string* | :heavy_minus_sign: | N/A | -| `archived` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `object` | [components.UnarchiveFTModelOutObject](../../models/components/unarchiveftmodeloutobject.md) | :heavy_minus_sign: | N/A | +| `archived` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/unarchiveftmodeloutobject.md b/docs/models/components/unarchiveftmodeloutobject.md new file mode 100644 index 0000000..cd3fc32 --- /dev/null +++ b/docs/models/components/unarchiveftmodeloutobject.md @@ -0,0 +1,15 @@ +# UnarchiveFTModelOutObject + +## Example Usage + +```typescript +import { UnarchiveFTModelOutObject } from "@mistralai/mistralai/models/components"; + +let value: UnarchiveFTModelOutObject = "model"; +``` + +## Values + +```typescript +"model" +``` \ No newline at end of file diff --git a/docs/models/components/uploadfileout.md b/docs/models/components/uploadfileout.md index 0879551..a336d51 100644 --- a/docs/models/components/uploadfileout.md +++ b/docs/models/components/uploadfileout.md @@ -25,7 +25,7 @@ let value: UploadFileOut = { | `bytes` | *number* | :heavy_check_mark: | The size of the file, in bytes. | 13000 | | `createdAt` | *number* | :heavy_check_mark: | The UNIX timestamp (in seconds) of the event. | 1716963433 | | `filename` | *string* | :heavy_check_mark: | The name of the uploaded file. | files_upload.jsonl | -| `purpose` | *string* | :heavy_check_mark: | The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. | fine-tune | +| `purpose` | [components.Purpose](../../models/components/purpose.md) | :heavy_check_mark: | The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. | fine-tune | | `sampleType` | [components.SampleType](../../models/components/sampletype.md) | :heavy_check_mark: | N/A | | | `numLines` | *number* | :heavy_minus_sign: | N/A | | | `source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/wandbintegration.md b/docs/models/components/wandbintegration.md index b0b3084..fa6c2a7 100644 --- a/docs/models/components/wandbintegration.md +++ b/docs/models/components/wandbintegration.md @@ -13,10 +13,10 @@ let value: WandbIntegration = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `type` | *string* | :heavy_minus_sign: | N/A | -| `project` | *string* | :heavy_check_mark: | The name of the project that the new run will be created under. | -| `name` | *string* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | -| `apiKey` | *string* | :heavy_check_mark: | The WandB API key to use for authentication. | -| `runName` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | [components.WandbIntegrationType](../../models/components/wandbintegrationtype.md) | :heavy_minus_sign: | N/A | +| `project` | *string* | :heavy_check_mark: | The name of the project that the new run will be created under. | +| `name` | *string* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | +| `apiKey` | *string* | :heavy_check_mark: | The WandB API key to use for authentication. | +| `runName` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/wandbintegrationout.md b/docs/models/components/wandbintegrationout.md index a58d780..cef7d31 100644 --- a/docs/models/components/wandbintegrationout.md +++ b/docs/models/components/wandbintegrationout.md @@ -14,7 +14,7 @@ let value: WandbIntegrationOut = { | Field | Type | Required | Description | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `type` | *string* | :heavy_minus_sign: | N/A | +| `type` | [components.Type](../../models/components/type.md) | :heavy_minus_sign: | N/A | | `project` | *string* | :heavy_check_mark: | The name of the project that the new run will be created under. | | `name` | *string* | :heavy_minus_sign: | A display name to set for the run. If not set, will use the job ID as the name. | | `runName` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/wandbintegrationtype.md b/docs/models/components/wandbintegrationtype.md new file mode 100644 index 0000000..ebf402a --- /dev/null +++ b/docs/models/components/wandbintegrationtype.md @@ -0,0 +1,15 @@ +# WandbIntegrationType + +## Example Usage + +```typescript +import { WandbIntegrationType } from "@mistralai/mistralai/models/components"; + +let value: WandbIntegrationType = "wandb"; +``` + +## Values + +```typescript +"wandb" +``` \ No newline at end of file diff --git a/docs/models/operations/filesapiroutesuploadfilemultipartbodyparams.md b/docs/models/operations/filesapiroutesuploadfilemultipartbodyparams.md index edf3901..e75560e 100644 --- a/docs/models/operations/filesapiroutesuploadfilemultipartbodyparams.md +++ b/docs/models/operations/filesapiroutesuploadfilemultipartbodyparams.md @@ -16,4 +16,4 @@ let value: FilesApiRoutesUploadFileMultiPartBodyParams = { | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.FileT](../../models/operations/filet.md) | :heavy_check_mark: | The File object (not file name) to be uploaded.
To upload a file and specify a custom file name you should format your request as such:
```bash
file=@path/to/your/file.jsonl;filename=custom_name.jsonl
```
Otherwise, you can just keep the original file name:
```bash
file=@path/to/your/file.jsonl
``` | -| `purpose` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `purpose` | [operations.Purpose](../../models/operations/purpose.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/purpose.md b/docs/models/operations/purpose.md new file mode 100644 index 0000000..cd84a31 --- /dev/null +++ b/docs/models/operations/purpose.md @@ -0,0 +1,17 @@ +# Purpose + +## Example Usage + +```typescript +import { Purpose } from "@mistralai/mistralai/models/operations"; + +let value: Purpose = "fine-tune"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"fine-tune" | Unrecognized +``` \ No newline at end of file diff --git a/jsr.json b/jsr.json index 7bcb1d9..9b3a807 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@mistralai/mistralai", - "version": "1.1.3", + "version": "1.0.3", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 1dc930b..a757375 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mistralai/mistralai", - "version": "1.1.3", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mistralai/mistralai", - "version": "1.1.3", + "version": "1.0.3", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index 8ee2c91..d34482c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mistralai/mistralai", - "version": "1.1.3", + "version": "1.0.3", "author": "Speakeasy", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index 4ca957b..a213fa0 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.2", - sdkVersion: "1.1.3", - genVersion: "2.399.0", - userAgent: "speakeasy-sdk/typescript 1.1.3 2.399.0 0.0.2 @mistralai/mistralai", + sdkVersion: "1.0.3", + genVersion: "2.402.5", + userAgent: "speakeasy-sdk/typescript 1.0.3 2.402.5 0.0.2 @mistralai/mistralai", } as const; diff --git a/src/lib/env.ts b/src/lib/env.ts index 851373e..b1f8539 100644 --- a/src/lib/env.ts +++ b/src/lib/env.ts @@ -8,11 +8,15 @@ import * as z from "zod"; export interface Env { MISTRAL_API_KEY?: string | undefined; + + MISTRAL_DEBUG?: boolean | undefined; } export const envSchema: z.ZodType = z .object({ MISTRAL_API_KEY: z.string(), + + MISTRAL_DEBUG: z.coerce.boolean(), }) .partial(); diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index 51b49bd..205a7bc 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -18,6 +18,7 @@ import { stringToBase64 } from "./base64.js"; import { SDKOptions, SDK_METADATA, serverURLFromOptions } from "./config.js"; import { SDKHooks } from "../hooks/hooks.js"; import { HookContext } from "../hooks/types.js"; +import { env } from "./env.js"; import { ConnectionError, InvalidRequestError, @@ -104,6 +105,9 @@ export class ClientSDK { this.baseURL = baseURL; this.httpClient = client; this.logger = options.debugLogger; + if (!this.logger && env().MISTRAL_DEBUG) { + this.logger = console; + } } public createRequest$( diff --git a/src/models/components/agentscompletionrequest.ts b/src/models/components/agentscompletionrequest.ts index 1f90347..88a7a4f 100644 --- a/src/models/components/agentscompletionrequest.ts +++ b/src/models/components/agentscompletionrequest.ts @@ -201,7 +201,7 @@ export const AgentsCompletionRequest$inboundSchema: z.ZodType< .object({ max_tokens: z.nullable(z.number().int()).optional(), min_tokens: z.nullable(z.number().int()).optional(), - stream: z.boolean().default(false), + stream: z.boolean(), stop: z.union([z.string(), z.array(z.string())]).optional(), random_seed: z.nullable(z.number().int()).optional(), messages: z.array( diff --git a/src/models/components/archiveftmodelout.ts b/src/models/components/archiveftmodelout.ts index 764092b..ec58975 100644 --- a/src/models/components/archiveftmodelout.ts +++ b/src/models/components/archiveftmodelout.ts @@ -2,19 +2,46 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; +export const ArchiveFTModelOutObject = { + Model: "model", +} as const; +export type ArchiveFTModelOutObject = ClosedEnum; + export type ArchiveFTModelOut = { id: string; object?: "model" | undefined; archived?: boolean | undefined; }; +/** @internal */ +export const ArchiveFTModelOutObject$inboundSchema: z.ZodNativeEnum< + typeof ArchiveFTModelOutObject +> = z.nativeEnum(ArchiveFTModelOutObject); + +/** @internal */ +export const ArchiveFTModelOutObject$outboundSchema: z.ZodNativeEnum< + typeof ArchiveFTModelOutObject +> = ArchiveFTModelOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ArchiveFTModelOutObject$ { + /** @deprecated use `ArchiveFTModelOutObject$inboundSchema` instead. */ + export const inboundSchema = ArchiveFTModelOutObject$inboundSchema; + /** @deprecated use `ArchiveFTModelOutObject$outboundSchema` instead. */ + export const outboundSchema = ArchiveFTModelOutObject$outboundSchema; +} + /** @internal */ export const ArchiveFTModelOut$inboundSchema: z.ZodType = z.object({ id: z.string(), - object: z.literal("model").default("model" as const), + object: z.literal("model").default("model"), archived: z.boolean().default(true), }); @@ -32,7 +59,7 @@ export const ArchiveFTModelOut$outboundSchema: z.ZodType< ArchiveFTModelOut > = z.object({ id: z.string(), - object: z.literal("model").default("model" as const), + object: z.literal("model").default("model"), archived: z.boolean().default(true), }); diff --git a/src/models/components/assistantmessage.ts b/src/models/components/assistantmessage.ts index f3329c5..c03cadd 100644 --- a/src/models/components/assistantmessage.ts +++ b/src/models/components/assistantmessage.ts @@ -51,7 +51,7 @@ export const AssistantMessage$inboundSchema: z.ZodType { diff --git a/src/models/components/chatcompletionrequest.ts b/src/models/components/chatcompletionrequest.ts index 3132d71..356a09f 100644 --- a/src/models/components/chatcompletionrequest.ts +++ b/src/models/components/chatcompletionrequest.ts @@ -218,7 +218,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType< top_p: z.number().default(1), max_tokens: z.nullable(z.number().int()).optional(), min_tokens: z.nullable(z.number().int()).optional(), - stream: z.boolean().default(false), + stream: z.boolean(), stop: z.union([z.string(), z.array(z.string())]).optional(), random_seed: z.nullable(z.number().int()).optional(), messages: z.array( @@ -240,7 +240,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType< response_format: ResponseFormat$inboundSchema.optional(), tools: z.nullable(z.array(Tool$inboundSchema)).optional(), tool_choice: ToolChoice$inboundSchema.default("auto"), - safe_prompt: z.boolean().default(false), + safe_prompt: z.boolean(), }) .transform((v) => { return remap$(v, { diff --git a/src/models/components/chatcompletionstreamrequest.ts b/src/models/components/chatcompletionstreamrequest.ts index b38fd96..70d9c24 100644 --- a/src/models/components/chatcompletionstreamrequest.ts +++ b/src/models/components/chatcompletionstreamrequest.ts @@ -250,7 +250,7 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType< response_format: ResponseFormat$inboundSchema.optional(), tools: z.nullable(z.array(Tool$inboundSchema)).optional(), tool_choice: ChatCompletionStreamRequestToolChoice$inboundSchema.default("auto"), - safe_prompt: z.boolean().default(false), + safe_prompt: z.boolean(), }) .transform((v) => { return remap$(v, { diff --git a/src/models/components/contentchunk.ts b/src/models/components/contentchunk.ts index 1a1ce72..98a99ba 100644 --- a/src/models/components/contentchunk.ts +++ b/src/models/components/contentchunk.ts @@ -11,7 +11,7 @@ export type ContentChunk = { /** @internal */ export const ContentChunk$inboundSchema: z.ZodType = z.object({ - type: z.literal("text").default("text" as const), + type: z.literal("text").default("text"), text: z.string(), }); diff --git a/src/models/components/detailedjobout.ts b/src/models/components/detailedjobout.ts index 23f5849..42aa820 100644 --- a/src/models/components/detailedjobout.ts +++ b/src/models/components/detailedjobout.ts @@ -61,6 +61,15 @@ export const DetailedJobOutStatus = { } as const; export type DetailedJobOutStatus = ClosedEnum; +export const DetailedJobOutObject = { + Job: "job", +} as const; +export type DetailedJobOutObject = ClosedEnum; + +export type DetailedJobOutIntegrations = WandbIntegrationOut; + +export type DetailedJobOutRepositories = GithubRepositoryOut; + export type DetailedJobOut = { id: string; autoStart: boolean; @@ -108,6 +117,85 @@ export namespace DetailedJobOutStatus$ { export const outboundSchema = DetailedJobOutStatus$outboundSchema; } +/** @internal */ +export const DetailedJobOutObject$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(DetailedJobOutObject); + +/** @internal */ +export const DetailedJobOutObject$outboundSchema: z.ZodNativeEnum = + DetailedJobOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DetailedJobOutObject$ { + /** @deprecated use `DetailedJobOutObject$inboundSchema` instead. */ + export const inboundSchema = DetailedJobOutObject$inboundSchema; + /** @deprecated use `DetailedJobOutObject$outboundSchema` instead. */ + export const outboundSchema = DetailedJobOutObject$outboundSchema; +} + +/** @internal */ +export const DetailedJobOutIntegrations$inboundSchema: z.ZodType< + DetailedJobOutIntegrations, + z.ZodTypeDef, + unknown +> = WandbIntegrationOut$inboundSchema; + +/** @internal */ +export type DetailedJobOutIntegrations$Outbound = WandbIntegrationOut$Outbound; + +/** @internal */ +export const DetailedJobOutIntegrations$outboundSchema: z.ZodType< + DetailedJobOutIntegrations$Outbound, + z.ZodTypeDef, + DetailedJobOutIntegrations +> = WandbIntegrationOut$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DetailedJobOutIntegrations$ { + /** @deprecated use `DetailedJobOutIntegrations$inboundSchema` instead. */ + export const inboundSchema = DetailedJobOutIntegrations$inboundSchema; + /** @deprecated use `DetailedJobOutIntegrations$outboundSchema` instead. */ + export const outboundSchema = DetailedJobOutIntegrations$outboundSchema; + /** @deprecated use `DetailedJobOutIntegrations$Outbound` instead. */ + export type Outbound = DetailedJobOutIntegrations$Outbound; +} + +/** @internal */ +export const DetailedJobOutRepositories$inboundSchema: z.ZodType< + DetailedJobOutRepositories, + z.ZodTypeDef, + unknown +> = GithubRepositoryOut$inboundSchema; + +/** @internal */ +export type DetailedJobOutRepositories$Outbound = GithubRepositoryOut$Outbound; + +/** @internal */ +export const DetailedJobOutRepositories$outboundSchema: z.ZodType< + DetailedJobOutRepositories$Outbound, + z.ZodTypeDef, + DetailedJobOutRepositories +> = GithubRepositoryOut$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DetailedJobOutRepositories$ { + /** @deprecated use `DetailedJobOutRepositories$inboundSchema` instead. */ + export const inboundSchema = DetailedJobOutRepositories$inboundSchema; + /** @deprecated use `DetailedJobOutRepositories$outboundSchema` instead. */ + export const outboundSchema = DetailedJobOutRepositories$outboundSchema; + /** @deprecated use `DetailedJobOutRepositories$Outbound` instead. */ + export type Outbound = DetailedJobOutRepositories$Outbound; +} + /** @internal */ export const DetailedJobOut$inboundSchema: z.ZodType = z .object({ @@ -121,7 +209,7 @@ export const DetailedJobOut$inboundSchema: z.ZodType; + export type FileSchema = { /** * The unique identifier of the file. @@ -37,6 +49,28 @@ export type FileSchema = { source: Source; }; +/** @internal */ +export const FileSchemaPurpose$inboundSchema: z.ZodType = + z.union([z.nativeEnum(FileSchemaPurpose), z.string().transform(catchUnrecognizedEnum)]); + +/** @internal */ +export const FileSchemaPurpose$outboundSchema: z.ZodType< + FileSchemaPurpose, + z.ZodTypeDef, + FileSchemaPurpose +> = z.union([z.nativeEnum(FileSchemaPurpose), z.string().and(z.custom>())]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FileSchemaPurpose$ { + /** @deprecated use `FileSchemaPurpose$inboundSchema` instead. */ + export const inboundSchema = FileSchemaPurpose$inboundSchema; + /** @deprecated use `FileSchemaPurpose$outboundSchema` instead. */ + export const outboundSchema = FileSchemaPurpose$outboundSchema; +} + /** @internal */ export const FileSchema$inboundSchema: z.ZodType = z .object({ @@ -79,7 +113,7 @@ export const FileSchema$outboundSchema: z.ZodType = z .object({ completion_chat: z.boolean().default(true), - completion_fim: z.boolean().default(false), - function_calling: z.boolean().default(false), - fine_tuning: z.boolean().default(false), + completion_fim: z.boolean(), + function_calling: z.boolean(), + fine_tuning: z.boolean(), }) .transform((v) => { return remap$(v, { diff --git a/src/models/components/ftmodelout.ts b/src/models/components/ftmodelout.ts index 917467e..af1251d 100644 --- a/src/models/components/ftmodelout.ts +++ b/src/models/components/ftmodelout.ts @@ -3,6 +3,7 @@ */ import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; import { FTModelCapabilitiesOut, FTModelCapabilitiesOut$inboundSchema, @@ -11,6 +12,11 @@ import { } from "./ftmodelcapabilitiesout.js"; import * as z from "zod"; +export const FTModelOutObject = { + Model: "model", +} as const; +export type FTModelOutObject = ClosedEnum; + export type FTModelOut = { id: string; object?: "model" | undefined; @@ -26,11 +32,30 @@ export type FTModelOut = { job: string; }; +/** @internal */ +export const FTModelOutObject$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(FTModelOutObject); + +/** @internal */ +export const FTModelOutObject$outboundSchema: z.ZodNativeEnum = + FTModelOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FTModelOutObject$ { + /** @deprecated use `FTModelOutObject$inboundSchema` instead. */ + export const inboundSchema = FTModelOutObject$inboundSchema; + /** @deprecated use `FTModelOutObject$outboundSchema` instead. */ + export const outboundSchema = FTModelOutObject$outboundSchema; +} + /** @internal */ export const FTModelOut$inboundSchema: z.ZodType = z .object({ id: z.string(), - object: z.literal("model").default("model" as const), + object: z.literal("model").default("model"), created: z.number().int(), owned_by: z.string(), root: z.string(), @@ -69,7 +94,7 @@ export type FTModelOut$Outbound = { export const FTModelOut$outboundSchema: z.ZodType = z .object({ id: z.string(), - object: z.literal("model").default("model" as const), + object: z.literal("model").default("model"), created: z.number().int(), ownedBy: z.string(), root: z.string(), diff --git a/src/models/components/githubrepositoryin.ts b/src/models/components/githubrepositoryin.ts index 77fb31f..7a2aa97 100644 --- a/src/models/components/githubrepositoryin.ts +++ b/src/models/components/githubrepositoryin.ts @@ -2,8 +2,14 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; +export const GithubRepositoryInType = { + Github: "github", +} as const; +export type GithubRepositoryInType = ClosedEnum; + export type GithubRepositoryIn = { type?: "github" | undefined; name: string; @@ -13,13 +19,32 @@ export type GithubRepositoryIn = { token: string; }; +/** @internal */ +export const GithubRepositoryInType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(GithubRepositoryInType); + +/** @internal */ +export const GithubRepositoryInType$outboundSchema: z.ZodNativeEnum = + GithubRepositoryInType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GithubRepositoryInType$ { + /** @deprecated use `GithubRepositoryInType$inboundSchema` instead. */ + export const inboundSchema = GithubRepositoryInType$inboundSchema; + /** @deprecated use `GithubRepositoryInType$outboundSchema` instead. */ + export const outboundSchema = GithubRepositoryInType$outboundSchema; +} + /** @internal */ export const GithubRepositoryIn$inboundSchema: z.ZodType< GithubRepositoryIn, z.ZodTypeDef, unknown > = z.object({ - type: z.literal("github").default("github" as const), + type: z.literal("github").default("github"), name: z.string(), owner: z.string(), ref: z.nullable(z.string()).optional(), @@ -43,7 +68,7 @@ export const GithubRepositoryIn$outboundSchema: z.ZodType< z.ZodTypeDef, GithubRepositoryIn > = z.object({ - type: z.literal("github").default("github" as const), + type: z.literal("github").default("github"), name: z.string(), owner: z.string(), ref: z.nullable(z.string()).optional(), diff --git a/src/models/components/githubrepositoryout.ts b/src/models/components/githubrepositoryout.ts index 1d8beb1..776c8eb 100644 --- a/src/models/components/githubrepositoryout.ts +++ b/src/models/components/githubrepositoryout.ts @@ -3,8 +3,14 @@ */ import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; +export const GithubRepositoryOutType = { + Github: "github", +} as const; +export type GithubRepositoryOutType = ClosedEnum; + export type GithubRepositoryOut = { type?: "github" | undefined; name: string; @@ -14,6 +20,27 @@ export type GithubRepositoryOut = { commitId: string; }; +/** @internal */ +export const GithubRepositoryOutType$inboundSchema: z.ZodNativeEnum< + typeof GithubRepositoryOutType +> = z.nativeEnum(GithubRepositoryOutType); + +/** @internal */ +export const GithubRepositoryOutType$outboundSchema: z.ZodNativeEnum< + typeof GithubRepositoryOutType +> = GithubRepositoryOutType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GithubRepositoryOutType$ { + /** @deprecated use `GithubRepositoryOutType$inboundSchema` instead. */ + export const inboundSchema = GithubRepositoryOutType$inboundSchema; + /** @deprecated use `GithubRepositoryOutType$outboundSchema` instead. */ + export const outboundSchema = GithubRepositoryOutType$outboundSchema; +} + /** @internal */ export const GithubRepositoryOut$inboundSchema: z.ZodType< GithubRepositoryOut, @@ -21,7 +48,7 @@ export const GithubRepositoryOut$inboundSchema: z.ZodType< unknown > = z .object({ - type: z.literal("github").default("github" as const), + type: z.literal("github").default("github"), name: z.string(), owner: z.string(), ref: z.nullable(z.string()).optional(), @@ -51,7 +78,7 @@ export const GithubRepositoryOut$outboundSchema: z.ZodType< GithubRepositoryOut > = z .object({ - type: z.literal("github").default("github" as const), + type: z.literal("github").default("github"), name: z.string(), owner: z.string(), ref: z.nullable(z.string()).optional(), diff --git a/src/models/components/jobin.ts b/src/models/components/jobin.ts index a228ed2..a1ecfa9 100644 --- a/src/models/components/jobin.ts +++ b/src/models/components/jobin.ts @@ -34,6 +34,10 @@ import { } from "./wandbintegration.js"; import * as z from "zod"; +export type JobInIntegrations = WandbIntegration; + +export type JobInRepositories = GithubRepositoryIn; + export type JobIn = { /** * The name of the model to fine-tune. @@ -63,6 +67,60 @@ export type JobIn = { autoStart?: boolean | undefined; }; +/** @internal */ +export const JobInIntegrations$inboundSchema: z.ZodType = + WandbIntegration$inboundSchema; + +/** @internal */ +export type JobInIntegrations$Outbound = WandbIntegration$Outbound; + +/** @internal */ +export const JobInIntegrations$outboundSchema: z.ZodType< + JobInIntegrations$Outbound, + z.ZodTypeDef, + JobInIntegrations +> = WandbIntegration$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace JobInIntegrations$ { + /** @deprecated use `JobInIntegrations$inboundSchema` instead. */ + export const inboundSchema = JobInIntegrations$inboundSchema; + /** @deprecated use `JobInIntegrations$outboundSchema` instead. */ + export const outboundSchema = JobInIntegrations$outboundSchema; + /** @deprecated use `JobInIntegrations$Outbound` instead. */ + export type Outbound = JobInIntegrations$Outbound; +} + +/** @internal */ +export const JobInRepositories$inboundSchema: z.ZodType = + GithubRepositoryIn$inboundSchema; + +/** @internal */ +export type JobInRepositories$Outbound = GithubRepositoryIn$Outbound; + +/** @internal */ +export const JobInRepositories$outboundSchema: z.ZodType< + JobInRepositories$Outbound, + z.ZodTypeDef, + JobInRepositories +> = GithubRepositoryIn$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace JobInRepositories$ { + /** @deprecated use `JobInRepositories$inboundSchema` instead. */ + export const inboundSchema = JobInRepositories$inboundSchema; + /** @deprecated use `JobInRepositories$outboundSchema` instead. */ + export const outboundSchema = JobInRepositories$outboundSchema; + /** @deprecated use `JobInRepositories$Outbound` instead. */ + export type Outbound = JobInRepositories$Outbound; +} + /** @internal */ export const JobIn$inboundSchema: z.ZodType = z .object({ diff --git a/src/models/components/jobout.ts b/src/models/components/jobout.ts index 13c2fe7..106b9f8 100644 --- a/src/models/components/jobout.ts +++ b/src/models/components/jobout.ts @@ -55,6 +55,21 @@ export const Status = { */ export type Status = ClosedEnum; +/** + * The object type of the fine-tuning job. + */ +export const ObjectT = { + Job: "job", +} as const; +/** + * The object type of the fine-tuning job. + */ +export type ObjectT = ClosedEnum; + +export type Integrations = WandbIntegrationOut; + +export type Repositories = GithubRepositoryOut; + export type JobOut = { /** * The ID of the job. @@ -131,6 +146,77 @@ export namespace Status$ { export const outboundSchema = Status$outboundSchema; } +/** @internal */ +export const ObjectT$inboundSchema: z.ZodNativeEnum = z.nativeEnum(ObjectT); + +/** @internal */ +export const ObjectT$outboundSchema: z.ZodNativeEnum = ObjectT$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ObjectT$ { + /** @deprecated use `ObjectT$inboundSchema` instead. */ + export const inboundSchema = ObjectT$inboundSchema; + /** @deprecated use `ObjectT$outboundSchema` instead. */ + export const outboundSchema = ObjectT$outboundSchema; +} + +/** @internal */ +export const Integrations$inboundSchema: z.ZodType = + WandbIntegrationOut$inboundSchema; + +/** @internal */ +export type Integrations$Outbound = WandbIntegrationOut$Outbound; + +/** @internal */ +export const Integrations$outboundSchema: z.ZodType< + Integrations$Outbound, + z.ZodTypeDef, + Integrations +> = WandbIntegrationOut$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Integrations$ { + /** @deprecated use `Integrations$inboundSchema` instead. */ + export const inboundSchema = Integrations$inboundSchema; + /** @deprecated use `Integrations$outboundSchema` instead. */ + export const outboundSchema = Integrations$outboundSchema; + /** @deprecated use `Integrations$Outbound` instead. */ + export type Outbound = Integrations$Outbound; +} + +/** @internal */ +export const Repositories$inboundSchema: z.ZodType = + GithubRepositoryOut$inboundSchema; + +/** @internal */ +export type Repositories$Outbound = GithubRepositoryOut$Outbound; + +/** @internal */ +export const Repositories$outboundSchema: z.ZodType< + Repositories$Outbound, + z.ZodTypeDef, + Repositories +> = GithubRepositoryOut$outboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Repositories$ { + /** @deprecated use `Repositories$inboundSchema` instead. */ + export const inboundSchema = Repositories$inboundSchema; + /** @deprecated use `Repositories$outboundSchema` instead. */ + export const outboundSchema = Repositories$outboundSchema; + /** @deprecated use `Repositories$Outbound` instead. */ + export type Outbound = Repositories$Outbound; +} + /** @internal */ export const JobOut$inboundSchema: z.ZodType = z .object({ @@ -144,7 +230,7 @@ export const JobOut$inboundSchema: z.ZodType = z modified_at: z.number().int(), training_files: z.array(z.string()), validation_files: z.nullable(z.array(z.string())).optional(), - object: z.literal("job").default("job" as const), + object: z.literal("job").default("job"), fine_tuned_model: z.nullable(z.string()).optional(), suffix: z.nullable(z.string()).optional(), integrations: z.nullable(z.array(WandbIntegrationOut$inboundSchema)).optional(), @@ -199,7 +285,7 @@ export const JobOut$outboundSchema: z.ZodType; + export type JobsOut = { data?: Array | undefined; object?: "list" | undefined; total: number; }; +/** @internal */ +export const JobsOutObject$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(JobsOutObject); + +/** @internal */ +export const JobsOutObject$outboundSchema: z.ZodNativeEnum = + JobsOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace JobsOutObject$ { + /** @deprecated use `JobsOutObject$inboundSchema` instead. */ + export const inboundSchema = JobsOutObject$inboundSchema; + /** @deprecated use `JobsOutObject$outboundSchema` instead. */ + export const outboundSchema = JobsOutObject$outboundSchema; +} + /** @internal */ export const JobsOut$inboundSchema: z.ZodType = z.object({ data: z.array(JobOut$inboundSchema).optional(), - object: z.literal("list").default("list" as const), + object: z.literal("list").default("list"), total: z.number().int(), }); @@ -28,7 +53,7 @@ export type JobsOut$Outbound = { /** @internal */ export const JobsOut$outboundSchema: z.ZodType = z.object({ data: z.array(JobOut$outboundSchema).optional(), - object: z.literal("list").default("list" as const), + object: z.literal("list").default("list"), total: z.number().int(), }); diff --git a/src/models/components/legacyjobmetadataout.ts b/src/models/components/legacyjobmetadataout.ts index 307658a..9440074 100644 --- a/src/models/components/legacyjobmetadataout.ts +++ b/src/models/components/legacyjobmetadataout.ts @@ -3,8 +3,14 @@ */ import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; +export const LegacyJobMetadataOutObject = { + JobMetadata: "job.metadata", +} as const; +export type LegacyJobMetadataOutObject = ClosedEnum; + export type LegacyJobMetadataOut = { /** * The approximated time (in seconds) for the fine-tuning process to complete. @@ -44,6 +50,27 @@ export type LegacyJobMetadataOut = { object?: "job.metadata" | undefined; }; +/** @internal */ +export const LegacyJobMetadataOutObject$inboundSchema: z.ZodNativeEnum< + typeof LegacyJobMetadataOutObject +> = z.nativeEnum(LegacyJobMetadataOutObject); + +/** @internal */ +export const LegacyJobMetadataOutObject$outboundSchema: z.ZodNativeEnum< + typeof LegacyJobMetadataOutObject +> = LegacyJobMetadataOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LegacyJobMetadataOutObject$ { + /** @deprecated use `LegacyJobMetadataOutObject$inboundSchema` instead. */ + export const inboundSchema = LegacyJobMetadataOutObject$inboundSchema; + /** @deprecated use `LegacyJobMetadataOutObject$outboundSchema` instead. */ + export const outboundSchema = LegacyJobMetadataOutObject$outboundSchema; +} + /** @internal */ export const LegacyJobMetadataOut$inboundSchema: z.ZodType< LegacyJobMetadataOut, @@ -62,7 +89,7 @@ export const LegacyJobMetadataOut$inboundSchema: z.ZodType< details: z.string(), epochs: z.nullable(z.number()).optional(), training_steps: z.nullable(z.number().int()).optional(), - object: z.literal("job.metadata").default("job.metadata" as const), + object: z.literal("job.metadata").default("job.metadata"), }) .transform((v) => { return remap$(v, { @@ -110,7 +137,7 @@ export const LegacyJobMetadataOut$outboundSchema: z.ZodType< details: z.string(), epochs: z.nullable(z.number()).optional(), trainingSteps: z.nullable(z.number().int()).optional(), - object: z.literal("job.metadata").default("job.metadata" as const), + object: z.literal("job.metadata").default("job.metadata"), }) .transform((v) => { return remap$(v, { diff --git a/src/models/components/modelcapabilities.ts b/src/models/components/modelcapabilities.ts index 5b85b0a..33f528c 100644 --- a/src/models/components/modelcapabilities.ts +++ b/src/models/components/modelcapabilities.ts @@ -17,9 +17,9 @@ export const ModelCapabilities$inboundSchema: z.ZodType { return remap$(v, { diff --git a/src/models/components/modelcard.ts b/src/models/components/modelcard.ts index 3037f51..83a92da 100644 --- a/src/models/components/modelcard.ts +++ b/src/models/components/modelcard.ts @@ -34,7 +34,7 @@ export const ModelCard$inboundSchema: z.ZodType; + export type RetrieveFileOut = { /** * The unique identifier of the file. @@ -37,6 +49,34 @@ export type RetrieveFileOut = { source: Source; }; +/** @internal */ +export const RetrieveFileOutPurpose$inboundSchema: z.ZodType< + RetrieveFileOutPurpose, + z.ZodTypeDef, + unknown +> = z.union([z.nativeEnum(RetrieveFileOutPurpose), z.string().transform(catchUnrecognizedEnum)]); + +/** @internal */ +export const RetrieveFileOutPurpose$outboundSchema: z.ZodType< + RetrieveFileOutPurpose, + z.ZodTypeDef, + RetrieveFileOutPurpose +> = z.union([ + z.nativeEnum(RetrieveFileOutPurpose), + z.string().and(z.custom>()), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RetrieveFileOutPurpose$ { + /** @deprecated use `RetrieveFileOutPurpose$inboundSchema` instead. */ + export const inboundSchema = RetrieveFileOutPurpose$inboundSchema; + /** @deprecated use `RetrieveFileOutPurpose$outboundSchema` instead. */ + export const outboundSchema = RetrieveFileOutPurpose$outboundSchema; +} + /** @internal */ export const RetrieveFileOut$inboundSchema: z.ZodType = z .object({ @@ -83,7 +123,7 @@ export const RetrieveFileOut$outboundSchema: z.ZodType< bytes: z.number().int(), createdAt: z.number().int(), filename: z.string(), - purpose: z.literal("fine-tune").default("fine-tune" as const), + purpose: z.literal("fine-tune").default("fine-tune"), sampleType: SampleType$outboundSchema, numLines: z.nullable(z.number().int()).optional(), source: Source$outboundSchema, diff --git a/src/models/components/textchunk.ts b/src/models/components/textchunk.ts index 0cd4902..960df06 100644 --- a/src/models/components/textchunk.ts +++ b/src/models/components/textchunk.ts @@ -11,7 +11,7 @@ export type TextChunk = { /** @internal */ export const TextChunk$inboundSchema: z.ZodType = z.object({ - type: z.literal("text").default("text" as const), + type: z.literal("text").default("text"), text: z.string(), }); diff --git a/src/models/components/trainingparameters.ts b/src/models/components/trainingparameters.ts index e29af88..380e029 100644 --- a/src/models/components/trainingparameters.ts +++ b/src/models/components/trainingparameters.ts @@ -8,6 +8,8 @@ import * as z from "zod"; export type TrainingParameters = { trainingSteps?: number | null | undefined; learningRate?: number | undefined; + weightDecay?: number | null | undefined; + warmupFraction?: number | null | undefined; epochs?: number | null | undefined; fimRatio?: number | null | undefined; }; @@ -21,6 +23,8 @@ export const TrainingParameters$inboundSchema: z.ZodType< .object({ training_steps: z.nullable(z.number().int()).optional(), learning_rate: z.number().default(0.0001), + weight_decay: z.nullable(z.number()).optional(), + warmup_fraction: z.nullable(z.number()).optional(), epochs: z.nullable(z.number()).optional(), fim_ratio: z.nullable(z.number()).optional(), }) @@ -28,6 +32,8 @@ export const TrainingParameters$inboundSchema: z.ZodType< return remap$(v, { training_steps: "trainingSteps", learning_rate: "learningRate", + weight_decay: "weightDecay", + warmup_fraction: "warmupFraction", fim_ratio: "fimRatio", }); }); @@ -36,6 +42,8 @@ export const TrainingParameters$inboundSchema: z.ZodType< export type TrainingParameters$Outbound = { training_steps?: number | null | undefined; learning_rate: number; + weight_decay?: number | null | undefined; + warmup_fraction?: number | null | undefined; epochs?: number | null | undefined; fim_ratio?: number | null | undefined; }; @@ -49,6 +57,8 @@ export const TrainingParameters$outboundSchema: z.ZodType< .object({ trainingSteps: z.nullable(z.number().int()).optional(), learningRate: z.number().default(0.0001), + weightDecay: z.nullable(z.number()).optional(), + warmupFraction: z.nullable(z.number()).optional(), epochs: z.nullable(z.number()).optional(), fimRatio: z.nullable(z.number()).optional(), }) @@ -56,6 +66,8 @@ export const TrainingParameters$outboundSchema: z.ZodType< return remap$(v, { trainingSteps: "training_steps", learningRate: "learning_rate", + weightDecay: "weight_decay", + warmupFraction: "warmup_fraction", fimRatio: "fim_ratio", }); }); diff --git a/src/models/components/trainingparametersin.ts b/src/models/components/trainingparametersin.ts index 20f6852..e966451 100644 --- a/src/models/components/trainingparametersin.ts +++ b/src/models/components/trainingparametersin.ts @@ -17,6 +17,14 @@ export type TrainingParametersIn = { * A parameter describing how much to adjust the pre-trained model's weights in response to the estimated error each time the weights are updated during the fine-tuning process. */ learningRate?: number | undefined; + /** + * (Advanced Usage) Weight decay adds a term to the loss function that is proportional to the sum of the squared weights. This term reduces the magnitude of the weights and prevents them from growing too large. + */ + weightDecay?: number | null | undefined; + /** + * (Advanced Usage) A parameter that specifies the percentage of the total training steps at which the learning rate warm-up phase ends. During this phase, the learning rate gradually increases from a small value to the initial learning rate, helping to stabilize the training process and improve convergence. Similar to `pct_start` in [mistral-finetune](https://github.com/mistralai/mistral-finetune) + */ + warmupFraction?: number | null | undefined; epochs?: number | null | undefined; fimRatio?: number | null | undefined; }; @@ -30,6 +38,8 @@ export const TrainingParametersIn$inboundSchema: z.ZodType< .object({ training_steps: z.nullable(z.number().int()).optional(), learning_rate: z.number().default(0.0001), + weight_decay: z.nullable(z.number()).optional(), + warmup_fraction: z.nullable(z.number()).optional(), epochs: z.nullable(z.number()).optional(), fim_ratio: z.nullable(z.number()).optional(), }) @@ -37,6 +47,8 @@ export const TrainingParametersIn$inboundSchema: z.ZodType< return remap$(v, { training_steps: "trainingSteps", learning_rate: "learningRate", + weight_decay: "weightDecay", + warmup_fraction: "warmupFraction", fim_ratio: "fimRatio", }); }); @@ -45,6 +57,8 @@ export const TrainingParametersIn$inboundSchema: z.ZodType< export type TrainingParametersIn$Outbound = { training_steps?: number | null | undefined; learning_rate: number; + weight_decay?: number | null | undefined; + warmup_fraction?: number | null | undefined; epochs?: number | null | undefined; fim_ratio?: number | null | undefined; }; @@ -58,6 +72,8 @@ export const TrainingParametersIn$outboundSchema: z.ZodType< .object({ trainingSteps: z.nullable(z.number().int()).optional(), learningRate: z.number().default(0.0001), + weightDecay: z.nullable(z.number()).optional(), + warmupFraction: z.nullable(z.number()).optional(), epochs: z.nullable(z.number()).optional(), fimRatio: z.nullable(z.number()).optional(), }) @@ -65,6 +81,8 @@ export const TrainingParametersIn$outboundSchema: z.ZodType< return remap$(v, { trainingSteps: "training_steps", learningRate: "learning_rate", + weightDecay: "weight_decay", + warmupFraction: "warmup_fraction", fimRatio: "fim_ratio", }); }); diff --git a/src/models/components/unarchiveftmodelout.ts b/src/models/components/unarchiveftmodelout.ts index 8fd0646..1be4dbd 100644 --- a/src/models/components/unarchiveftmodelout.ts +++ b/src/models/components/unarchiveftmodelout.ts @@ -2,14 +2,41 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; +export const UnarchiveFTModelOutObject = { + Model: "model", +} as const; +export type UnarchiveFTModelOutObject = ClosedEnum; + export type UnarchiveFTModelOut = { id: string; object?: "model" | undefined; archived?: boolean | undefined; }; +/** @internal */ +export const UnarchiveFTModelOutObject$inboundSchema: z.ZodNativeEnum< + typeof UnarchiveFTModelOutObject +> = z.nativeEnum(UnarchiveFTModelOutObject); + +/** @internal */ +export const UnarchiveFTModelOutObject$outboundSchema: z.ZodNativeEnum< + typeof UnarchiveFTModelOutObject +> = UnarchiveFTModelOutObject$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UnarchiveFTModelOutObject$ { + /** @deprecated use `UnarchiveFTModelOutObject$inboundSchema` instead. */ + export const inboundSchema = UnarchiveFTModelOutObject$inboundSchema; + /** @deprecated use `UnarchiveFTModelOutObject$outboundSchema` instead. */ + export const outboundSchema = UnarchiveFTModelOutObject$outboundSchema; +} + /** @internal */ export const UnarchiveFTModelOut$inboundSchema: z.ZodType< UnarchiveFTModelOut, @@ -17,8 +44,8 @@ export const UnarchiveFTModelOut$inboundSchema: z.ZodType< unknown > = z.object({ id: z.string(), - object: z.literal("model").default("model" as const), - archived: z.boolean().default(false), + object: z.literal("model").default("model"), + archived: z.boolean(), }); /** @internal */ @@ -35,7 +62,7 @@ export const UnarchiveFTModelOut$outboundSchema: z.ZodType< UnarchiveFTModelOut > = z.object({ id: z.string(), - object: z.literal("model").default("model" as const), + object: z.literal("model").default("model"), archived: z.boolean().default(false), }); diff --git a/src/models/components/uploadfileout.ts b/src/models/components/uploadfileout.ts index 5346483..3593152 100644 --- a/src/models/components/uploadfileout.ts +++ b/src/models/components/uploadfileout.ts @@ -3,10 +3,22 @@ */ import { remap as remap$ } from "../../lib/primitives.js"; +import { catchUnrecognizedEnum, OpenEnum, Unrecognized } from "../../types/enums.js"; import { SampleType, SampleType$inboundSchema, SampleType$outboundSchema } from "./sampletype.js"; import { Source, Source$inboundSchema, Source$outboundSchema } from "./source.js"; import * as z from "zod"; +/** + * The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. + */ +export const Purpose = { + FineTune: "fine-tune", +} as const; +/** + * The intended purpose of the uploaded file. Only accepts fine-tuning (`fine-tune`) for now. + */ +export type Purpose = OpenEnum; + export type UploadFileOut = { /** * The unique identifier of the file. @@ -37,6 +49,29 @@ export type UploadFileOut = { source: Source; }; +/** @internal */ +export const Purpose$inboundSchema: z.ZodType = z.union([ + z.nativeEnum(Purpose), + z.string().transform(catchUnrecognizedEnum), +]); + +/** @internal */ +export const Purpose$outboundSchema: z.ZodType = z.union([ + z.nativeEnum(Purpose), + z.string().and(z.custom>()), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Purpose$ { + /** @deprecated use `Purpose$inboundSchema` instead. */ + export const inboundSchema = Purpose$inboundSchema; + /** @deprecated use `Purpose$outboundSchema` instead. */ + export const outboundSchema = Purpose$outboundSchema; +} + /** @internal */ export const UploadFileOut$inboundSchema: z.ZodType = z .object({ @@ -83,7 +118,7 @@ export const UploadFileOut$outboundSchema: z.ZodType< bytes: z.number().int(), createdAt: z.number().int(), filename: z.string(), - purpose: z.literal("fine-tune").default("fine-tune" as const), + purpose: z.literal("fine-tune").default("fine-tune"), sampleType: SampleType$outboundSchema, numLines: z.nullable(z.number().int()).optional(), source: Source$outboundSchema, diff --git a/src/models/components/wandbintegration.ts b/src/models/components/wandbintegration.ts index 490b418..7ce8335 100644 --- a/src/models/components/wandbintegration.ts +++ b/src/models/components/wandbintegration.ts @@ -3,8 +3,14 @@ */ import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; +export const WandbIntegrationType = { + Wandb: "wandb", +} as const; +export type WandbIntegrationType = ClosedEnum; + export type WandbIntegration = { type?: "wandb" | undefined; /** @@ -22,10 +28,29 @@ export type WandbIntegration = { runName?: string | null | undefined; }; +/** @internal */ +export const WandbIntegrationType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(WandbIntegrationType); + +/** @internal */ +export const WandbIntegrationType$outboundSchema: z.ZodNativeEnum = + WandbIntegrationType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WandbIntegrationType$ { + /** @deprecated use `WandbIntegrationType$inboundSchema` instead. */ + export const inboundSchema = WandbIntegrationType$inboundSchema; + /** @deprecated use `WandbIntegrationType$outboundSchema` instead. */ + export const outboundSchema = WandbIntegrationType$outboundSchema; +} + /** @internal */ export const WandbIntegration$inboundSchema: z.ZodType = z .object({ - type: z.literal("wandb").default("wandb" as const), + type: z.literal("wandb").default("wandb"), project: z.string(), name: z.nullable(z.string()).optional(), api_key: z.string(), @@ -54,7 +79,7 @@ export const WandbIntegration$outboundSchema: z.ZodType< WandbIntegration > = z .object({ - type: z.literal("wandb").default("wandb" as const), + type: z.literal("wandb").default("wandb"), project: z.string(), name: z.nullable(z.string()).optional(), apiKey: z.string(), diff --git a/src/models/components/wandbintegrationout.ts b/src/models/components/wandbintegrationout.ts index 0275f40..d6c3536 100644 --- a/src/models/components/wandbintegrationout.ts +++ b/src/models/components/wandbintegrationout.ts @@ -3,8 +3,14 @@ */ import { remap as remap$ } from "../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; import * as z from "zod"; +export const Type = { + Wandb: "wandb", +} as const; +export type Type = ClosedEnum; + export type WandbIntegrationOut = { type?: "wandb" | undefined; /** @@ -18,6 +24,23 @@ export type WandbIntegrationOut = { runName?: string | null | undefined; }; +/** @internal */ +export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); + +/** @internal */ +export const Type$outboundSchema: z.ZodNativeEnum = Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Type$ { + /** @deprecated use `Type$inboundSchema` instead. */ + export const inboundSchema = Type$inboundSchema; + /** @deprecated use `Type$outboundSchema` instead. */ + export const outboundSchema = Type$outboundSchema; +} + /** @internal */ export const WandbIntegrationOut$inboundSchema: z.ZodType< WandbIntegrationOut, @@ -25,7 +48,7 @@ export const WandbIntegrationOut$inboundSchema: z.ZodType< unknown > = z .object({ - type: z.literal("wandb").default("wandb" as const), + type: z.literal("wandb").default("wandb"), project: z.string(), name: z.nullable(z.string()).optional(), run_name: z.nullable(z.string()).optional(), @@ -51,7 +74,7 @@ export const WandbIntegrationOut$outboundSchema: z.ZodType< WandbIntegrationOut > = z .object({ - type: z.literal("wandb").default("wandb" as const), + type: z.literal("wandb").default("wandb"), project: z.string(), name: z.nullable(z.string()).optional(), runName: z.nullable(z.string()).optional(), diff --git a/src/models/operations/filesapiroutesuploadfile.ts b/src/models/operations/filesapiroutesuploadfile.ts index 8a7adf9..3c7d697 100644 --- a/src/models/operations/filesapiroutesuploadfile.ts +++ b/src/models/operations/filesapiroutesuploadfile.ts @@ -4,8 +4,14 @@ import * as b64$ from "../../lib/base64.js"; import { blobLikeSchema } from "../../types/blobs.js"; +import { catchUnrecognizedEnum, OpenEnum, Unrecognized } from "../../types/enums.js"; import * as z from "zod"; +export const Purpose = { + FineTune: "fine-tune", +} as const; +export type Purpose = OpenEnum; + export type FileT = { fileName: string; content: Uint8Array | string; @@ -29,6 +35,29 @@ export type FilesApiRoutesUploadFileMultiPartBodyParams = { purpose?: "fine-tune" | undefined; }; +/** @internal */ +export const Purpose$inboundSchema: z.ZodType = z.union([ + z.nativeEnum(Purpose), + z.string().transform(catchUnrecognizedEnum), +]); + +/** @internal */ +export const Purpose$outboundSchema: z.ZodType = z.union([ + z.nativeEnum(Purpose), + z.string().and(z.custom>()), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Purpose$ { + /** @deprecated use `Purpose$inboundSchema` instead. */ + export const inboundSchema = Purpose$inboundSchema; + /** @deprecated use `Purpose$outboundSchema` instead. */ + export const outboundSchema = Purpose$outboundSchema; +} + /** @internal */ export const FileT$inboundSchema: z.ZodType = z.object({ fileName: z.string(), @@ -67,7 +96,7 @@ export const FilesApiRoutesUploadFileMultiPartBodyParams$inboundSchema: z.ZodTyp unknown > = z.object({ file: z.lazy(() => FileT$inboundSchema), - purpose: z.literal("fine-tune").default("fine-tune" as const), + purpose: z.literal("fine-tune").default("fine-tune"), }); /** @internal */ @@ -83,7 +112,7 @@ export const FilesApiRoutesUploadFileMultiPartBodyParams$outboundSchema: z.ZodTy FilesApiRoutesUploadFileMultiPartBodyParams > = z.object({ file: z.lazy(() => FileT$outboundSchema).or(blobLikeSchema), - purpose: z.literal("fine-tune").default("fine-tune" as const), + purpose: z.literal("fine-tune").default("fine-tune"), }); /** diff --git a/src/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.ts b/src/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.ts index 061ddca..63af58d 100644 --- a/src/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.ts +++ b/src/models/operations/jobsapiroutesfinetuninggetfinetuningjobs.ts @@ -100,7 +100,7 @@ export const JobsApiRoutesFineTuningGetFineTuningJobsRequest$inboundSchema: z.Zo .transform((v) => new Date(v)) ) .optional(), - created_by_me: z.boolean().default(false), + created_by_me: z.boolean(), status: z.nullable(Status$inboundSchema).optional(), wandb_project: z.nullable(z.string()).optional(), wandb_name: z.nullable(z.string()).optional(),