model_provider.yaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. provider: {{ .PluginName }}
  2. label:
  3. en_US: {{ .PluginName | SnakeToCamel }}
  4. description:
  5. en_US: Models provided by {{ .PluginName }}.
  6. zh_Hans: {{ .PluginName | SnakeToCamel }} 提供的模型。
  7. icon_small:
  8. en_US: icon_s_en.svg
  9. icon_large:
  10. en_US: icon_l_en.svg
  11. background: "#E5E7EB"
  12. help:
  13. title:
  14. en_US: Get your API Key from {{ .PluginName }}
  15. zh_Hans: 从 {{ .PluginName | SnakeToCamel }} 获取 API Key
  16. url:
  17. en_US: https://__put_your_url_here__/account/api-keys
  18. supported_model_types:
  19. {{- range .SupportedModelTypes }}
  20. - {{ . }}
  21. {{- end }}
  22. configurate_methods:
  23. - predefined-model
  24. - customizable-model
  25. model_credential_schema:
  26. model:
  27. label:
  28. en_US: Model Name
  29. zh_Hans: 模型名称
  30. placeholder:
  31. en_US: Enter your model name
  32. zh_Hans: 输入模型名称
  33. credential_form_schemas:
  34. - variable: openai_api_key
  35. label:
  36. en_US: API Key
  37. type: secret-input
  38. required: true
  39. placeholder:
  40. zh_Hans: 在此输入您的 API Key
  41. en_US: Enter your API Key
  42. provider_credential_schema:
  43. credential_form_schemas:
  44. - variable: openai_api_key
  45. label:
  46. en_US: API Key
  47. type: secret-input
  48. required: true
  49. placeholder:
  50. zh_Hans: 在此输入您的 API Key
  51. en_US: Enter your API Key
  52. models:
  53. {{- if HasSubstring "llm" .SupportedModelTypes }}
  54. llm:
  55. predefined:
  56. - "models/llm/*.yaml"
  57. {{- end }}
  58. {{- if HasSubstring "text_embedding" .SupportedModelTypes }}
  59. text_embedding:
  60. predefined:
  61. - "models/text_embedding/*.yaml"
  62. {{- end }}
  63. {{- if HasSubstring "tts" .SupportedModelTypes }}
  64. tts:
  65. predefined:
  66. - "models/tts/*.yaml"
  67. {{- end }}
  68. {{- if HasSubstring "speech2text" .SupportedModelTypes }}
  69. speech2text:
  70. predefined:
  71. - "models/speech2text/*.yaml"
  72. {{- end }}
  73. {{- if HasSubstring "moderation" .SupportedModelTypes }}
  74. moderation:
  75. predefined:
  76. - "models/moderation/*.yaml"
  77. {{- end }}
  78. extra:
  79. python:
  80. provider_source: provider/openai.py
  81. model_sources:
  82. {{- if HasSubstring "llm" .SupportedModelTypes }}
  83. - "models/llm/llm.py"
  84. {{- end }}
  85. {{- if HasSubstring "text-embedding" .SupportedModelTypes }}
  86. - "models/text_embedding/text_embedding.py"
  87. {{- end }}
  88. {{- if HasSubstring "speech2text" .SupportedModelTypes }}
  89. - "models/speech2text/speech2text.py"
  90. {{- end }}
  91. {{- if HasSubstring "moderation" .SupportedModelTypes }}
  92. - "models/moderation/moderation.py"
  93. {{- end }}
  94. {{- if HasSubstring "tts" .SupportedModelTypes }}
  95. - "models/tts/tts.py"
  96. {{- end }}