spark.tsx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import { ProviderEnum } from '../declarations'
  2. import type { ProviderConfig } from '../declarations'
  3. import { IflytekSpark, IflytekSparkText, IflytekSparkTextCn } from '@/app/components/base/icons/src/public/llm'
  4. const config: ProviderConfig = {
  5. selector: {
  6. name: {
  7. 'en': 'iFLYTEK SPARK',
  8. 'zh-Hans': '讯飞星火',
  9. },
  10. icon: <IflytekSpark className='w-full h-full' />,
  11. },
  12. item: {
  13. key: ProviderEnum.spark,
  14. titleIcon: {
  15. 'en': <IflytekSparkText className='h-6' />,
  16. 'zh-Hans': <IflytekSparkTextCn className='h-6' />,
  17. },
  18. },
  19. modal: {
  20. key: ProviderEnum.spark,
  21. title: {
  22. 'en': 'iFLYTEK SPARK',
  23. 'zh-Hans': '讯飞星火',
  24. },
  25. icon: <IflytekSpark className='w-6 h-6' />,
  26. link: {
  27. href: 'https://www.xfyun.cn/solutions/xinghuoAPI',
  28. label: {
  29. 'en': 'Get your API key from iFLYTEK SPARK',
  30. 'zh-Hans': '从讯飞星火获取 API Key',
  31. },
  32. },
  33. validateKeys: [
  34. 'app_id',
  35. 'api_key',
  36. 'api_secret',
  37. ],
  38. fields: [
  39. {
  40. type: 'text',
  41. key: 'app_id',
  42. required: true,
  43. label: {
  44. 'en': 'API ID',
  45. 'zh-Hans': 'API ID',
  46. },
  47. placeholder: {
  48. 'en': 'Enter your API ID here',
  49. 'zh-Hans': '在此输入您的 API ID',
  50. },
  51. },
  52. {
  53. type: 'text',
  54. key: 'api_secret',
  55. required: true,
  56. label: {
  57. 'en': 'API Secret',
  58. 'zh-Hans': 'API Secret',
  59. },
  60. placeholder: {
  61. 'en': 'Enter your API Secret here',
  62. 'zh-Hans': '在此输入您的 API Secret',
  63. },
  64. },
  65. {
  66. type: 'text',
  67. key: 'api_key',
  68. required: true,
  69. label: {
  70. 'en': 'API Key',
  71. 'zh-Hans': 'API Key',
  72. },
  73. placeholder: {
  74. 'en': 'Enter your API key here',
  75. 'zh-Hans': '在此输入您的 API Key',
  76. },
  77. },
  78. ],
  79. },
  80. }
  81. export default config