feat: llm.name唯一索引; v1端点全部改用name查找llm

This commit is contained in:
yumoqing 2026-07-01 13:48:05 +08:00
parent 0dd5a67a2a
commit 27f3ee9c78
7 changed files with 13 additions and 6 deletions

View File

@ -116,5 +116,12 @@
"textfield": "v", "textfield": "v",
"cond": "parentid='llm_status'" "cond": "parentid='llm_status'"
} }
],
"indexes": [
{
"name": "idx_llm_name",
"idxtype": "unique",
"idxfields": ["name"]
}
] ]
} }

View File

@ -47,7 +47,7 @@ async with get_sor_context(env, 'llmage') as sor:
join llm_api_map m on a.id = m.llmid join llm_api_map m on a.id = m.llmid
join llmcatelog b on m.llmcatelogid = b.id join llmcatelog b on m.llmcatelogid = b.id
where (b.id = ${lctype}$ OR b.name = ${lctype}$) where (b.id = ${lctype}$ OR b.name = ${lctype}$)
and a.model=${model}$ and a.name=${model}$
and a.status = 'published'""" and a.status = 'published'"""
recs = await sor.sqlExe(sql, { recs = await sor.sqlExe(sql, {
'lctype': lctype, 'lctype': lctype,

View File

@ -44,7 +44,7 @@ async with get_sor_context(env, 'llmage') as sor:
join llm_api_map m on a.id = m.llmid join llm_api_map m on a.id = m.llmid
join llmcatelog b on m.llmcatelogid = b.id join llmcatelog b on m.llmcatelogid = b.id
where (b.id = ${lctype}$ OR b.name = ${lctype}$) where (b.id = ${lctype}$ OR b.name = ${lctype}$)
and a.model=${model}$ and a.name=${model}$
and a.status = 'published'""" and a.status = 'published'"""
recs = await sor.sqlExe(sql, { recs = await sor.sqlExe(sql, {
'lctype': lctype, 'lctype': lctype,

View File

@ -34,7 +34,7 @@ async with get_sor_context(env, 'llmage') as sor:
join llm_api_map m on a.id = m.llmid join llm_api_map m on a.id = m.llmid
join llmcatelog b on m.llmcatelogid = b.id join llmcatelog b on m.llmcatelogid = b.id
where (b.id = ${catelogid}$ OR b.name = ${catelogid}$) where (b.id = ${catelogid}$ OR b.name = ${catelogid}$)
and a.model=${model}$ and a.name=${model}$
and a.status = 'published'""" and a.status = 'published'"""
recs = await sor.sqlExe(sql, { recs = await sor.sqlExe(sql, {
'catelogid': catelogid, 'catelogid': catelogid,

View File

@ -45,7 +45,7 @@ async with get_sor_context(env, 'llmage') as sor:
join llm_api_map m on a.id = m.llmid join llm_api_map m on a.id = m.llmid
join llmcatelog b on m.llmcatelogid = b.id join llmcatelog b on m.llmcatelogid = b.id
where (b.id = ${lctype}$ OR b.name = ${lctype}$) where (b.id = ${lctype}$ OR b.name = ${lctype}$)
and a.model=${model}$ and a.name=${model}$
and a.status = 'published'""" and a.status = 'published'"""
recs = await sor.sqlExe(sql, { recs = await sor.sqlExe(sql, {
'lctype': lctype, 'lctype': lctype,

View File

@ -53,7 +53,7 @@ async with get_sor_context(env, 'llmage') as sor:
join llm_api_map m on a.id = m.llmid join llm_api_map m on a.id = m.llmid
join llmcatelog b on m.llmcatelogid = b.id join llmcatelog b on m.llmcatelogid = b.id
where (b.id = ${lctype}$ OR b.name = ${lctype}$) where (b.id = ${lctype}$ OR b.name = ${lctype}$)
and a.model=${model}$ and a.name=${model}$
and a.status = 'published'""" and a.status = 'published'"""
recs = await sor.sqlExe(sql, { recs = await sor.sqlExe(sql, {
'lctype': lctype, 'lctype': lctype,

View File

@ -53,7 +53,7 @@ async with get_sor_context(env, 'llmage') as sor:
join llm_api_map m on a.id = m.llmid join llm_api_map m on a.id = m.llmid
join llmcatelog b on m.llmcatelogid = b.id join llmcatelog b on m.llmcatelogid = b.id
where (b.id = ${lctype}$ OR b.name = ${lctype}$) where (b.id = ${lctype}$ OR b.name = ${lctype}$)
and a.model=${model}$ and a.name=${model}$
and a.status = 'published'""" and a.status = 'published'"""
recs = await sor.sqlExe(sql, { recs = await sor.sqlExe(sql, {
'lctype': lctype, 'lctype': lctype,