Refactor AIEngine and registry to improve function ID generation and support legacy names

- Updated AIEngine to normalize function names by replacing underscores with hyphens in generated function IDs for better consistency with frontend tracking.
- Enhanced registry to resolve function name aliases, allowing for backward compatibility with legacy function names when retrieving function instances.
This commit is contained in:
Desktop
2025-11-10 19:41:58 +05:00
parent 5d9db50c64
commit 1d51c667b1
2 changed files with 12 additions and 2 deletions

View File

@@ -83,7 +83,9 @@ class AIEngine:
function_name = fn.get_name()
# Generate function_id for tracking (ai-{function_name}-01)
function_id = f"ai-{function_name}-01"
# Normalize underscores to hyphens to match frontend tracking IDs
function_id_base = function_name.replace('_', '-')
function_id = f"ai-{function_id_base}-01"
# Get model config from settings (Stage 4 requirement)
model_config = get_model_config(function_name)