Skip to content

Commit

Permalink
fix bug loading config.yaml when context not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
sestinj committed Jan 24, 2025
1 parent acd92df commit b7b5701
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/config/yaml/loadYaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ async function configYamlToContinueConfig(
rootUrl: doc.rootUrl,
faviconUrl: doc.faviconUrl,
})),
contextProviders: [],
};

// Models
Expand Down Expand Up @@ -191,7 +192,7 @@ async function configYamlToContinueConfig(
({ description: { title } }) => title,
);

continueConfig.contextProviders = config.context
continueConfig.contextProviders = (config.context
?.map((context) => {
const cls = contextProviderClassFromName(context.uses) as any;
if (!cls) {
Expand All @@ -203,7 +204,7 @@ async function configYamlToContinueConfig(
const instance: IContextProvider = new cls(context.with ?? {});
return instance;
})
.filter((p) => !!p) as IContextProvider[];
.filter((p) => !!p) ?? []) as IContextProvider[];
continueConfig.contextProviders.push(...DEFAULT_CONTEXT_PROVIDERS);

// Embeddings Provider
Expand Down

0 comments on commit b7b5701

Please sign in to comment.