openllm.tsx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import { ProviderEnum } from '../declarations'
  2. import type { ProviderConfig } from '../declarations'
  3. import { Openllm, OpenllmText } from '@/app/components/base/icons/src/public/llm'
  4. const config: ProviderConfig = {
  5. selector: {
  6. name: {
  7. 'en': 'OpenLLM',
  8. 'zh-Hans': 'OpenLLM',
  9. },
  10. icon: <Openllm className='w-full h-full' />,
  11. },
  12. item: {
  13. key: ProviderEnum.openllm,
  14. titleIcon: {
  15. 'en': <OpenllmText className='h-6' />,
  16. 'zh-Hans': <OpenllmText 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.openllm,
  37. title: {
  38. 'en': 'OpenLLM',
  39. 'zh-Hans': 'OpenLLM',
  40. },
  41. icon: <Openllm className='h-6' />,
  42. link: {
  43. href: 'https://github.com/bentoml/OpenLLM',
  44. label: {
  45. 'en': 'How to deploy OpenLLM',
  46. 'zh-Hans': '如何部署 OpenLLM',
  47. },
  48. },
  49. defaultValue: {
  50. model_type: 'text-generation',
  51. },
  52. validateKeys: [
  53. 'model_type',
  54. 'model_name',
  55. 'server_url',
  56. ],
  57. fields: [
  58. {
  59. type: 'radio',
  60. key: 'model_type',
  61. required: true,
  62. label: {
  63. 'en': 'Model Type',
  64. 'zh-Hans': '模型类型',
  65. },
  66. options: [
  67. {
  68. key: 'text-generation',
  69. label: {
  70. 'en': 'Text Generation',
  71. 'zh-Hans': '文本生成',
  72. },
  73. },
  74. {
  75. key: 'embeddings',
  76. label: {
  77. 'en': 'Embeddings',
  78. 'zh-Hans': 'Embeddings',
  79. },
  80. },
  81. ],
  82. },
  83. {
  84. type: 'text',
  85. key: 'model_name',
  86. required: true,
  87. label: {
  88. 'en': 'Model Name',
  89. 'zh-Hans': '模型名称',
  90. },
  91. placeholder: {
  92. 'en': 'Enter your Model Name here',
  93. 'zh-Hans': '在此输入您的模型名称',
  94. },
  95. },
  96. {
  97. type: 'text',
  98. key: 'server_url',
  99. required: true,
  100. label: {
  101. 'en': 'Server url',
  102. 'zh-Hans': 'Server url',
  103. },
  104. placeholder: {
  105. 'en': 'Enter your Server Url, eg: https://example.com/xxx',
  106. 'zh-Hans': '在此输入您的 Server Url,如:https://example.com/xxx',
  107. },
  108. },
  109. ],
  110. },
  111. }
  112. export default config