Get defaults from global settings. Returns: Tuple of (yolo_mode, model, testing_agent_ratio, playwright_headless, batch_size)
()
| 18 | |
| 19 | |
| 20 | def _get_settings_defaults() -> tuple[bool, str, int, bool, int]: |
| 21 | """Get defaults from global settings. |
| 22 | |
| 23 | Returns: |
| 24 | Tuple of (yolo_mode, model, testing_agent_ratio, playwright_headless, batch_size) |
| 25 | """ |
| 26 | import sys |
| 27 | root = Path(__file__).parent.parent.parent |
| 28 | if str(root) not in sys.path: |
| 29 | sys.path.insert(0, str(root)) |
| 30 | |
| 31 | from registry import DEFAULT_MODEL, get_all_settings |
| 32 | |
| 33 | settings = get_all_settings() |
| 34 | yolo_mode = (settings.get("yolo_mode") or "false").lower() == "true" |
| 35 | model = settings.get("model", DEFAULT_MODEL) |
| 36 | |
| 37 | # Parse testing agent settings with defaults |
| 38 | try: |
| 39 | testing_agent_ratio = int(settings.get("testing_agent_ratio", "1")) |
| 40 | except (ValueError, TypeError): |
| 41 | testing_agent_ratio = 1 |
| 42 | |
| 43 | playwright_headless = (settings.get("playwright_headless") or "true").lower() == "true" |
| 44 | |
| 45 | try: |
| 46 | batch_size = int(settings.get("batch_size", "3")) |
| 47 | except (ValueError, TypeError): |
| 48 | batch_size = 3 |
| 49 | |
| 50 | return yolo_mode, model, testing_agent_ratio, playwright_headless, batch_size |
| 51 | |
| 52 | |
| 53 | router = APIRouter(prefix="/api/projects/{project_name}/agent", tags=["agent"]) |
no test coverage detected