From e8aaabd6f47b5b11ccbf8fd4ddc175bd64c7c312 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:27 +0100 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.462.2 (#68) Co-authored-by: speakeasybot --- .speakeasy/workflow.lock | 12 ++-- packages/mistralai-gcp/.gitignore | 2 + packages/mistralai-gcp/.npmignore | 3 + packages/mistralai-gcp/.speakeasy/gen.lock | 26 +++++--- packages/mistralai-gcp/.speakeasy/gen.yaml | 2 +- packages/mistralai-gcp/RELEASES.md | 12 +++- packages/mistralai-gcp/RUNTIMES.md | 28 ++++++++- packages/mistralai-gcp/jsr.json | 2 +- packages/mistralai-gcp/package-lock.json | 63 +------------------ packages/mistralai-gcp/package.json | 4 +- .../mistralai-gcp/src/funcs/chatComplete.ts | 1 + .../mistralai-gcp/src/funcs/chatStream.ts | 1 + .../mistralai-gcp/src/funcs/fimComplete.ts | 1 + packages/mistralai-gcp/src/funcs/fimStream.ts | 1 + packages/mistralai-gcp/src/hooks/hooks.ts | 20 ++++++ packages/mistralai-gcp/src/hooks/types.ts | 7 +++ packages/mistralai-gcp/src/lib/config.ts | 6 +- packages/mistralai-gcp/src/lib/sdks.ts | 7 ++- packages/mistralai-gcp/src/lib/security.ts | 2 +- .../components/chatcompletionrequest.ts | 6 +- .../components/chatcompletionstreamrequest.ts | 6 +- packages/mistralai-gcp/tsconfig.json | 2 +- 22 files changed, 119 insertions(+), 95 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2858765..7a9f2b0 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -9,11 +9,11 @@ sources: - speakeasy-sdk-regen-1733304480 mistral-google-cloud-source: sourceNamespace: mistral-google-cloud-source - sourceRevisionDigest: sha256:e0fd58ce2dbba068f375d3a23d758b8678c2a68cf4fc7bc46ea7e1b37abe0647 - sourceBlobDigest: sha256:0707d8d2566a9ef4ef286bb0abe467f8696ccf83ba73091065d7caf627a06611 + sourceRevisionDigest: sha256:36c7de11e35023dc8fa5f3c0fb0e486d2a102275a2df808c08cfe9d43089be04 + sourceBlobDigest: sha256:dd65bfa5d0448ad1851ebb18b57aa675533cd3e166beb86a390b0ab51d16a1c1 tags: - latest - - speakeasy-sdk-regen-1733235231 + - speakeasy-sdk-regen-1736159146 mistral-openapi: sourceNamespace: mistral-openapi sourceRevisionDigest: sha256:84bbc6f6011a31e21c8a674b01104446f986c7b5a6b002357800be8ef939b8da @@ -32,10 +32,10 @@ targets: mistralai-gcp-sdk: source: mistral-google-cloud-source sourceNamespace: mistral-google-cloud-source - sourceRevisionDigest: sha256:e0fd58ce2dbba068f375d3a23d758b8678c2a68cf4fc7bc46ea7e1b37abe0647 - sourceBlobDigest: sha256:0707d8d2566a9ef4ef286bb0abe467f8696ccf83ba73091065d7caf627a06611 + sourceRevisionDigest: sha256:36c7de11e35023dc8fa5f3c0fb0e486d2a102275a2df808c08cfe9d43089be04 + sourceBlobDigest: sha256:dd65bfa5d0448ad1851ebb18b57aa675533cd3e166beb86a390b0ab51d16a1c1 codeSamplesNamespace: mistral-openapi-google-cloud-code-samples - codeSamplesRevisionDigest: sha256:9c3e749304cf1c4e6380d8d0b1aa375d0871e2b8843e7fac3fbd305727611f3f + codeSamplesRevisionDigest: sha256:6c7faa1abe9597dda347362852d0568923249ad1b1a139dc7a3d8199c51debd1 mistralai-sdk: source: mistral-openapi sourceNamespace: mistral-openapi diff --git a/packages/mistralai-gcp/.gitignore b/packages/mistralai-gcp/.gitignore index a44de94..cfd905d 100644 --- a/packages/mistralai-gcp/.gitignore +++ b/packages/mistralai-gcp/.gitignore @@ -1,3 +1,5 @@ +/react-query +/.speakeasy/reports /__tests__ /core.* /funcs diff --git a/packages/mistralai-gcp/.npmignore b/packages/mistralai-gcp/.npmignore index 06cd8ab..9ad259e 100644 --- a/packages/mistralai-gcp/.npmignore +++ b/packages/mistralai-gcp/.npmignore @@ -1,4 +1,7 @@ **/* +!/FUNCTIONS.md +!/RUNTIMES.md +!/REACT_QUERY.md !/**/*.ts !/**/*.js !/**/*.map diff --git a/packages/mistralai-gcp/.speakeasy/gen.lock b/packages/mistralai-gcp/.speakeasy/gen.lock index 6e58c0e..f756190 100644 --- a/packages/mistralai-gcp/.speakeasy/gen.lock +++ b/packages/mistralai-gcp/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: c6044247-eaf9-46da-b078-0e1334e93be2 management: - docChecksum: d50a06ac34844141709fa2e57cc940c5 + docChecksum: 849dde0ef239604ca71711ffc1220b54 docVersion: 0.0.2 - speakeasyVersion: 1.451.1 - generationVersion: 2.470.1 - releaseVersion: 1.3.5 - configChecksum: 919939b6307829dceea203eaa634d4ec + speakeasyVersion: 1.462.2 + generationVersion: 2.486.1 + releaseVersion: 1.3.6 + configChecksum: c5bd18e35398f8075849552f082a51a7 repoURL: https://github.com/mistralai/client-ts.git repoSubDirectory: packages/mistralai-gcp installationURL: https://gitpkg.now.sh/mistralai/client-ts/packages/mistralai-gcp @@ -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 @@ -177,6 +177,9 @@ examples: speakeasy-default-stream-chat: requestBody: application/json: {"model": "mistral-small-latest", "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: @@ -184,11 +187,15 @@ 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: {} stream_fim: speakeasy-default-stream-fim: requestBody: application/json: {"model": "codestral-2405", "prompt": "def", "suffix": "return a+b"} + responses: + "422": + application/json: {} fim_completion_v1_fim_completions_post: speakeasy-default-fim-completion-v1-fim-completions-post: requestBody: @@ -196,5 +203,6 @@ examples: responses: "200": application/json: {"id": "cmpl-e5cc70bb28c444948073e77776eb30ef", "object": "chat.completion", "model": "codestral-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-gcp/.speakeasy/gen.yaml b/packages/mistralai-gcp/.speakeasy/gen.yaml index c465b2f..9f3e780 100644 --- a/packages/mistralai-gcp/.speakeasy/gen.yaml +++ b/packages/mistralai-gcp/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false typescript: - version: 1.3.5 + version: 1.3.6 additionalDependencies: dependencies: google-auth-library: ^9.11.0 diff --git a/packages/mistralai-gcp/RELEASES.md b/packages/mistralai-gcp/RELEASES.md index 15dddbf..69c594f 100644 --- a/packages/mistralai-gcp/RELEASES.md +++ b/packages/mistralai-gcp/RELEASES.md @@ -88,4 +88,14 @@ Based on: ### Generated - [typescript v1.3.5] packages/mistralai-gcp ### Releases -- [NPM v1.3.5] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.5 - packages/mistralai-gcp \ No newline at end of file +- [NPM v1.3.5] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.5 - packages/mistralai-gcp + +## 2025-01-06 10:25:42 +### 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-gcp +### Releases +- [NPM v1.3.6] https://www.npmjs.com/package/@mistralai/mistralai-gcp/v/1.3.6 - packages/mistralai-gcp \ No newline at end of file diff --git a/packages/mistralai-gcp/RUNTIMES.md b/packages/mistralai-gcp/RUNTIMES.md index d08a0c0..db7ea94 100644 --- a/packages/mistralai-gcp/RUNTIMES.md +++ b/packages/mistralai-gcp/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-gcp/jsr.json b/packages/mistralai-gcp/jsr.json index 04f7ad8..e5a0787 100644 --- a/packages/mistralai-gcp/jsr.json +++ b/packages/mistralai-gcp/jsr.json @@ -2,7 +2,7 @@ { "name": "@mistralai/mistralai-gcp", - "version": "1.3.5", + "version": "1.3.6", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/packages/mistralai-gcp/package-lock.json b/packages/mistralai-gcp/package-lock.json index 793be9b..3fadcd4 100644 --- a/packages/mistralai-gcp/package-lock.json +++ b/packages/mistralai-gcp/package-lock.json @@ -1,12 +1,12 @@ { "name": "@mistralai/mistralai-gcp", - "version": "1.3.5", + "version": "1.3.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@mistralai/mistralai-gcp", - "version": "1.3.5", + "version": "1.3.6", "dependencies": { "google-auth-library": "^9.11.0" }, @@ -20,8 +20,6 @@ "zod": "^3.23.4" }, "peerDependencies": { - "react": "^18 || ^19", - "react-dom": "^18 || ^19", "zod": ">= 3" } }, @@ -2366,13 +2364,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", @@ -2497,19 +2488,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", @@ -2871,33 +2849,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", @@ -3064,16 +3015,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-gcp/package.json b/packages/mistralai-gcp/package.json index 082a605..b7624ee 100644 --- a/packages/mistralai-gcp/package.json +++ b/packages/mistralai-gcp/package.json @@ -1,6 +1,6 @@ { "name": "@mistralai/mistralai-gcp", - "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-gcp/src/funcs/chatComplete.ts b/packages/mistralai-gcp/src/funcs/chatComplete.ts index 8a58599..b6f4ce8 100644 --- a/packages/mistralai-gcp/src/funcs/chatComplete.ts +++ b/packages/mistralai-gcp/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-gcp/src/funcs/chatStream.ts b/packages/mistralai-gcp/src/funcs/chatStream.ts index 5b8aa81..98daea7 100644 --- a/packages/mistralai-gcp/src/funcs/chatStream.ts +++ b/packages/mistralai-gcp/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-gcp/src/funcs/fimComplete.ts b/packages/mistralai-gcp/src/funcs/fimComplete.ts index 95da4f0..fe8569f 100644 --- a/packages/mistralai-gcp/src/funcs/fimComplete.ts +++ b/packages/mistralai-gcp/src/funcs/fimComplete.ts @@ -83,6 +83,7 @@ export async function fimComplete( const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, diff --git a/packages/mistralai-gcp/src/funcs/fimStream.ts b/packages/mistralai-gcp/src/funcs/fimStream.ts index 6b79683..5ecd96a 100644 --- a/packages/mistralai-gcp/src/funcs/fimStream.ts +++ b/packages/mistralai-gcp/src/funcs/fimStream.ts @@ -86,6 +86,7 @@ export async function fimStream( const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, diff --git a/packages/mistralai-gcp/src/hooks/hooks.ts b/packages/mistralai-gcp/src/hooks/hooks.ts index d1b3396..d34c884 100644 --- a/packages/mistralai-gcp/src/hooks/hooks.ts +++ b/packages/mistralai-gcp/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-gcp/src/hooks/types.ts b/packages/mistralai-gcp/src/hooks/types.ts index df5237d..8a27c65 100644 --- a/packages/mistralai-gcp/src/hooks/types.ts +++ b/packages/mistralai-gcp/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-gcp/src/lib/config.ts b/packages/mistralai-gcp/src/lib/config.ts index 32fb67e..3bd1f33 100644 --- a/packages/mistralai-gcp/src/lib/config.ts +++ b/packages/mistralai-gcp/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-gcp", + "speakeasy-sdk/typescript 1.3.6 2.486.1 0.0.2 @mistralai/mistralai-gcp", } as const; diff --git a/packages/mistralai-gcp/src/lib/sdks.ts b/packages/mistralai-gcp/src/lib/sdks.ts index 2ce720a..334bc3d 100644 --- a/packages/mistralai-gcp/src/lib/sdks.ts +++ b/packages/mistralai-gcp/src/lib/sdks.ts @@ -41,6 +41,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. * @@ -52,7 +56,7 @@ export type RequestOptions = { type RequestConfig = { method: string; path: string; - baseURL?: string | URL; + baseURL?: string | URL | undefined; query?: string; body?: RequestInit["body"]; headers?: HeadersInit; @@ -119,6 +123,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-gcp/src/lib/security.ts b/packages/mistralai-gcp/src/lib/security.ts index a2054cd..a596ac6 100644 --- a/packages/mistralai-gcp/src/lib/security.ts +++ b/packages/mistralai-gcp/src/lib/security.ts @@ -117,7 +117,7 @@ export function resolveSecurity( ...options: SecurityInput[][] ): SecurityState | null { const state: SecurityState = { - basic: { username: "", password: "" }, + basic: {}, headers: {}, queryParams: {}, cookies: {}, diff --git a/packages/mistralai-gcp/src/models/components/chatcompletionrequest.ts b/packages/mistralai-gcp/src/models/components/chatcompletionrequest.ts index 5ab20df..c45bf9a 100644 --- a/packages/mistralai-gcp/src/models/components/chatcompletionrequest.ts +++ b/packages/mistralai-gcp/src/models/components/chatcompletionrequest.ts @@ -319,7 +319,7 @@ export const ChatCompletionRequest$inboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string()), 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(), @@ -371,7 +371,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; @@ -398,7 +398,7 @@ export const ChatCompletionRequest$outboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string()), 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(), diff --git a/packages/mistralai-gcp/src/models/components/chatcompletionstreamrequest.ts b/packages/mistralai-gcp/src/models/components/chatcompletionstreamrequest.ts index 1adaf9e..e8155b4 100644 --- a/packages/mistralai-gcp/src/models/components/chatcompletionstreamrequest.ts +++ b/packages/mistralai-gcp/src/models/components/chatcompletionstreamrequest.ts @@ -303,7 +303,7 @@ export const ChatCompletionStreamRequest$inboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string()), 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(), @@ -355,7 +355,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; @@ -382,7 +382,7 @@ export const ChatCompletionStreamRequest$outboundSchema: z.ZodType< > = z.object({ model: z.nullable(z.string()), 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(), diff --git a/packages/mistralai-gcp/tsconfig.json b/packages/mistralai-gcp/tsconfig.json index f9d286a..94d81a3 100644 --- a/packages/mistralai-gcp/tsconfig.json +++ b/packages/mistralai-gcp/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "incremental": true, "tsBuildInfoFile": ".tsbuildinfo", - "target": "ES2018", + "target": "ES2020", "lib": ["ES2022", "DOM", "DOM.Iterable"], "jsx": "react-jsx",