From 27f3ee9c78f691403d2e835ad53e22c050c05b60 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 1 Jul 2026 13:48:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20llm.name=E5=94=AF=E4=B8=80=E7=B4=A2?= =?UTF-8?q?=E5=BC=95;=20v1=E7=AB=AF=E7=82=B9=E5=85=A8=E9=83=A8=E6=94=B9?= =?UTF-8?q?=E7=94=A8name=E6=9F=A5=E6=89=BEllm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/llm.json | 7 +++++++ wwwroot/v1/audio/speech/index.dspy | 2 +- wwwroot/v1/audio/transcriptions/index.dspy | 2 +- wwwroot/v1/chat/completions/index.dspy | 2 +- wwwroot/v1/image/generations/index.dspy | 2 +- wwwroot/v1/music/generations/index.dspy | 2 +- wwwroot/v1/video/generations/index.dspy | 2 +- 7 files changed, 13 insertions(+), 6 deletions(-) diff --git a/models/llm.json b/models/llm.json index a67cf12..61687ee 100644 --- a/models/llm.json +++ b/models/llm.json @@ -116,5 +116,12 @@ "textfield": "v", "cond": "parentid='llm_status'" } + ], + "indexes": [ + { + "name": "idx_llm_name", + "idxtype": "unique", + "idxfields": ["name"] + } ] } \ No newline at end of file diff --git a/wwwroot/v1/audio/speech/index.dspy b/wwwroot/v1/audio/speech/index.dspy index d68ee1f..c9487b9 100644 --- a/wwwroot/v1/audio/speech/index.dspy +++ b/wwwroot/v1/audio/speech/index.dspy @@ -47,7 +47,7 @@ async with get_sor_context(env, 'llmage') as sor: join llm_api_map m on a.id = m.llmid join llmcatelog b on m.llmcatelogid = b.id where (b.id = ${lctype}$ OR b.name = ${lctype}$) - and a.model=${model}$ + and a.name=${model}$ and a.status = 'published'""" recs = await sor.sqlExe(sql, { 'lctype': lctype, diff --git a/wwwroot/v1/audio/transcriptions/index.dspy b/wwwroot/v1/audio/transcriptions/index.dspy index 793e571..42f6664 100644 --- a/wwwroot/v1/audio/transcriptions/index.dspy +++ b/wwwroot/v1/audio/transcriptions/index.dspy @@ -44,7 +44,7 @@ async with get_sor_context(env, 'llmage') as sor: join llm_api_map m on a.id = m.llmid join llmcatelog b on m.llmcatelogid = b.id where (b.id = ${lctype}$ OR b.name = ${lctype}$) - and a.model=${model}$ + and a.name=${model}$ and a.status = 'published'""" recs = await sor.sqlExe(sql, { 'lctype': lctype, diff --git a/wwwroot/v1/chat/completions/index.dspy b/wwwroot/v1/chat/completions/index.dspy index 1856a15..1f743da 100644 --- a/wwwroot/v1/chat/completions/index.dspy +++ b/wwwroot/v1/chat/completions/index.dspy @@ -34,7 +34,7 @@ async with get_sor_context(env, 'llmage') as sor: join llm_api_map m on a.id = m.llmid join llmcatelog b on m.llmcatelogid = b.id where (b.id = ${catelogid}$ OR b.name = ${catelogid}$) - and a.model=${model}$ + and a.name=${model}$ and a.status = 'published'""" recs = await sor.sqlExe(sql, { 'catelogid': catelogid, diff --git a/wwwroot/v1/image/generations/index.dspy b/wwwroot/v1/image/generations/index.dspy index e39fc8e..bf2300f 100644 --- a/wwwroot/v1/image/generations/index.dspy +++ b/wwwroot/v1/image/generations/index.dspy @@ -45,7 +45,7 @@ async with get_sor_context(env, 'llmage') as sor: join llm_api_map m on a.id = m.llmid join llmcatelog b on m.llmcatelogid = b.id where (b.id = ${lctype}$ OR b.name = ${lctype}$) - and a.model=${model}$ + and a.name=${model}$ and a.status = 'published'""" recs = await sor.sqlExe(sql, { 'lctype': lctype, diff --git a/wwwroot/v1/music/generations/index.dspy b/wwwroot/v1/music/generations/index.dspy index d7ac2e2..160b238 100644 --- a/wwwroot/v1/music/generations/index.dspy +++ b/wwwroot/v1/music/generations/index.dspy @@ -53,7 +53,7 @@ async with get_sor_context(env, 'llmage') as sor: join llm_api_map m on a.id = m.llmid join llmcatelog b on m.llmcatelogid = b.id where (b.id = ${lctype}$ OR b.name = ${lctype}$) - and a.model=${model}$ + and a.name=${model}$ and a.status = 'published'""" recs = await sor.sqlExe(sql, { 'lctype': lctype, diff --git a/wwwroot/v1/video/generations/index.dspy b/wwwroot/v1/video/generations/index.dspy index 235199d..a24c326 100644 --- a/wwwroot/v1/video/generations/index.dspy +++ b/wwwroot/v1/video/generations/index.dspy @@ -53,7 +53,7 @@ async with get_sor_context(env, 'llmage') as sor: join llm_api_map m on a.id = m.llmid join llmcatelog b on m.llmcatelogid = b.id where (b.id = ${lctype}$ OR b.name = ${lctype}$) - and a.model=${model}$ + and a.name=${model}$ and a.status = 'published'""" recs = await sor.sqlExe(sql, { 'lctype': lctype,