优化代码

This commit is contained in:
h88782481 2026-03-09 19:43:51 +08:00
parent 202731df74
commit 96fbc4da80
15 changed files with 2768 additions and 1383 deletions

View file

@ -76,9 +76,12 @@ def resolve_model(model_name):
if model_name in mappings:
m = mappings[model_name]
backend = m.get('backend')
if backend in ('', None, 'auto'):
backend = _auto_detect(model_name)
return {
'upstream_model': m.get('upstream_model') or model_name,
'backend': m.get('backend') or _auto_detect(model_name),
'backend': backend,
'target_url': m.get('target_url') or base_url,
'api_key': m.get('api_key') or base_key,
}