| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- // @ts-ignore
- /* eslint-disable */
- import request from '@repo/api-client'
- /** 批量检查模型是否可用 POST /api/ai/ollama/checkModels */
- export async function postAiOllamaCheckModels(
- body: {
- models: string[]
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- result: { available?: boolean; name?: string }[]
- isAuthorized: boolean
- }>('/api/ai/ollama/checkModels', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 下载模型 POST /api/ai/ollama/downloadModel */
- export async function postAiOllamaDownloadModel(
- body: {
- model: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- result: { modelName: string; progress: number; status: string; taskId: string }
- isAuthorized: boolean
- }>('/api/ai/ollama/downloadModel', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 获取下载进度 POST /api/ai/ollama/downloadProcess */
- export async function postAiOllamaDownloadProcess(
- body: {
- taskId: string
- },
- options?: { [key: string]: any }
- ) {
- return request<{
- isSuccess: boolean
- code: number
- result: {
- id: string
- message: string
- modelName: string
- progress: number
- startTime: string
- status: string
- }
- isAuthorized: boolean
- }>('/api/ai/ollama/downloadProcess', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 获取所有下载任务列表 POST /api/ai/ollama/downloadTasks */
- export async function postAiOllamaDownloadTasks(body: {}, options?: { [key: string]: any }) {
- return request<{
- isSuccess: boolean
- code: number
- result: {
- id?: string
- message?: string
- modelName?: string
- progress?: number
- startTime?: string
- status?: string
- }[]
- isAuthorized: boolean
- }>('/api/ai/ollama/downloadTasks', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 获取模型列表 POST /api/ai/ollama/models */
- export async function postAiOllamaModels(body: {}, options?: { [key: string]: any }) {
- return request<{
- isSuccess: boolean
- code: number
- result: { digest?: string; modified_at?: string; name?: string; size?: number }[]
- isAuthorized: boolean
- }>('/api/ai/ollama/models', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
- /** 检查Ollama状态 POST /api/ai/ollama/status */
- export async function postAiOllamaStatus(body: {}, options?: { [key: string]: any }) {
- return request<Record<string, any>>('/api/ai/ollama/status', {
- method: 'POST',
- headers: {
- 'Content-Type': 'application/json'
- },
- data: body,
- ...(options || {})
- })
- }
|