mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-06-10 10:09:44 +08:00
feat(model): 增加模型管理和测试功能
- 新增模型删除功能 - 实现模型测试连接功能 - 优化模型选择器组件 - 更新模型相关API和数据库操作
This commit is contained in:
@@ -18,10 +18,14 @@ export const testConnection = async (data: any) => {
|
||||
return await request.post('/connect_test', data)
|
||||
}
|
||||
|
||||
export const fetchModels = async (providerId: any) => {
|
||||
export const fetchModels = async (providerId: string) => {
|
||||
return await request.get('/model_list/' + providerId)
|
||||
}
|
||||
|
||||
export const fetchEnableModelById = async (id: string) => {
|
||||
return await request.get('/model_enable/' + id)
|
||||
}
|
||||
|
||||
export async function addModel(data: { provider_id: string; model_name: string }) {
|
||||
return request.post('/models', data)
|
||||
}
|
||||
@@ -29,3 +33,7 @@ export async function addModel(data: { provider_id: string; model_name: string }
|
||||
export const fetchEnableModels = async () => {
|
||||
return await request.get('/model_list')
|
||||
}
|
||||
|
||||
export const deleteModelById = async (modelId: number) => {
|
||||
return await request.get(`/models/delete/${modelId}`)
|
||||
}
|
||||
Reference in New Issue
Block a user