imagees del agente generadas y subidas con proxy server
This commit is contained in:
21
mcp-server/tools/helpers/pythonServerClient.js
Normal file
21
mcp-server/tools/helpers/pythonServerClient.js
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user