mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 09:17:06 +08:00
perf: Optimize the model form information query method
This commit is contained in:
committed by
fit2cloud-chenyw
parent
d04395813a
commit
9d21214ac9
@@ -107,10 +107,13 @@ async def get_model_by_id(
|
||||
config_list = [AiModelConfigItem(**item) for item in raw]
|
||||
except Exception:
|
||||
pass
|
||||
if db_model.api_key:
|
||||
db_model.api_key = await sqlbot_decrypt(db_model.api_key)
|
||||
if db_model.api_domain:
|
||||
db_model.api_domain = await sqlbot_decrypt(db_model.api_domain)
|
||||
try:
|
||||
if db_model.api_key:
|
||||
db_model.api_key = await sqlbot_decrypt(db_model.api_key)
|
||||
if db_model.api_domain:
|
||||
db_model.api_domain = await sqlbot_decrypt(db_model.api_domain)
|
||||
except Exception:
|
||||
pass
|
||||
data = AiModelDetail.model_validate(db_model).model_dump(exclude_unset=True)
|
||||
data.pop("config", None)
|
||||
data["config_list"] = config_list
|
||||
|
||||
Reference in New Issue
Block a user