dify 参数提取器无法提取参数,

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

自检

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

Dify版本

0.6.10

云或自托管

自托管(Docker)

重现步骤

我在私有环境中部署了dify和docker,无法访问互联网。
我使用chatglm3作为llm,也部署在本地。

✔️ 预期行为

参数提取器可以正确提取参数。

❌ 实际行为

当我在工作流中使用参数提取器时,它无法正常工作。参数提取器的输出显示“从函数调用或文本响应中提取结果失败,使用空结果”。然后我尝试独立运行参数提取器,输出显示它可以正确提取参数,但在工作流中无法正常工作,似乎“extractor_parameter”函数不起作用。
期待您的回答!

ivqmmu1c

ivqmmu1c1#

您在自托管的Dify 0.6.10环境中遇到的参数提取器问题可能是由几个潜在原因导致的。以下是一些故障排除和解决问题的步骤:

  1. 输入变量配置:确保用于参数提取的输入变量正确选择并与预期格式匹配。
  2. 模型选择:验证为参数提取任务选择了正确的模型(chatglm3),因为提取器依赖于LLM的推理能力。
  3. 参数定义:检查要提取的参数是否正确定义,并符合后续工具或节点的要求。
  4. 说明和示例:提供清晰的说明和示例可以显著提高参数提取过程的有效性和稳定性。
  5. 推理模式:一些模型支持不同的推理模式(函数调用/工具调用与提示)。根据模型的性能选择适当的模式。
  6. 内存设置:如果启用了内存,请确保正确包含聊天历史记录,以帮助LLM理解上下文。
    以下是验证您的配置的检查表:
- Input Variable: Ensure the input variable is correctly selected.
- Model: Verify the correct model is chosen.
- Parameters: Define the parameters to extract accurately.
- Instructions: Provide clear instructions and examples.
- Inference Mode: Select the appropriate inference mode.
- Memory: Ensure memory settings are correctly configured if enabled.

详细日志和错误消息

参数提取器在0.6.10版本中在工作流中的失败时生成的详细日志或错误消息如下:

  1. 无法从函数调用或文本响应中提取结果:
assert result.outputs.get('__reason') == 'Failed to extract result from function call or text response, using empty result.'
  1. 所需参数的空结果:
assert result.outputs.get('location') == ''
  1. LLM调用过程中的一般性故障:
return NodeRunResult(
    status=WorkflowNodeExecutionStatus.FAILED,
    inputs=inputs,
    process_data={},
    outputs={
        '__is_success': 0,
        '__reason': str(e)
    },
    error=str(e),
    metadata={}
)

这些消息表明参数提取器无法从函数调用或文本响应中提取所需的参数,导致参数输出为空,并生成一个特定的原因消息。此外,LLM调用过程中的一般性故障还会产生详细的错误消息1(https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/parameter-extractor.md)2(https://github.com/langgenius/dify/blob/main/api/tests/integration_tests/workflow/nodes/test_parameter_extractor.py)3(https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/parameter_extractor/parameter_extractor_node.py)。

已知问题和兼容性

0.6.10版本中与参数提取器相关的特定已知问题或错误尚未在0.6.11版本中修复,也没有发现chatglm3模型与Dify 0.6.10版本中的参数提取器之间的已知兼容性问题1(https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/node/parameter-extractor.md)。
通过遵循这些步骤并确保适当的配置,您可以在工作流中提高参数提取器的可靠性。

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

相关问题