mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-31 21:21:50 +08:00
refactor(api): LLM 提供商管理调用适配后端通用 manage 接口
- manage.ts 扩展 manageLlmProvider,端点联合类型纳入 llm/manage - useLlmProviderDirectory 的目录/模型查询、授权启动/轮询/断开 全部改走 POST /llm/manage(target+action+params 透传) - 系统设置页 LLM 测试调用改走 manage,provider 字段转为 target - 同步更新 composable 与系统设置页测试断言(GET mock 转 POST)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { useToast } from 'vue-toastification'
|
||||
import api from '@/api'
|
||||
import { manageLlmProvider } from '@/api/manage'
|
||||
import { useGlobalSettingsStore } from '@/stores'
|
||||
import { DownloaderConf, MediaServerConf } from '@/api/types'
|
||||
import DownloaderCard from '@/components/cards/DownloaderCard.vue'
|
||||
@@ -817,7 +818,7 @@ async function testLlmConnection() {
|
||||
|
||||
const snapshot = buildLlmSnapshot()
|
||||
const snapshotKey = buildLlmSnapshotKey(snapshot)
|
||||
const payload = buildLlmTestPayload(snapshot)
|
||||
const { provider: testProvider, ...testParams } = buildLlmTestPayload(snapshot)
|
||||
const requestId = ++llmTestRequestId
|
||||
if (llmTestAbortController) llmTestAbortController.abort()
|
||||
const abortController = new AbortController()
|
||||
@@ -825,7 +826,7 @@ async function testLlmConnection() {
|
||||
|
||||
testingLlm.value = true
|
||||
try {
|
||||
await api.post('llm/test', payload, {
|
||||
await manageLlmProvider(testProvider, 'test', testParams, {
|
||||
feedback: 'silent',
|
||||
signal: abortController.signal,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user