This commit is contained in:
2026-05-14 20:58:52 +03:00
parent 067bbd0708
commit 858e3d7990
+3 -4
View File
@@ -5,6 +5,7 @@ import path from "node:path";
import {AiTool} from "../tool-types";
import {Environment} from "../../common/environment";
import {toolsLogger} from "./tool-logger";
import {randomUUID} from "node:crypto";
const logger = toolsLogger.child("python-interpreter");
@@ -299,14 +300,12 @@ async function executePythonCode(
logger.info("execute.start", {args, options});
const pythonBinary =
options.pythonBinary ?? process.env.PYTHON_INTERPRETER_BINARY ?? "C:\\Users\\meloda\\Desktop\\AI_BOT\\.venv\\Scripts\\python.exe";
options.pythonBinary ?? process.env.PYTHON_INTERPRETER_BINARY ?? "python";
const timeoutMs = args.timeoutMs ?? options.executionTimeoutMs ?? DEFAULT_EXECUTION_TIMEOUT_MS;
const maxOutputChars = options.maxOutputChars ?? DEFAULT_MAX_OUTPUT_CHARS;
// const tempDir = path.join(Environment.DATA_PATH, "cache", "python", "python-temp-" + randomUUID());
// const tempDir = path.join(Environment.FILE_TOOLS_ROOT_DIR ?? ".", "ollama-python-temp-" + randomUUID());
const tempDir = path.join(Environment.FILE_TOOLS_ROOT_DIR ?? ".", "");
const tempDir = path.join(Environment.DATA_PATH, "cache", "python", "python-temp-" + randomUUID());
const inputDir = path.join(tempDir, PYTHON_INPUTS_DIR_NAME);
const outputDir = path.join(tempDir, PYTHON_OUTPUTS_DIR_NAME);
const attachmentsPath = path.join(tempDir, PYTHON_ATTACHMENTS_FILE_NAME);