diff --git a/core/index.d.ts b/core/index.d.ts index 7f173597f..0b38062a5 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -482,7 +482,7 @@ export interface LLMOptions { // continueProperties apiKeyLocation?: string; apiBase?: string; - organizationSlug?: string; + orgScopeId?: string | null; aiGatewaySlug?: string; cacheBehavior?: CacheBehavior; @@ -928,7 +928,7 @@ export interface ModelDescription { // continueProperties apiKeyLocation?: string; apiBase?: string; - organizationSlug?: string; + orgScopeId?: string | null; contextLength?: number; maxStopWords?: number; diff --git a/core/llm/index.ts b/core/llm/index.ts index 0b8ec87f6..5b90c7bb8 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -122,7 +122,7 @@ export abstract class BaseLLM implements ILLM { // continueProperties apiKeyLocation?: string; apiBase?: string; - organizationSlug?: string; + orgScopeId?: string | null; cacheBehavior?: CacheBehavior; capabilities?: ModelCapability; @@ -205,7 +205,7 @@ export abstract class BaseLLM implements ILLM { // continueProperties this.apiKeyLocation = options.apiKeyLocation; - this.organizationSlug = options.organizationSlug; + this.orgScopeId = options.orgScopeId; this.apiBase = options.apiBase; this.aiGatewaySlug = options.aiGatewaySlug; diff --git a/core/llm/llms/stubs/ContinueProxy.ts b/core/llm/llms/stubs/ContinueProxy.ts index 3a9049876..62138b1ce 100644 --- a/core/llm/llms/stubs/ContinueProxy.ts +++ b/core/llm/llms/stubs/ContinueProxy.ts @@ -1,3 +1,5 @@ +import { ContinueProperties } from "@continuedev/config-yaml"; + import { ControlPlaneProxyInfo } from "../../../control-plane/analytics/IAnalyticsProvider.js"; import { Telemetry } from "../../../util/posthog.js"; import OpenAI from "../OpenAI.js"; @@ -19,7 +21,7 @@ class ContinueProxy extends OpenAI { super(options); this.actualApiBase = options.apiBase; this.apiKeyLocation = options.apiKeyLocation; - this.organizationSlug = options.organizationSlug; + this.orgScopeId = options.orgScopeId; } static providerName = "continue-proxy"; @@ -28,12 +30,13 @@ class ContinueProxy extends OpenAI { }; protected extraBodyProperties(): Record { + const continueProperties: ContinueProperties = { + apiKeyLocation: this.apiKeyLocation, + apiBase: this.actualApiBase, + orgScopeId: this.orgScopeId ?? null, + }; return { - continueProperties: { - apiKeyLocation: this.apiKeyLocation, - apiBase: this.actualApiBase, - organizationSlug: this.organizationSlug, - }, + continueProperties, }; } diff --git a/core/package-lock.json b/core/package-lock.json index abb19f0a9..38d01acfe 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.38", + "@continuedev/config-yaml": "^1.0.42", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -2990,9 +2990,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.38", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.38.tgz", - "integrity": "sha512-m9HkGgoVg1FO+l2wK4wsZPBGwpYjj+QY1SFdBYpa+ohX0wQQ8mMJivvs7fwdXo4JqlIFm7ws4tkXQZ17vFsdzA==", + "version": "1.0.42", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.42.tgz", + "integrity": "sha512-wT7a2Pc8MzWdyUY02gWtCy5KFYC6Hd0gzEKdOgxjhaMThll312Ck2fZa3ahLa3caaI04LrEP3l6yqL7nQ/960g==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/core/package.json b/core/package.json index 1336c1bf3..2ce668d13 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": "^1.0.38", + "@continuedev/config-yaml": "^1.0.42", "@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 5bcd184dc..315800a5d 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -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.35", + "@continuedev/config-yaml": "^1.0.38", "@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 413f2a416..4e3fbbfa4 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.38", + "@continuedev/config-yaml": "^1.0.42", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", @@ -107,7 +107,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.38", + "@continuedev/config-yaml": "^1.0.42", "@continuedev/fetch": "^1.0.4", "@continuedev/llm-info": "^1.0.2", "@continuedev/openai-adapters": "^1.0.10", @@ -525,9 +525,9 @@ } }, "node_modules/@continuedev/config-yaml": { - "version": "1.0.38", - "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.38.tgz", - "integrity": "sha512-m9HkGgoVg1FO+l2wK4wsZPBGwpYjj+QY1SFdBYpa+ohX0wQQ8mMJivvs7fwdXo4JqlIFm7ws4tkXQZ17vFsdzA==", + "version": "1.0.42", + "resolved": "https://registry.npmjs.org/@continuedev/config-yaml/-/config-yaml-1.0.42.tgz", + "integrity": "sha512-wT7a2Pc8MzWdyUY02gWtCy5KFYC6Hd0gzEKdOgxjhaMThll312Ck2fZa3ahLa3caaI04LrEP3l6yqL7nQ/960g==", "dependencies": { "@continuedev/config-types": "^1.0.14", "yaml": "^2.6.1", diff --git a/gui/package.json b/gui/package.json index 72ae605a3..4c53387d1 100644 --- a/gui/package.json +++ b/gui/package.json @@ -15,7 +15,7 @@ "test:watch": "vitest" }, "dependencies": { - "@continuedev/config-yaml": "^1.0.38", + "@continuedev/config-yaml": "^1.0.42", "@headlessui/react": "^1.7.17", "@heroicons/react": "^2.0.18", "@reduxjs/toolkit": "^2.3.0", diff --git a/packages/config-yaml/package.json b/packages/config-yaml/package.json index 19be8db73..36ec08b6f 100644 --- a/packages/config-yaml/package.json +++ b/packages/config-yaml/package.json @@ -1,6 +1,6 @@ { "name": "@continuedev/config-yaml", - "version": "1.0.38", + "version": "1.0.42", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/config-yaml/src/load/clientRender.ts b/packages/config-yaml/src/load/clientRender.ts index 9f7b0ccf4..669a4a25e 100644 --- a/packages/config-yaml/src/load/clientRender.ts +++ b/packages/config-yaml/src/load/clientRender.ts @@ -1,3 +1,4 @@ +import { z } from "zod"; import { PlatformClient, SecretStore } from "../interfaces/index.js"; import { decodeSecretLocation, @@ -137,3 +138,12 @@ function useProxyForUnrenderedSecrets( return config; } + +/** The additional properties that are added to the otherwise OpenAI-compatible body when requesting a Continue proxy */ +export const continuePropertiesSchema = z.object({ + apiKeyLocation: z.string().optional(), + apiBase: z.string().optional(), + orgScopeId: z.string().nullable(), +}); + +export type ContinueProperties = z.infer;