zhangxiao
2024-08-05 a8b602e8c05e8d1cda15cdc419c4d17d4c113034
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import axios from 'axios';
import qs from 'query-string';
import type { DescData } from '@arco-design/web-vue/es/descriptions/interface';
 
export interface PolicyRecord {
  id: string;
  number: number;
  name: string;
  contentType: 'img' | 'horizontalVideo' | 'verticalVideo';
  filterType: 'artificial' | 'rules';
  count: number;
  status: 'online' | 'offline';
  createdTime: string;
}
 
export interface PolicyParams extends Partial<PolicyRecord> {
  current: number;
  pageSize: number;
}
 
export interface PolicyListRes {
  list: PolicyRecord[];
  total: number;
}
 
// 接口上传
export function kbdocumentupload(params) {
  const config = {
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      // token: token,
    },
  };
  return axios.post('/api/v1/document/upload', params, config);
}
 
// 获取大模型列表接口
export function modelList() {
  return axios.get('/api/v1/llm/list');
}
 
// 大模型tab列表
export function modelmyLlms() {
  return axios.get('/api/v1/llm/my_llms');
}
 
// 添加子模型
export function addLlm(params) {
  return axios.post('/api/v1/llm/add_llm', params);
}
 
// 删除子模型
export function deleteLlm(params) {
  return axios.post('/api/v1/llm/delete_llm', params);
}
// 获取子模型详情/llm/get_llm/Xinference/qwen2-7b
export function getLlmDetail(id, val) {
  return axios.get(`/api/v1/llm/get_llm/${id}/${val}`);
}
 
// 新增模型
export function addLlmFactory(params) {
  return axios.post('/api/v1/llm/add_llm_factory', params);
}
 
// 删除模型
export function deleteLlmFactory(name) {
  return axios.delete(`/api/v1/llm/delete_llm_factory/${name}`);
}