feat: add custom model provider

This commit is contained in:
zhayujie
2026-04-15 12:26:05 +08:00
parent 83f778fec9
commit 3830f76729
13 changed files with 238 additions and 18 deletions

View File

@@ -381,9 +381,12 @@ class CowCliPlugin(Plugin):
updates = {key: new_val}
if key == "model" and conf().get("bot_type"):
resolved = self._resolve_bot_type_for_model(str(new_val))
if resolved:
updates["bot_type"] = resolved
from common import const
current_bot_type = conf().get("bot_type")
if current_bot_type not in (const.CUSTOM,):
resolved = self._resolve_bot_type_for_model(str(new_val))
if resolved:
updates["bot_type"] = resolved
project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
config_path = os.path.join(project_root, "config.json")