model.ts 1.8 KB

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