feat: 新增模型管理和供应商配置功能

### v1.1.0
- #### Added
  - 新增 AI 笔记风格选择
  - 新增 AI 笔记返回格式选择
  - 添加 AI 自定义笔记备注 Prompt
  - 添加任务失败重试
  - 添加全局设置页,可在设置页进行模型设置

- #### Optimize
  - 优化前端样式,优化用户体验
  - 增加生成中间产物,可用于失败后加快生成速度
- #### Fix
  - 修复视频截图视频过早删除错误
This commit is contained in:
思诺特
2025-04-26 23:40:17 +08:00
parent 1323cfd1ec
commit 171dea5e0d
51 changed files with 2511 additions and 414 deletions

View File

@@ -3,3 +3,29 @@ import request from '@/utils/request.ts'
export const getProviderList = async () => {
return await request.get('/get_all_providers')
}
export const getProviderById = async (id: string) => {
return await request.get(`/get_provider_by_id/${id}`)
}
export const updateProviderById = async (data: any) => {
return await request.post('/update_provider', data)
}
export const addProvider = async (data: any) => {
return await request.post('/add_provider', data)
}
export const testConnection = async (data: any) => {
return await request.post('/connect_test', data)
}
export const fetchModels = async (providerId: any) => {
return await request.get('/model_list/' + providerId)
}
export async function addModel(data: { provider_id: string; model_name: string }) {
return request.post('/models', data)
}
export const fetchEnableModels = async () => {
return await request.get('/model_list')
}

View File

@@ -4,10 +4,14 @@ import { useTaskStore } from '@/store/taskStore'
import request from '@/utils/request'
export const generateNote = async (data: {
video_url: string
link: undefined | boolean
screenshot: undefined | boolean
platform: string
quality: string
model_name: string
provider_id: string
task_id?: string
format: Array<string>
style: string
extras?: string
}) => {
try {
const response = await request.post('/generate_note', data)
@@ -20,11 +24,8 @@ export const generateNote = async (data: {
}
toast.success('笔记生成任务已提交!')
const taskId = response.data.data.task_id
console.log('res', response)
// 成功提示
useTaskStore.getState().addPendingTask(taskId, data.platform)
return response.data
} catch (e: any) {