fix: types

This commit is contained in:
tomasz-io 2025-04-02 13:09:28 -07:00
parent 79780e8d60
commit 44212e4582
3 changed files with 24 additions and 14 deletions

View file

@ -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);

View file

@ -29,6 +29,7 @@ async function modelConfigToBaseLLM(
platformConfigMetadata: PlatformConfigMetadata | undefined,
systemMessage: string | undefined,
): Promise<BaseLLM | undefined> {
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<void>,
platformConfigMetadata: PlatformConfigMetadata | undefined,
systemMessage: string | undefined,
): Promise<BaseLLM[]> {
export async function llmsFromModelConfig({
model,
ide,
uniqueId,
ideSettings,
writeLog,
platformConfigMetadata,
systemMessage,
}: {
model: ModelConfig;
ide: IDE;
uniqueId: string;
ideSettings: IdeSettings;
writeLog: (log: string) => Promise<void>;
platformConfigMetadata: PlatformConfigMetadata | undefined;
systemMessage: string | undefined;
}): Promise<BaseLLM[]> {
const baseLlm = await modelConfigToBaseLLM(
model,
uniqueId,

View file

@ -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<ChatMessage, PromptLog> {
debugger;
// debugger;
let { completionOptions, logEnabled } =
this._parseCompletionOptions(options);