chatglm.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { ProviderEnum } from '../declarations'
  2. import type { ProviderConfig } from '../declarations'
  3. import { Chatglm, ChatglmText } from '@/app/components/base/icons/src/public/llm'
  4. const config: ProviderConfig = {
  5. selector: {
  6. name: {
  7. 'en': 'ChatGLM',
  8. 'zh-Hans': 'ChatGLM',
  9. },
  10. icon: <Chatglm className='w-full h-full' />,
  11. },
  12. item: {
  13. key: ProviderEnum.chatglm,
  14. titleIcon: {
  15. 'en': <ChatglmText className='h-6' />,
  16. 'zh-Hans': <ChatglmText className='h-6' />,
  17. },
  18. disable: {
  19. tip: {
  20. 'en': 'Only supports the ',
  21. 'zh-Hans': '仅支持',
  22. },
  23. link: {
  24. href: {
  25. 'en': 'https://docs.dify.ai/getting-started/install-self-hosted',
  26. 'zh-Hans': 'https://docs.dify.ai/v/zh-hans/getting-started/install-self-hosted',
  27. },
  28. label: {
  29. 'en': 'community open-source version',
  30. 'zh-Hans': '社区开源版本',
  31. },
  32. },
  33. },
  34. },
  35. modal: {
  36. key: ProviderEnum.chatglm,
  37. title: {
  38. 'en': 'ChatGLM',
  39. 'zh-Hans': 'ChatGLM',
  40. },
  41. icon: <Chatglm className='h-6' />,
  42. link: {
  43. href: 'https://github.com/THUDM/ChatGLM-6B#api%E9%83%A8%E7%BD%B2',
  44. label: {
  45. 'en': 'How to deploy ChatGLM',
  46. 'zh-Hans': '如何部署 ChatGLM',
  47. },
  48. },
  49. validateKeys: ['api_base'],
  50. fields: [
  51. {
  52. type: 'text',
  53. key: 'api_base',
  54. required: true,
  55. label: {
  56. 'en': 'Custom API Domain',
  57. 'zh-Hans': '自定义 API 域名',
  58. },
  59. placeholder: {
  60. 'en': 'Enter your API domain, eg: https://example.com/xxx',
  61. 'zh-Hans': '在此输入您的 API 域名,如:https://example.com/xxx',
  62. },
  63. },
  64. ],
  65. },
  66. }
  67. export default config