From 44212e45828bb72c035bf63de4c13342935dcf0f Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Wed, 2 Apr 2025 13:09:28 -0700 Subject: [PATCH] fix: types --- core/config/yaml/loadYaml.ts | 6 +++--- core/config/yaml/models.ts | 27 ++++++++++++++++++--------- core/llm/index.ts | 5 +++-- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index feafd170c..bd15c6ce6 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -211,15 +211,15 @@ async function configYamlToContinueConfig( for (const model of config.models ?? []) { model.roles = model.roles ?? modelsArrayRoles; // Default to all 4 chat-esque roles if not specified try { - const llms = await llmsFromModelConfig( + const llms = await llmsFromModelConfig({ model, ide, uniqueId, ideSettings, writeLog, platformConfigMetadata, - continueConfig.systemMessage, - ); + systemMessage: continueConfig.systemMessage, + }); if (modelsArrayRoles.some((role) => model.roles?.includes(role))) { continueConfig.models.push(...llms); diff --git a/core/config/yaml/models.ts b/core/config/yaml/models.ts index e9d5bd55c..92e29debb 100644 --- a/core/config/yaml/models.ts +++ b/core/config/yaml/models.ts @@ -29,6 +29,7 @@ async function modelConfigToBaseLLM( platformConfigMetadata: PlatformConfigMetadata | undefined, systemMessage: string | undefined, ): Promise { + debugger; const cls = getModelClass(model); if (!cls) { @@ -167,15 +168,23 @@ async function autodetectModels( } } -export async function llmsFromModelConfig( - model: ModelConfig, - ide: IDE, - uniqueId: string, - ideSettings: IdeSettings, - writeLog: (log: string) => Promise, - platformConfigMetadata: PlatformConfigMetadata | undefined, - systemMessage: string | undefined, -): Promise { +export async function llmsFromModelConfig({ + model, + ide, + uniqueId, + ideSettings, + writeLog, + platformConfigMetadata, + systemMessage, +}: { + model: ModelConfig; + ide: IDE; + uniqueId: string; + ideSettings: IdeSettings; + writeLog: (log: string) => Promise; + platformConfigMetadata: PlatformConfigMetadata | undefined; + systemMessage: string | undefined; +}): Promise { const baseLlm = await modelConfigToBaseLLM( model, uniqueId, diff --git a/core/llm/index.ts b/core/llm/index.ts index 1b250d808..410a70dc4 100644 --- a/core/llm/index.ts +++ b/core/llm/index.ts @@ -189,6 +189,7 @@ export abstract class BaseLLM implements ILLM { this.title = options.title; this.uniqueId = options.uniqueId ?? "None"; this.systemMessage = options.systemMessage; + // debugger; this.contextLength = options.contextLength ?? llmInfo?.contextLength ?? DEFAULT_CONTEXT_LENGTH; this.maxStopWords = options.maxStopWords ?? this.maxStopWords; @@ -596,7 +597,7 @@ export abstract class BaseLLM implements ILLM { ) { const { completionOptions, logEnabled, raw } = this._parseCompletionOptions(options); - debugger; + // debugger; let prompt = pruneRawPromptFromTop( completionOptions.model, @@ -761,7 +762,7 @@ export abstract class BaseLLM implements ILLM { signal: AbortSignal, options: LLMFullCompletionOptions = {}, ): AsyncGenerator { - debugger; + // debugger; let { completionOptions, logEnabled } = this._parseCompletionOptions(options);