imagees del agente generadas y subidas con proxy server

This commit is contained in:
Jordan Diaz
2026-04-12 13:16:50 +00:00
parent ca39cd2ccd
commit f5b9e275c9
3 changed files with 78 additions and 173 deletions

View File

@@ -0,0 +1,21 @@
import axios from "axios";
const PYTHON_BASE = `http://app:${process.env.ACAI_PORT || 9091}`;
export async function pythonPost(path, data, timeout = 120000) {
const authHeader = process.env.ACAI_AUTH_HEADER || "";
const mode = process.env.ACAI_MODE_OVERRIDE || process.env.ACAI_MODE || "";
const role = process.env.ACAI_ROLE_OVERRIDE || "";
const response = await axios.post(`${PYTHON_BASE}${path}`, data, {
headers: {
"Content-Type": "application/json",
...(authHeader ? { "Authorization": authHeader } : {}),
...(mode ? { "X-Acai-Mode": mode } : {}),
...(role ? { "X-Acai-Role": role } : {}),
},
timeout,
maxBodyLength: Infinity,
maxContentLength: Infinity,
});
return response.data;
}