Skip to content

Commit

Permalink
pass system message through to yaml models
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Jan 16, 2025
1 parent 18824ef commit 6254d03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/config/yaml/loadYaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ async function configYamlToContinueConfig(
ideSettings,
writeLog,
platformConfigMetadata,
continueConfig.systemMessage,
);
continueConfig.models.push(...llms);
}
Expand All @@ -160,6 +161,7 @@ async function configYamlToContinueConfig(
ideSettings,
writeLog,
platformConfigMetadata,
continueConfig.systemMessage,
);
continueConfig.tabAutocompleteModels?.push(...llms);
}
Expand Down
7 changes: 7 additions & 0 deletions core/config/yaml/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async function modelConfigToBaseLLM(
ideSettings: IdeSettings,
writeLog: (log: string) => Promise<void>,
platformConfigMetadata: PlatformConfigMetadata | undefined,
systemMessage: string | undefined,
): Promise<BaseLLM | undefined> {
const cls = getModelClass(model, platformConfigMetadata);

Expand Down Expand Up @@ -68,6 +69,7 @@ async function modelConfigToBaseLLM(
uniqueId,
title: model.name,
model: modelName,
systemMessage,
};

const llm = new cls(options);
Expand All @@ -82,6 +84,7 @@ async function autodetectModels(
ideSettings: IdeSettings,
writeLog: (log: string) => Promise<void>,
platformConfigMetadata: PlatformConfigMetadata | undefined,
systemMessage: string | undefined,
): Promise<BaseLLM[]> {
try {
const modelNames = await llm.listModels();
Expand All @@ -102,6 +105,7 @@ async function autodetectModels(
ideSettings,
writeLog,
platformConfigMetadata,
systemMessage,
);
}),
);
Expand All @@ -119,13 +123,15 @@ export async function llmsFromModelConfig(
ideSettings: IdeSettings,
writeLog: (log: string) => Promise<void>,
platformConfigMetadata: PlatformConfigMetadata | undefined,
systemMessage: string | undefined,
): Promise<BaseLLM[]> {
const baseLlm = await modelConfigToBaseLLM(
model,
uniqueId,
ideSettings,
writeLog,
platformConfigMetadata,
systemMessage,
);
if (!baseLlm) {
return [];
Expand All @@ -140,6 +146,7 @@ export async function llmsFromModelConfig(
ideSettings,
writeLog,
platformConfigMetadata,
systemMessage,
);
return models;
} else {
Expand Down

0 comments on commit 6254d03

Please sign in to comment.