mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: defer() 改为链式调用,修复 SQLAlchemy 多参数报错
This commit is contained in:
@@ -98,18 +98,17 @@ class CandidateBuilder:
|
|||||||
.options(
|
.options(
|
||||||
# 预加载 Provider 级别的 api_keys
|
# 预加载 Provider 级别的 api_keys
|
||||||
# defer 排除仅后台管理/模型获取用的冷字段,热路径字段全部加载
|
# defer 排除仅后台管理/模型获取用的冷字段,热路径字段全部加载
|
||||||
selectinload(Provider.api_keys).defer(
|
selectinload(Provider.api_keys)
|
||||||
ProviderAPIKey.note,
|
.defer(ProviderAPIKey.note)
|
||||||
ProviderAPIKey.last_error_msg,
|
.defer(ProviderAPIKey.last_error_msg)
|
||||||
ProviderAPIKey.auto_fetch_models,
|
.defer(ProviderAPIKey.auto_fetch_models)
|
||||||
ProviderAPIKey.locked_models,
|
.defer(ProviderAPIKey.locked_models)
|
||||||
ProviderAPIKey.model_include_patterns,
|
.defer(ProviderAPIKey.model_include_patterns)
|
||||||
ProviderAPIKey.model_exclude_patterns,
|
.defer(ProviderAPIKey.model_exclude_patterns)
|
||||||
ProviderAPIKey.last_models_fetch_at,
|
.defer(ProviderAPIKey.last_models_fetch_at)
|
||||||
ProviderAPIKey.last_models_fetch_error,
|
.defer(ProviderAPIKey.last_models_fetch_error)
|
||||||
ProviderAPIKey.max_probe_interval_minutes,
|
.defer(ProviderAPIKey.max_probe_interval_minutes)
|
||||||
ProviderAPIKey.expires_at,
|
.defer(ProviderAPIKey.expires_at),
|
||||||
),
|
|
||||||
# 预加载 endpoints(用于按 api_format 选择请求配置)
|
# 预加载 endpoints(用于按 api_format 选择请求配置)
|
||||||
selectinload(Provider.endpoints),
|
selectinload(Provider.endpoints),
|
||||||
# 同时加载 models 和 global_model 关系
|
# 同时加载 models 和 global_model 关系
|
||||||
|
|||||||
Reference in New Issue
Block a user