Skip to content
Snippets Groups Projects
Commit 967844d2 authored by Marcus Schiesser's avatar Marcus Schiesser
Browse files

fix: lint errors

parent 4acf3e96
No related branches found
No related tags found
No related merge requests found
...@@ -121,7 +121,7 @@ export async function runCreateLlama( ...@@ -121,7 +121,7 @@ export async function runCreateLlama(
"none", "none",
].join(" "); ].join(" ");
console.log(`running command '${command}' in ${cwd}`); console.log(`running command '${command}' in ${cwd}`);
let appProcess = exec(command, { const appProcess = exec(command, {
cwd, cwd,
env: { env: {
...process.env, ...process.env,
......
...@@ -70,7 +70,7 @@ const createEnvLocalFile = async ( ...@@ -70,7 +70,7 @@ const createEnvLocalFile = async (
switch (opts?.dataSource?.type) { switch (opts?.dataSource?.type) {
case "web": { case "web": {
let webConfig = opts?.dataSource.config as WebSourceConfig; const webConfig = opts?.dataSource.config as WebSourceConfig;
content += `# web loader config\n`; content += `# web loader config\n`;
content += `BASE_URL=${webConfig.baseUrl}\n`; content += `BASE_URL=${webConfig.baseUrl}\n`;
content += `URL_PREFIX=${webConfig.baseUrl}\n`; content += `URL_PREFIX=${webConfig.baseUrl}\n`;
...@@ -102,7 +102,7 @@ const generateContextData = async ( ...@@ -102,7 +102,7 @@ const generateContextData = async (
if (framework === "fastapi") { if (framework === "fastapi") {
if (hasOpenAiKey && !hasVectorDb && isHavingPoetryLockFile()) { if (hasOpenAiKey && !hasVectorDb && isHavingPoetryLockFile()) {
console.log(`Running ${runGenerate} to generate the context data.`); console.log(`Running ${runGenerate} to generate the context data.`);
let result = tryPoetryRun("python app/engine/generate.py"); const result = tryPoetryRun("python app/engine/generate.py");
if (!result) { if (!result) {
console.log(`Failed to run ${runGenerate}.`); console.log(`Failed to run ${runGenerate}.`);
process.exit(1); process.exit(1);
...@@ -134,7 +134,7 @@ const copyContextData = async ( ...@@ -134,7 +134,7 @@ const copyContextData = async (
) => { ) => {
const destPath = path.join(root, "data"); const destPath = path.join(root, "data");
let dataSourceConfig = dataSource?.config as FileSourceConfig; const dataSourceConfig = dataSource?.config as FileSourceConfig;
// Copy file // Copy file
if (dataSource?.type === "file") { if (dataSource?.type === "file") {
...@@ -154,7 +154,7 @@ const copyContextData = async ( ...@@ -154,7 +154,7 @@ const copyContextData = async (
// Copy folder // Copy folder
if (dataSource?.type === "folder") { if (dataSource?.type === "folder") {
let srcPath = const srcPath =
dataSourceConfig.path ?? path.join(templatesDir, "components", "data"); dataSourceConfig.path ?? path.join(templatesDir, "components", "data");
console.log(`\nCopying data to ${cyan(destPath)}\n`); console.log(`\nCopying data to ${cyan(destPath)}\n`);
await copy("**", destPath, { await copy("**", destPath, {
......
...@@ -244,7 +244,7 @@ export const installPythonTemplate = async ({ ...@@ -244,7 +244,7 @@ export const installPythonTemplate = async ({
const dataSourceType = dataSource?.type; const dataSourceType = dataSource?.type;
if (dataSourceType !== undefined && dataSourceType !== "none") { if (dataSourceType !== undefined && dataSourceType !== "none") {
let loaderPath = const loaderPath =
dataSourceType === "folder" dataSourceType === "folder"
? path.join(compPath, "loaders", "python", "file") ? path.join(compPath, "loaders", "python", "file")
: path.join(compPath, "loaders", "python", dataSourceType); : path.join(compPath, "loaders", "python", dataSourceType);
......
...@@ -33,7 +33,7 @@ export async function runApp( ...@@ -33,7 +33,7 @@ export async function runApp(
): Promise<any> { ): Promise<any> {
let backendAppProcess: ChildProcess; let backendAppProcess: ChildProcess;
let frontendAppProcess: ChildProcess | undefined; let frontendAppProcess: ChildProcess | undefined;
let frontendPort = port || 3000; const frontendPort = port || 3000;
let backendPort = externalPort || 8000; let backendPort = externalPort || 8000;
// Callback to kill app processes // Callback to kill app processes
......
...@@ -45,7 +45,7 @@ export const getTool = (toolName: string): Tool | undefined => { ...@@ -45,7 +45,7 @@ export const getTool = (toolName: string): Tool | undefined => {
}; };
export const getTools = (toolsName: string[]): Tool[] => { export const getTools = (toolsName: string[]): Tool[] => {
let tools: Tool[] = []; const tools: Tool[] = [];
for (const toolName of toolsName) { for (const toolName of toolsName) {
const tool = getTool(toolName); const tool = getTool(toolName);
if (!tool) { if (!tool) {
......
...@@ -108,7 +108,7 @@ const getVectorDbChoices = (framework: TemplateFramework) => { ...@@ -108,7 +108,7 @@ const getVectorDbChoices = (framework: TemplateFramework) => {
}; };
const getDataSourceChoices = (framework: TemplateFramework) => { const getDataSourceChoices = (framework: TemplateFramework) => {
let choices = [ const choices = [
{ {
title: "No data, just a simple chat", title: "No data, just a simple chat",
value: "simple", value: "simple",
...@@ -159,7 +159,7 @@ const selectLocalContextData = async (type: TemplateDataSourceType) => { ...@@ -159,7 +159,7 @@ const selectLocalContextData = async (type: TemplateDataSourceType) => {
} }
selectedPath = execSync(execScript, execOpts).toString().trim(); selectedPath = execSync(execScript, execOpts).toString().trim();
if (type === "file") { if (type === "file") {
let fileType = path.extname(selectedPath); const fileType = path.extname(selectedPath);
if (!supportedContextFileTypes.includes(fileType)) { if (!supportedContextFileTypes.includes(fileType)) {
console.log( console.log(
red( red(
...@@ -204,7 +204,7 @@ export const askQuestions = async ( ...@@ -204,7 +204,7 @@ export const askQuestions = async (
if (ciInfo.isCI) { if (ciInfo.isCI) {
program.postInstallAction = getPrefOrDefault("postInstallAction"); program.postInstallAction = getPrefOrDefault("postInstallAction");
} else { } else {
let actionChoices = [ const actionChoices = [
{ {
title: "Just generate code (~1 sec)", title: "Just generate code (~1 sec)",
value: "none", value: "none",
...@@ -535,7 +535,7 @@ export const askQuestions = async ( ...@@ -535,7 +535,7 @@ export const askQuestions = async (
if (!baseUrl.includes("://")) { if (!baseUrl.includes("://")) {
baseUrl = `https://${baseUrl}`; baseUrl = `https://${baseUrl}`;
} }
let checkUrl = new URL(baseUrl); const checkUrl = new URL(baseUrl);
if (checkUrl.protocol !== "https:" && checkUrl.protocol !== "http:") { if (checkUrl.protocol !== "https:" && checkUrl.protocol !== "http:") {
throw new Error("Invalid protocol"); throw new Error("Invalid protocol");
} }
......
...@@ -14,7 +14,7 @@ async function getDataSource(llm: LLM) { ...@@ -14,7 +14,7 @@ async function getDataSource(llm: LLM) {
chunkSize: CHUNK_SIZE, chunkSize: CHUNK_SIZE,
chunkOverlap: CHUNK_OVERLAP, chunkOverlap: CHUNK_OVERLAP,
}); });
let storageContext = await storageContextFromDefaults({ const storageContext = await storageContextFromDefaults({
persistDir: `${STORAGE_CACHE_DIR}`, persistDir: `${STORAGE_CACHE_DIR}`,
}); });
......
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