shitton
This commit is contained in:
@@ -5,6 +5,7 @@ import path from "node:path";
|
|||||||
import {AiTool} from "../tool-types";
|
import {AiTool} from "../tool-types";
|
||||||
import {Environment} from "../../common/environment";
|
import {Environment} from "../../common/environment";
|
||||||
import {toolsLogger} from "./tool-logger";
|
import {toolsLogger} from "./tool-logger";
|
||||||
|
import {randomUUID} from "node:crypto";
|
||||||
|
|
||||||
const logger = toolsLogger.child("python-interpreter");
|
const logger = toolsLogger.child("python-interpreter");
|
||||||
|
|
||||||
@@ -299,14 +300,12 @@ async function executePythonCode(
|
|||||||
logger.info("execute.start", {args, options});
|
logger.info("execute.start", {args, options});
|
||||||
|
|
||||||
const pythonBinary =
|
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 timeoutMs = args.timeoutMs ?? options.executionTimeoutMs ?? DEFAULT_EXECUTION_TIMEOUT_MS;
|
||||||
const maxOutputChars = options.maxOutputChars ?? DEFAULT_MAX_OUTPUT_CHARS;
|
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.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 inputDir = path.join(tempDir, PYTHON_INPUTS_DIR_NAME);
|
const inputDir = path.join(tempDir, PYTHON_INPUTS_DIR_NAME);
|
||||||
const outputDir = path.join(tempDir, PYTHON_OUTPUTS_DIR_NAME);
|
const outputDir = path.join(tempDir, PYTHON_OUTPUTS_DIR_NAME);
|
||||||
const attachmentsPath = path.join(tempDir, PYTHON_ATTACHMENTS_FILE_NAME);
|
const attachmentsPath = path.join(tempDir, PYTHON_ATTACHMENTS_FILE_NAME);
|
||||||
|
|||||||
Reference in New Issue
Block a user