export enum ModelTypeEnum {
  CHAT = 'CHAT',
  EMBEDDING = 'EMBEDDING',
  TEXT_IMAGE = 'TEXT_IMAGE',
  WEB_SEARCH = 'WEB_SEARCH',
}

/**
 * 隐藏API密钥中间部分
 * @param key API密钥
 * @returns 隐藏处理后的密钥
 */
export function hideKey(key: string): string {
  if (!key) return ''
  const length = key.length
  if (length <= 8) return key
  const start = key.slice(0, 4)
  const end = key.slice(-4)
  return `${start}****${end}`
}
