openllm.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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: 'text',
  60. key: 'model_name',
  61. required: true,
  62. label: {
  63. 'en': 'Model Name',
  64. 'zh-Hans': '模型名称',
  65. },
  66. placeholder: {
  67. 'en': 'Enter your Model Name here',
  68. 'zh-Hans': '在此输入您的模型名称',
  69. },
  70. },
  71. {
  72. type: 'text',
  73. key: 'server_url',
  74. required: true,
  75. label: {
  76. 'en': 'Server url',
  77. 'zh-Hans': 'Server url',
  78. },
  79. placeholder: {
  80. 'en': 'Enter your Server Url, eg: https://example.com/xxx',
  81. 'zh-Hans': '在此输入您的 Server Url,如:https://example.com/xxx',
  82. },
  83. },
  84. ],
  85. },
  86. }
  87. export default config