feat: add interactive onboard wizard for LLM provider and channel configuration

This commit is contained in:
chengyongru
2026-03-14 21:26:13 +08:00
committed by Xubin Ren
parent c138b2375b
commit f127af0481
4 changed files with 751 additions and 27 deletions

View File

@@ -3,6 +3,9 @@
import json
from pathlib import Path
import pydantic
from loguru import logger
from nanobot.config.schema import Config
# Global variable to store current config path (for multi-instance support)
@@ -40,9 +43,9 @@ def load_config(config_path: Path | None = None) -> Config:
data = json.load(f)
data = _migrate_config(data)
return Config.model_validate(data)
except (json.JSONDecodeError, ValueError) as e:
print(f"Warning: Failed to load config from {path}: {e}")
print("Using default configuration.")
except (json.JSONDecodeError, ValueError, pydantic.ValidationError) as e:
logger.warning(f"Failed to load config from {path}: {e}")
logger.warning("Using default configuration.")
return Config()