diff --git a/core/config/sharedConfig.ts b/core/config/sharedConfig.ts index 6bec99452..cfee4d047 100644 --- a/core/config/sharedConfig.ts +++ b/core/config/sharedConfig.ts @@ -1,18 +1,11 @@ -import { - ModelRole, - modelRolesSchema, -} from "@continuedev/config-yaml/dist/schemas/models"; import z from "zod"; import { BrowserSerializedContinueConfig, - ContinueConfig, Config, + ContinueConfig, SerializedContinueConfig, } from ".."; -import { GlobalContext } from "../util/GlobalContext"; - -const selectedModelsSchema = z.record(modelRolesSchema, z.string().nullable()); export const sharedConfigSchema = z .object({ diff --git a/core/config/yaml/models.ts b/core/config/yaml/models.ts index e6d0ef00a..d77e27a7b 100644 --- a/core/config/yaml/models.ts +++ b/core/config/yaml/models.ts @@ -51,6 +51,52 @@ async function modelConfigToBaseLLM( promptTemplates: model.promptTemplates, }; + if (model.embedOptions?.maxBatchSize) { + options.maxEmbeddingBatchSize = model.embedOptions.maxBatchSize; + } + if (model.embedOptions?.maxChunkSize) { + options.maxEmbeddingChunkSize = model.embedOptions.maxChunkSize; + } + + // Things that are in config types for + const env = model.env ?? {}; + if ( + "useLegacyCompletionsEndpoint" in env && + typeof env.useLegacyCompletionsEndpoint === "boolean" + ) { + options.useLegacyCompletionsEndpoint = env.useLegacyCompletionsEndpoint; + } + if ("apiType" in env && typeof env.apiType === "string") { + options.apiType = env.apiType; + } + if ("apiVersion" in env && typeof env.apiVersion === "string") { + options.apiVersion = env.apiVersion; + } + if ("deployment" in env && typeof env.deployment === "string") { + options.deployment = env.deployment; + } + if ("deploymentId" in env && typeof env.deploymentId === "string") { + options.deploymentId = env.deploymentId; + } + if ("projectId" in env && typeof env.projectId === "string") { + options.projectId = env.projectId; + } + if ("region" in env && typeof env.region === "string") { + options.region = env.region; + } + if ("profile" in env && typeof env.profile === "string") { + options.profile = env.profile; + } + if ("modelArn" in env && typeof env.modelArn === "string") { + options.modelArn = env.modelArn; + } + if ("aiGatewaySlug" in env && typeof env.aiGatewaySlug === "string") { + options.aiGatewaySlug = env.aiGatewaySlug; + } + if ("accountId" in env && typeof env.accountId === "string") { + options.accountId = env.accountId; + } + const llm = new cls(options); return llm; } diff --git a/core/data/log.ts b/core/data/log.ts index 9f9140844..1b810d851 100644 --- a/core/data/log.ts +++ b/core/data/log.ts @@ -10,7 +10,7 @@ import { import { fetchwithRequestOptions } from "@continuedev/fetch"; import * as URI from "uri-js"; import { fileURLToPath } from "url"; -import { ZodObject } from "zod"; +import { AnyZodObject } from "zod"; import { Core } from "../core.js"; import { IdeInfo, IdeSettings } from "../index.js"; import { getDevDataFilePath } from "../util/paths.js"; @@ -37,7 +37,7 @@ export class DataLogger { body: Record, eventName: string, schema: string, - zodSchema: ZodObject, + zodSchema: AnyZodObject, ): Promise> { const newBody = { ...body }; const ideSettings = await this.ideSettingsPromise; diff --git a/core/index.d.ts b/core/index.d.ts index 5010591cb..2d60c4663 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -518,6 +518,8 @@ export interface LLMOptions { // IBM watsonx Options deploymentId?: string; + + env?: Record; } type RequireAtLeastOne = Pick< @@ -956,7 +958,8 @@ export interface EmbedOptions { apiVersion?: string; requestOptions?: RequestOptions; maxEmbeddingChunkSize?: number; - maxEmbeddingChunkSize?: number; + maxEmbeddingBatchSize?: number; + // AWS options profile?: string; diff --git a/core/package-lock.json b/core/package-lock.json index bbb142ecd..331adaa27 100644 --- a/core/package-lock.json +++ b/core/package-lock.json @@ -13,7 +13,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.50", + "@continuedev/config-yaml": "file:///users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -106,6 +106,7 @@ "node": ">=20.11.0" } }, + "../../../../../../../users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist": {}, "node_modules/@75lb/deep-merge": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@75lb/deep-merge/-/deep-merge-1.1.2.tgz", @@ -3038,14 +3039,8 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.50", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.50.tgz", - "integrity": "sha512-WRoMOPhHUjJ/y5GjsL8dkVvzAKRbb4zjfOvmUutHxGUu9lQkuAOnRATnOnLiowTY/xgImPTifOuyc79WyJRFzw==", - "dependencies": { - "@continuedev/config-types": "^1.0.14", - "yaml": "^2.6.1", - "zod": "^3.24.2" - } + "resolved": "../../../../../../../users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", + "link": true }, "node_modules/@continuedev/fetch": { "version": "1.0.4", diff --git a/core/package.json b/core/package.json index f056811c6..7a7207e79 100644 --- a/core/package.json +++ b/core/package.json @@ -46,7 +46,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "file:///users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", + "@continuedev/config-yaml": "^1.0.51", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index ed02a60b5..ad7ee1193 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.270", + "version": "0.9.271", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.270", + "version": "0.9.271", "license": "Apache-2.0", "dependencies": { "@continuedev/fetch": "^1.0.3", @@ -106,7 +106,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.50", + "@continuedev/config-yaml": "file:///users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", diff --git a/gui/package-lock.json b/gui/package-lock.json index 0ba9522bd..879f9c0e5 100644 --- a/gui/package-lock.json +++ b/gui/package-lock.json @@ -7,7 +7,7 @@ "name": "gui", "license": "Apache-2.0", "dependencies": { - "@continuedev/config-yaml": "^1.0.50", + "@continuedev/config-yaml": "file:///users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", @@ -98,6 +98,7 @@ "node": ">=20.11.0" } }, + "../../../../../../../users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist": {}, "../core": { "name": "@continuedev/core", "version": "1.0.13", @@ -107,7 +108,7 @@ "@aws-sdk/client-sagemaker-runtime": "^3.621.0", "@aws-sdk/credential-providers": "^3.620.1", "@continuedev/config-types": "^1.0.13", - "@continuedev/config-yaml": "^1.0.50", + "@continuedev/config-yaml": "file:///users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -546,23 +547,9 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@continuedev/config-types": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@continuedev/config-types/-/config-types-1.0.14.tgz", - "integrity": "sha512-PVHyHPyRXd2QsaNgnCpiKYU3uHFTlyuQSkqE8OwrBmQqO6/TXUVIr/2EGtyIZGrml4Y+rGMSH40WU4/0t4SGpQ==", - "dependencies": { - "zod": "^3.23.8" - } - }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.50", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.50.tgz", - "integrity": "sha512-WRoMOPhHUjJ/y5GjsL8dkVvzAKRbb4zjfOvmUutHxGUu9lQkuAOnRATnOnLiowTY/xgImPTifOuyc79WyJRFzw==", - "dependencies": { - "@continuedev/config-types": "^1.0.14", - "yaml": "^2.6.1", - "zod": "^3.24.2" - } + "resolved": "../../../../../../../users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", + "link": true }, "node_modules/@emotion/is-prop-valid": { "version": "1.3.1", @@ -13713,6 +13700,7 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "dev": true, "bin": { "yaml": "bin.mjs" }, @@ -13732,14 +13720,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/zod": { - "version": "3.24.2", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", - "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/zwitch": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", diff --git a/gui/package.json b/gui/package.json index 75a5b7df5..84cb7e00b 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "file:///users/dallin/documents/code/continuedev/continue/packages/config-yaml/dist", + "@continuedev/config-yaml": "^1.0.51", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", diff --git a/packages/config-types/package.json b/packages/config-types/package.json index 99df3ce60..5c420223f 100644 --- a/packages/config-types/package.json +++ b/packages/config-types/package.json @@ -15,6 +15,6 @@ "typescript": "^5.5.2" }, "dependencies": { - "zod": "^3.23.8" + "zod": "^3.24.2" } } diff --git a/packages/config-yaml/package-lock.json b/packages/config-yaml/package-lock.json index c09777782..dd354c24d 100644 --- a/packages/config-yaml/package-lock.json +++ b/packages/config-yaml/package-lock.json @@ -1,12 +1,12 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.48", + "version": "1.0.50", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@continuedev/config-yaml", - "version": "1.0.48", + "version": "1.0.50", "license": "Apache-2.0", "dependencies": { "@continuedev/config-types": "^1.0.14", diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index 75d11129a..0fb970562 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.50", + "version": "1.0.51", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/config-yaml/src/index.ts b/packages/config-yaml/src/index.ts index 2e39af496..b64db7497 100644 --- a/packages/config-yaml/src/index.ts +++ b/packages/config-yaml/src/index.ts @@ -9,5 +9,5 @@ export * from "./load/proxySecretResolution.js"; export * from "./load/unroll.js"; export * from "./schemas/data/index.js"; export * from "./schemas/index.js"; -export type { EmbedOptions, ModelConfig, ModelRole } from "./schemas/models.js"; +export * from "./schemas/models.js"; export * from "./validation.js"; diff --git a/packages/config-yaml/src/schemas/models.ts b/packages/config-yaml/src/schemas/models.ts index 785cf0c7a..1fd6247a6 100644 --- a/packages/config-yaml/src/schemas/models.ts +++ b/packages/config-yaml/src/schemas/models.ts @@ -65,7 +65,9 @@ const baseModelFields = { requestOptions: requestOptionsSchema.optional(), embedOptions: embedOptionsSchema.optional(), promptTemplates: promptTemplatesSchema.optional(), - env: z.record(z.string(), z.string()).optional(), + env: z + .record(z.string(), z.union([z.string(), z.boolean(), z.number()])) + .optional(), }; export const modelSchema = z.union([ diff --git a/packages/openai-adapters/package.json b/packages/openai-adapters/package.json index e4307af6a..b2d293852 100644 --- a/packages/openai-adapters/package.json +++ b/packages/openai-adapters/package.json @@ -14,12 +14,12 @@ "dependencies": { "@azure/openai": "^1.0.0-beta.12", "@continuedev/config-types": "^1.0.5", - "@continuedev/config-yaml": "^1.0.50", + "@continuedev/config-yaml": "^1.0.51", "@continuedev/fetch": "^1.0.3", "json-schema": "^0.4.0", "node-fetch": "^3.3.2", "openai": "^4.76.0", - "zod": "^3.23.8" + "zod": "^3.24.2" }, "devDependencies": { "@types/follow-redirects": "^1.14.4",