Skip to content
Snippets Groups Projects
Commit bae07b5c authored by thucpn's avatar thucpn Committed by Marcus Schiesser
Browse files

fix: use public model only for nextjs

parent a9608c92
Branches
Tags
No related merge requests found
...@@ -23,14 +23,20 @@ const createEnvLocalFile = async ( ...@@ -23,14 +23,20 @@ const createEnvLocalFile = async (
openAiKey?: string; openAiKey?: string;
vectorDb?: TemplateVectorDB; vectorDb?: TemplateVectorDB;
model?: string; model?: string;
framework?: TemplateFramework;
}, },
) => { ) => {
const envFileName = ".env"; const envFileName = ".env";
let content = ""; let content = "";
const model = opts?.model || "gpt-3.5-turbo"; const model = opts?.model || "gpt-3.5-turbo";
content += `NEXT_PUBLIC_MODEL=${model}\n`; if (opts?.framework === "express") {
content += `MODEL=${model}\n`; content += `MODEL=${model}\n`;
}
if (opts?.framework === "nextjs") {
content += `MODEL=${model}\nNEXT_PUBLIC_MODEL=${model}\n`;
}
console.log("\nUsing OpenAI model: ", model, "\n");
if (opts?.openAiKey) { if (opts?.openAiKey) {
content += `OPENAI_API_KEY=${opts?.openAiKey}\n`; content += `OPENAI_API_KEY=${opts?.openAiKey}\n`;
...@@ -211,10 +217,6 @@ const installTSTemplate = async ({ ...@@ -211,10 +217,6 @@ const installTSTemplate = async ({
}); });
} }
if (framework === "nextjs" || framework === "express") {
console.log("\nUsing OpenAI model: ", model || "gpt-3.5-turbo", "\n");
}
/** /**
* Update the package.json scripts. * Update the package.json scripts.
*/ */
...@@ -376,6 +378,7 @@ export const installTemplate = async ( ...@@ -376,6 +378,7 @@ export const installTemplate = async (
openAiKey: props.openAiKey, openAiKey: props.openAiKey,
vectorDb: props.vectorDb, vectorDb: props.vectorDb,
model: props.model, model: props.model,
framework: props.framework,
}); });
// Copy test pdf file // Copy test pdf file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment