fix/refac: functions multi-replica issue

This commit is contained in:
Timothy Jaeryang Baek
2025-05-20 20:20:27 +04:00
parent 2b5c015bcb
commit 74ace200fe
5 changed files with 17 additions and 40 deletions

View File

@@ -392,11 +392,8 @@ async def chat_action(request: Request, action_id: str, form_data: dict, user: A
}
)
if action_id in request.app.state.FUNCTIONS:
function_module = request.app.state.FUNCTIONS[action_id]
else:
function_module, _, _ = load_function_module_by_id(action_id)
request.app.state.FUNCTIONS[action_id] = function_module
function_module, _, _ = load_function_module_by_id(action_id)
request.app.state.FUNCTIONS[action_id] = function_module
if hasattr(function_module, "valves") and hasattr(function_module, "Valves"):
valves = Functions.get_function_valves_by_id(action_id)