import {ProviderEnum} from './provider';

export const baseColumns = [
  {
    label: '模型别名',
    field: 'name',
  },
  {
    label: '模型版本',
    field: 'model',
    width: '140',
  },
  {
    label: '回复上限',
    field: 'responseLimit',
    width: '100',
  },
  {
    label: '生成随机性',
    field: 'temperature',
    width: '100',
  },
  {
    label: 'Top P',
    field: 'topP',
    width: '100',
  },
];

export const openaiColumns = [
  ...baseColumns,
  {
    label: 'Api Key',
    field: 'apiKey',
  },
];

export const ollamaColumns = [
  ...baseColumns,
  {
    label: 'Base Url',
    field: 'baseUrl',
  },
];

export const qfanColumns = [
  ...baseColumns,
  {
    label: 'Api Key',
    field: 'apiKey',
  },
];

export const qwenColumns = [
  ...baseColumns,
  {
    label: 'Api Key',
    field: 'apiKey',
  },
];
export const zhipuColumns = [
  ...baseColumns,
  {
    label: 'Api Key',
    field: 'apiKey',
  },
];

export function getColumns(provider: string) {
  switch (provider) {
    case ProviderEnum.OLLAMA: {
      return ollamaColumns;
    }
    case ProviderEnum.Q_FAN: {
      return qfanColumns;
    }
    case ProviderEnum.Q_WEN: {
      return qwenColumns;
    }
    case ProviderEnum.ZHIPU: {
      return zhipuColumns;
    }
  }
  return [...openaiColumns, {
    label: '操作',
    field: 'action',
    width: '150',
  }];
}
