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
No related branches found
No related tags found
No related merge requests found
......@@ -23,14 +23,20 @@ const createEnvLocalFile = async (
openAiKey?: string;
vectorDb?: TemplateVectorDB;
model?: string;
framework?: TemplateFramework;
},
) => {
const envFileName = ".env";
let content = "";
const model = opts?.model || "gpt-3.5-turbo";
content += `NEXT_PUBLIC_MODEL=${model}\n`;
content += `MODEL=${model}\n`;
if (opts?.framework === "express") {
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) {
content += `OPENAI_API_KEY=${opts?.openAiKey}\n`;
......@@ -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.
*/
......@@ -376,6 +378,7 @@ export const installTemplate = async (
openAiKey: props.openAiKey,
vectorDb: props.vectorDb,
model: props.model,
framework: props.framework,
});
// Copy test pdf file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment