From b7b5701fa7ae74d0cc9de268c0e504d22e59d600 Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 23 Jan 2025 16:06:32 -0800 Subject: [PATCH] fix bug loading config.yaml when context not defined --- core/config/yaml/loadYaml.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 04794c1038..cb1c5ea186 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -121,6 +121,7 @@ async function configYamlToContinueConfig( rootUrl: doc.rootUrl, faviconUrl: doc.faviconUrl, })), + contextProviders: [], }; // Models @@ -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) { @@ -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