mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-09 10:18:57 +00:00
feat: tfcode
This commit is contained in:
@@ -68,9 +68,14 @@ function runPythonSync(method, config = null) {
|
||||
const apiKey = config?.api_key || process.env.TF_API_KEY || ""
|
||||
const region = config?.region || process.env.TF_REGION || "au"
|
||||
|
||||
// Add embedded python path to sys.path
|
||||
const embeddedPythonPath = join(__dirname, "..", "python")
|
||||
|
||||
const pythonCode = `
|
||||
import json, sys, os
|
||||
try:
|
||||
# Add embedded tf_sync module path
|
||||
sys.path.insert(0, "${embeddedPythonPath}")
|
||||
os.environ["TF_WORKSPACE_ID"] = "${wsId}"
|
||||
os.environ["TF_API_KEY"] = "${apiKey}"
|
||||
os.environ["TF_REGION"] = "${region}"
|
||||
|
||||
Reference in New Issue
Block a user