dify 无法将模型提供者的配置方法设置为 "fetch-from-remote"

7vux5j2d  于 2个月前  发布在  其他
关注(0)|答案(1)|浏览(32)

自我检查

  • 这仅用于提交错误报告,如果您想提问,请访问 Discussions
  • 我已在现有问题中搜索 search for existing issues (包括已关闭的问题)。
  • 我确认我使用英文提交此报告(我已阅读并同意 Language Policy )。
  • 请务必使用英文提交问题,否则会被关闭。谢谢!:)
  • 请不要修改此模板 :) 并填写所有必需的字段。

Dify版本

0.6.15

云或自托管

自托管(源代码)

重现步骤

在任何模型提供商的yaml配置中。将 configurate_methods 设置为 fetch-from-remote 并启动后端服务器。

预期行为

根据文档 api/core/model_runtime/docs/en_US/provider_scale_out.md ,dify支持从远程获取模型列表。如果 configurate_methods 设置为 fetch-from-remote ,服务器应从提供商获取模型列表。

实际行为

服务器无法启动。错误信息:输入应为 'predefined-model' 或 'customizable-model' [type=枚举,input_value='fetch-from-remote',input_type=str]。

wgx48brx

wgx48brx1#

你好,@jasonhp 👋,我在这里帮助你解决关于Dify项目的问题或疑问。如果你需要帮助解决bug、提问或者想成为贡献者,我会在等待人工维护人员时提供帮助。

要解决在模型提供者的YAML配置中将configurate_methods设置为fetch-from-remote导致服务器无法启动的问题,你需要确保fetch-from-remote被正确识别为有效的配置方法。根据文档,fetch-from-remotepredefined-model配置方法一致。

以下是一个示例配置:

provider: anthropic  # Provider identifier
label:  # Provider display name, can be set in en_US English and zh_Hans Chinese, zh_Hans will default to en_US if not set.
  en_US: Anthropic
icon_small:  # Small provider icon, stored in the _assets directory under the corresponding provider implementation directory, same language strategy as label
  en_US: icon_s_en.png
icon_large:  # Large provider icon, stored in the _assets directory under the corresponding provider implementation directory, same language strategy as label
  en_US: icon_l_en.png
supported_model_types:  # Supported model types, Anthropic only supports LLM
- llm
configurate_methods:  # Supported configuration methods, including fetch-from-remote
- predefined-model
- customizable-model
- fetch-from-remote
provider_credential_schema:  # Provider credential rules, as Anthropic only supports predefined models, unified provider credential rules need to be defined
  credential_form_schemas:  # List of credential form items
  - variable: anthropic_api_key  # Credential parameter variable name
    label:  # Display name
      en_US: API Key
    type: secret-input  # Form type, here secret-input represents an encrypted information input box, showing masked information when editing.
    required: true  # Whether required
    placeholder:  # Placeholder information
      zh_Hans: Enter your API Key here
      en_US: Enter your API Key
  - variable: anthropic_api_url
    label:
      en_US: API URL
    type: text-input  # Form type, here text-input represents a text input box
    required: false
    placeholder:
      zh_Hans: Enter your API URL here
      en_US: Enter your API URL

请确保configurate_methods字段包含如上所示的fetch-from-remote。这应该通过正确识别fetch-from-remote为有效配置方法1(https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/provider_scale_out.md)2(https://github.com/langgenius/dify-docs/blob/main/en/guides/model-configuration/new-provider.md)3(https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/schema.md)来解决服务器启动错误。

  • 要继续与Dosu交流,请提及@dosu。*

相关问题