convert node_calls_python paths into env variables

This commit is contained in:
Eng. Elias
2024-03-01 11:59:35 +04:00
parent a1ffe22934
commit b8f3986de5
2 changed files with 15 additions and 5 deletions

13
.env.template Normal file
View File

@@ -0,0 +1,13 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema
# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/crew_ai_visualizer?schema=public"
GEMINI_API_KEY=""
PYTHON_SITE_PACKAGES=""
CREW_AI_PY_FILE=""

View File

@@ -4,13 +4,10 @@ const nodecallspython = require("node-calls-python");
const py = nodecallspython.interpreter;
py.addImportPath(
"E:\\Crew AI\\TheProject\\crew-ai-visualizer\\src\\app\\api\\graphql\\venv\\Lib\\site-packages"
);
py.addImportPath(process.env.PYTHON_SITE_PACKAGES);
export function runMission(id) {
const crewaiPath =
"E:\\Crew AI\\TheProject\\crew-ai-visualizer\\src\\app\\api\\graphql\\crew_ai.py";
const crewaiPath = process.env.CREW_AI_PY_FILE;
return py
.import(crewaiPath)
.then(async function (pymodule) {