From df7960fcb017f7a01129faa7b14967ff4a58caad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:58:37 +0100 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.462.2 (#67) Co-authored-by: speakeasybot --- .speakeasy/workflow.lock | 12 ++-- packages/mistralai-azure/.gitignore | 2 + packages/mistralai-azure/.npmignore | 3 + packages/mistralai-azure/.speakeasy/gen.lock | 20 +++--- packages/mistralai-azure/.speakeasy/gen.yaml | 2 +- packages/mistralai-azure/RELEASES.md | 12 +++- packages/mistralai-azure/RUNTIMES.md | 28 ++++++++- packages/mistralai-azure/jsr.json | 2 +- packages/mistralai-azure/package-lock.json | 63 +------------------ packages/mistralai-azure/package.json | 4 +- .../mistralai-azure/src/funcs/chatComplete.ts | 1 + .../mistralai-azure/src/funcs/chatStream.ts | 1 + packages/mistralai-azure/src/hooks/hooks.ts | 20 ++++++ packages/mistralai-azure/src/hooks/types.ts | 7 +++ packages/mistralai-azure/src/lib/config.ts | 6 +- packages/mistralai-azure/src/lib/sdks.ts | 7 ++- packages/mistralai-azure/src/lib/security.ts | 2 +- .../components/chatcompletionrequest.ts | 12 ++-- .../components/chatcompletionstreamrequest.ts | 12 ++-- packages/mistralai-azure/tsconfig.json | 2 +- 20 files changed, 118 insertions(+), 100 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 7a9f2b0..7f8b82d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,11 +2,11 @@ speakeasyVersion: 1.462.2 sources: mistral-azure-source: sourceNamespace: mistral-azure-source - sourceRevisionDigest: sha256:9c35eed0174f2d8165807bcd7c8e7b7111fa97c059a77ae7eeaa352ca7e83b4d - sourceBlobDigest: sha256:07283bfde08363f9f69b133888b482472c4bf12d2e5b59cb33c8993c517278e3 + sourceRevisionDigest: sha256:ff181b1e0e3894a4925f7ae87415323058538a13bae9d9d508a8fe3b6ec0e333 + sourceBlobDigest: sha256:a2b4fd69298ebb9adb0d3c8dfb452db52defac512a7532203eebffb6a252df76 tags: - latest - - speakeasy-sdk-regen-1733304480 + - speakeasy-sdk-regen-1736159136 mistral-google-cloud-source: sourceNamespace: mistral-google-cloud-source sourceRevisionDigest: sha256:36c7de11e35023dc8fa5f3c0fb0e486d2a102275a2df808c08cfe9d43089be04 @@ -25,10 +25,10 @@ targets: mistralai-azure-sdk: source: mistral-azure-source sourceNamespace: mistral-azure-source - sourceRevisionDigest: sha256:9c35eed0174f2d8165807bcd7c8e7b7111fa97c059a77ae7eeaa352ca7e83b4d - sourceBlobDigest: sha256:07283bfde08363f9f69b133888b482472c4bf12d2e5b59cb33c8993c517278e3 + sourceRevisionDigest: sha256:ff181b1e0e3894a4925f7ae87415323058538a13bae9d9d508a8fe3b6ec0e333 + sourceBlobDigest: sha256:a2b4fd69298ebb9adb0d3c8dfb452db52defac512a7532203eebffb6a252df76 codeSamplesNamespace: mistral-openapi-azure-code-samples - codeSamplesRevisionDigest: sha256:1918c360fdb31c721fbc4e47a1b54530ba8deb526e638c9e61f039027343696f + codeSamplesRevisionDigest: sha256:902b01df2818b55417d86da5fba172ba7270df700ecd23525c7652976a2e8d37 mistralai-gcp-sdk: source: mistral-google-cloud-source sourceNamespace: mistral-google-cloud-source diff --git a/packages/mistralai-azure/.gitignore b/packages/mistralai-azure/.gitignore index a44de94..cfd905d 100644 --- a/packages/mistralai-azure/.gitignore +++ b/packages/mistralai-azure/.gitignore @@ -1,3 +1,5 @@ +/react-query +/.speakeasy/reports /__tests__ /core.* /funcs diff --git a/packages/mistralai-azure/.npmignore b/packages/mistralai-azure/.npmignore index 06cd8ab..9ad259e 100644 --- a/packages/mistralai-azure/.npmignore +++ b/packages/mistralai-azure/.npmignore @@ -1,4 +1,7 @@ **/* +!/FUNCTIONS.md +!/RUNTIMES.md +!/REACT_QUERY.md !/**/*.ts !/**/*.js !/**/*.map diff --git a/packages/mistralai-azure/.speakeasy/gen.lock b/packages/mistralai-azure/.speakeasy/gen.lock index 71f4a86..6643eb8 100644 --- a/packages/mistralai-azure/.speakeasy/gen.lock +++ b/packages/mistralai-azure/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 01e8a40b-3df3-4d9a-9501-2eb9e0d26c05 management: - docChecksum: 26271aa279a7a7182f7af19df8b67038 + docChecksum: 4da7c33f650ddf206c58fa6c941d347f docVersion: 0.0.2 - speakeasyVersion: 1.451.1 - generationVersion: 2.470.1 - releaseVersion: 1.3.5 - configChecksum: e32b498a394ce6079f7bced9cced33b5 + speakeasyVersion: 1.462.2 + generationVersion: 2.486.1 + releaseVersion: 1.3.6 + configChecksum: 1a7604afb27737dc44b544827a58e635 repoURL: https://github.com/mistralai/client-ts.git repoSubDirectory: packages/mistralai-azure installationURL: https://gitpkg.now.sh/mistralai/client-ts/packages/mistralai-azure @@ -15,12 +15,12 @@ features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.11 - core: 3.18.8 + core: 3.18.12 defaultEnabledRetries: 0.1.0 enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 examples: 2.81.4 - globalSecurity: 2.82.11 + globalSecurity: 2.82.12 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.4 @@ -167,6 +167,9 @@ examples: speakeasy-default-stream-chat: requestBody: application/json: {"model": "azureai", "messages": [{"content": "Who is the best French painter? Answer in one short sentence.", "role": "user"}]} + responses: + "422": + application/json: {} chat_completion_v1_chat_completions_post: speakeasy-default-chat-completion-v1-chat-completions-post: requestBody: @@ -174,5 +177,6 @@ examples: responses: "200": application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "mistral-small-latest", "usage": {"prompt_tokens": 16, "completion_tokens": 34, "total_tokens": 50}, "created": 1702256327, "choices": [{"index": 0, "finish_reason": "stop"}, {"index": 0, "finish_reason": "stop"}, {"index": 0, "finish_reason": "stop"}]} - "422": {} + "422": + application/json: {} generatedTests: {} diff --git a/packages/mistralai-azure/.speakeasy/gen.yaml b/packages/mistralai-azure/.speakeasy/gen.yaml index 36fa901..3c1b7ff 100644 --- a/packages/mistralai-azure/.speakeasy/gen.yaml +++ b/packages/mistralai-azure/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false typescript: - version: 1.3.5 + version: 1.3.6 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/packages/mistralai-azure/RELEASES.md b/packages/mistralai-azure/RELEASES.md index 6bc95bc..83741e6 100644 --- a/packages/mistralai-azure/RELEASES.md +++ b/packages/mistralai-azure/RELEASES.md @@ -88,4 +88,14 @@ Based on: ### Generated - [typescript v1.3.5] packages/mistralai-azure ### Releases -- [NPM v1.3.5] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.5 - packages/mistralai-azure \ No newline at end of file +- [NPM v1.3.5] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.5 - packages/mistralai-azure + +## 2025-01-06 10:25:32 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.462.2 (2.486.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.3.6] packages/mistralai-azure +### Releases +- [NPM v1.3.6] https://www.npmjs.com/package/@mistralai/mistralai-azure/v/1.3.6 - packages/mistralai-azure \ No newline at end of file diff --git a/packages/mistralai-azure/RUNTIMES.md b/packages/mistralai-azure/RUNTIMES.md index d08a0c0..db7ea94 100644 --- a/packages/mistralai-azure/RUNTIMES.md +++ b/packages/mistralai-azure/RUNTIMES.md @@ -1,6 +1,6 @@ # Supported JavaScript runtimes -This SDK is intended to be used in JavaScript runtimes that support the following features: +This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features: * [Web Fetch API][web-fetch] * [Web Streams API][web-streams] and in particular `ReadableStream` @@ -20,3 +20,29 @@ Runtime environments that are explicitly supported are: - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming]) [deno-file-streaming]: https://github.com/denoland/deno/issues/11018 + +## Recommended TypeScript compiler options + +The following `tsconfig.json` options are recommended for projects using this +SDK in order to get static type support for features like async iterables, +streams and `fetch`-related APIs ([`for await...of`][for-await-of], +[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and +so on): + +[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of +[abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal +[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request +[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response + +```jsonc +{ + "compilerOptions": { + "target": "es2020", // or higher + "lib": ["es2020", "dom", "dom.iterable"], + } +} +``` + +While `target` can be set to older ECMAScript versions, it may result in extra, +unnecessary compatibility code being generated if you are not targeting old +runtimes. \ No newline at end of file diff --git a/packages/mistralai-azure/jsr.json b/packages/mistralai-azure/jsr.json index 438a47f..97bb2af 100644 --- a/packages/mistralai-azure/jsr.json +++ b/packages/mistralai-azure/jsr.json @@ -2,7 +2,7 @@ { "name": "@mistralai/mistralai-azure", - "version": "1.3.5", + "version": "1.3.6", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/packages/mistralai-azure/package-lock.json b/packages/mistralai-azure/package-lock.json index 9ce537c..2f90179 100644 --- a/packages/mistralai-azure/package-lock.json +++ b/packages/mistralai-azure/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mistralai/mistralai-azure", - "version": "1.3.5", + "version": "1.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mistralai/mistralai-azure", - "version": "1.3.5", + "version": "1.3.6", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", @@ -17,8 +17,6 @@ "zod": "^3.23.4" }, "peerDependencies": { - "react": "^18 || ^19", - "react-dom": "^18 || ^19", "zod": ">= 3" } }, @@ -2218,13 +2216,6 @@ "dev": true, "license": "ISC" }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "license": "MIT", - "peer": true - }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -2319,19 +2310,6 @@ "dev": true, "license": "MIT" }, - "node_modules/loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "license": "MIT", - "peer": true, - "dependencies": { - "js-tokens": "^3.0.0 || ^4.0.0" - }, - "bin": { - "loose-envify": "cli.js" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2674,33 +2652,6 @@ ], "license": "MIT" }, - "node_modules/react": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", - "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", - "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.2" - }, - "peerDependencies": { - "react": "^18.3.1" - } - }, "node_modules/regexp.prototype.flags": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", @@ -2847,16 +2798,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/scheduler": { - "version": "0.23.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", - "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "loose-envify": "^1.1.0" - } - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", diff --git a/packages/mistralai-azure/package.json b/packages/mistralai-azure/package.json index 80cff18..06979c6 100644 --- a/packages/mistralai-azure/package.json +++ b/packages/mistralai-azure/package.json @@ -1,6 +1,6 @@ { "name": "@mistralai/mistralai-azure", - "version": "1.3.5", + "version": "1.3.6", "author": "Speakeasy", "main": "./index.js", "sideEffects": false, @@ -15,8 +15,6 @@ "prepublishOnly": "npm run build" }, "peerDependencies": { - "react": "^18 || ^19", - "react-dom": "^18 || ^19", "zod": ">= 3" }, "devDependencies": { diff --git a/packages/mistralai-azure/src/funcs/chatComplete.ts b/packages/mistralai-azure/src/funcs/chatComplete.ts index 15fd074..0c42108 100644 --- a/packages/mistralai-azure/src/funcs/chatComplete.ts +++ b/packages/mistralai-azure/src/funcs/chatComplete.ts @@ -80,6 +80,7 @@ export async function chatComplete( const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, diff --git a/packages/mistralai-azure/src/funcs/chatStream.ts b/packages/mistralai-azure/src/funcs/chatStream.ts index bcd2622..4f4e338 100644 --- a/packages/mistralai-azure/src/funcs/chatStream.ts +++ b/packages/mistralai-azure/src/funcs/chatStream.ts @@ -86,6 +86,7 @@ export async function chatStream( const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, diff --git a/packages/mistralai-azure/src/hooks/hooks.ts b/packages/mistralai-azure/src/hooks/hooks.ts index d1b3396..d34c884 100644 --- a/packages/mistralai-azure/src/hooks/hooks.ts +++ b/packages/mistralai-azure/src/hooks/hooks.ts @@ -12,6 +12,7 @@ import { BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, @@ -27,6 +28,25 @@ export class SDKHooks implements Hooks { afterErrorHooks: AfterErrorHook[] = []; constructor() { + const presetHooks: Array = []; + + for (const hook of presetHooks) { + if ("sdkInit" in hook) { + this.registerSDKInitHook(hook); + } + if ("beforeCreateRequest" in hook) { + this.registerBeforeCreateRequestHook(hook); + } + if ("beforeRequest" in hook) { + this.registerBeforeRequestHook(hook); + } + if ("afterSuccess" in hook) { + this.registerAfterSuccessHook(hook); + } + if ("afterError" in hook) { + this.registerAfterErrorHook(hook); + } + } initHooks(this); } diff --git a/packages/mistralai-azure/src/hooks/types.ts b/packages/mistralai-azure/src/hooks/types.ts index df5237d..8a27c65 100644 --- a/packages/mistralai-azure/src/hooks/types.ts +++ b/packages/mistralai-azure/src/hooks/types.ts @@ -100,3 +100,10 @@ export interface Hooks { /** Registers a hook to be used by the SDK for the after error event. */ registerAfterErrorHook(hook: AfterErrorHook): void; } + +export type Hook = + | SDKInitHook + | BeforeCreateRequestHook + | BeforeRequestHook + | AfterSuccessHook + | AfterErrorHook; diff --git a/packages/mistralai-azure/src/lib/config.ts b/packages/mistralai-azure/src/lib/config.ts index 95b7aff..b6163ca 100644 --- a/packages/mistralai-azure/src/lib/config.ts +++ b/packages/mistralai-azure/src/lib/config.ts @@ -55,8 +55,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.2", - sdkVersion: "1.3.5", - genVersion: "2.470.1", + sdkVersion: "1.3.6", + genVersion: "2.486.1", userAgent: - "speakeasy-sdk/typescript 1.3.5 2.470.1 0.0.2 @mistralai/mistralai-azure", + "speakeasy-sdk/typescript 1.3.6 2.486.1 0.0.2 @mistralai/mistralai-azure", } as const; diff --git a/packages/mistralai-azure/src/lib/sdks.ts b/packages/mistralai-azure/src/lib/sdks.ts index de56767..61ca008 100644 --- a/packages/mistralai-azure/src/lib/sdks.ts +++ b/packages/mistralai-azure/src/lib/sdks.ts @@ -42,6 +42,10 @@ export type RequestOptions = { * Specifies the status codes which should be retried using the given retry policy. */ retryCodes?: string[]; + /** + * Overrides the base server URL that will be used by an operation. + */ + serverURL?: string | URL; /** * Sets various request options on the `fetch` call made by an SDK method. * @@ -53,7 +57,7 @@ export type RequestOptions = { type RequestConfig = { method: string; path: string; - baseURL?: string | URL; + baseURL?: string | URL | undefined; query?: string; body?: RequestInit["body"]; headers?: HeadersInit; @@ -123,6 +127,7 @@ export class ClientSDK { const inputURL = new URL(path, reqURL); if (path) { + reqURL.pathname += reqURL.pathname.endsWith("/") ? "" : "/"; reqURL.pathname += inputURL.pathname.replace(/^\/+/, ""); } diff --git a/packages/mistralai-azure/src/lib/security.ts b/packages/mistralai-azure/src/lib/security.ts index cd9a17b..302feed 100644 --- a/packages/mistralai-azure/src/lib/security.ts +++ b/packages/mistralai-azure/src/lib/security.ts @@ -118,7 +118,7 @@ export function resolveSecurity( ...options: SecurityInput[][] ): SecurityState | null { const state: SecurityState = { - basic: { username: "", password: "" }, + basic: {}, headers: {}, queryParams: {}, cookies: {}, diff --git a/packages/mistralai-azure/src/models/components/chatcompletionrequest.ts b/packages/mistralai-azure/src/models/components/chatcompletionrequest.ts index 7032582..c1795a3 100644 --- a/packages/mistralai-azure/src/models/components/chatcompletionrequest.ts +++ b/packages/mistralai-azure/src/models/components/chatcompletionrequest.ts @@ -323,7 +323,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string().default("azureai")), temperature: z.nullable(z.number()).optional(), - top_p: z.number().default(1), + top_p: z.number().optional(), max_tokens: z.nullable(z.number().int()).optional(), stream: z.boolean().default(false), stop: z.union([z.string(), z.array(z.string())]).optional(), @@ -359,7 +359,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType< presence_penalty: z.number().optional(), frequency_penalty: z.number().optional(), n: z.nullable(z.number().int()).optional(), - safe_prompt: z.boolean().default(false), + safe_prompt: z.boolean().optional(), }).transform((v) => { return remap$(v, { "top_p": "topP", @@ -377,7 +377,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType< export type ChatCompletionRequest$Outbound = { model: string | null; temperature?: number | null | undefined; - top_p: number; + top_p?: number | undefined; max_tokens?: number | null | undefined; stream: boolean; stop?: string | Array | undefined; @@ -394,7 +394,7 @@ export type ChatCompletionRequest$Outbound = { presence_penalty?: number | undefined; frequency_penalty?: number | undefined; n?: number | null | undefined; - safe_prompt: boolean; + safe_prompt?: boolean | undefined; }; /** @internal */ @@ -405,7 +405,7 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string().default("azureai")), temperature: z.nullable(z.number()).optional(), - topP: z.number().default(1), + topP: z.number().optional(), maxTokens: z.nullable(z.number().int()).optional(), stream: z.boolean().default(false), stop: z.union([z.string(), z.array(z.string())]).optional(), @@ -443,7 +443,7 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType< presencePenalty: z.number().optional(), frequencyPenalty: z.number().optional(), n: z.nullable(z.number().int()).optional(), - safePrompt: z.boolean().default(false), + safePrompt: z.boolean().optional(), }).transform((v) => { return remap$(v, { topP: "top_p", diff --git a/packages/mistralai-azure/src/models/components/chatcompletionstreamrequest.ts b/packages/mistralai-azure/src/models/components/chatcompletionstreamrequest.ts index 9ee52f2..7b8f2cf 100644 --- a/packages/mistralai-azure/src/models/components/chatcompletionstreamrequest.ts +++ b/packages/mistralai-azure/src/models/components/chatcompletionstreamrequest.ts @@ -307,7 +307,7 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string().default("azureai")), temperature: z.nullable(z.number()).optional(), - top_p: z.number().default(1), + top_p: z.number().optional(), max_tokens: z.nullable(z.number().int()).optional(), stream: z.boolean().default(true), stop: z.union([z.string(), z.array(z.string())]).optional(), @@ -343,7 +343,7 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType< presence_penalty: z.number().optional(), frequency_penalty: z.number().optional(), n: z.nullable(z.number().int()).optional(), - safe_prompt: z.boolean().default(false), + safe_prompt: z.boolean().optional(), }).transform((v) => { return remap$(v, { "top_p": "topP", @@ -361,7 +361,7 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType< export type ChatCompletionStreamRequest$Outbound = { model: string | null; temperature?: number | null | undefined; - top_p: number; + top_p?: number | undefined; max_tokens?: number | null | undefined; stream: boolean; stop?: string | Array | undefined; @@ -378,7 +378,7 @@ export type ChatCompletionStreamRequest$Outbound = { presence_penalty?: number | undefined; frequency_penalty?: number | undefined; n?: number | null | undefined; - safe_prompt: boolean; + safe_prompt?: boolean | undefined; }; /** @internal */ @@ -389,7 +389,7 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string().default("azureai")), temperature: z.nullable(z.number()).optional(), - topP: z.number().default(1), + topP: z.number().optional(), maxTokens: z.nullable(z.number().int()).optional(), stream: z.boolean().default(true), stop: z.union([z.string(), z.array(z.string())]).optional(), @@ -427,7 +427,7 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType< presencePenalty: z.number().optional(), frequencyPenalty: z.number().optional(), n: z.nullable(z.number().int()).optional(), - safePrompt: z.boolean().default(false), + safePrompt: z.boolean().optional(), }).transform((v) => { return remap$(v, { topP: "top_p", diff --git a/packages/mistralai-azure/tsconfig.json b/packages/mistralai-azure/tsconfig.json index f9d286a..94d81a3 100644 --- a/packages/mistralai-azure/tsconfig.json +++ b/packages/mistralai-azure/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "incremental": true, "tsBuildInfoFile": ".tsbuildinfo", - "target": "ES2018", + "target": "ES2020", "lib": ["ES2022", "DOM", "DOM.Iterable"], "jsx": "react-jsx",