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,