dify 在使用推理作为模型提供者时,代理类型的应用程序无法流式返回结果,

b09cbbtk  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(35)

自检

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

Dify版本

0.6.11

云或自托管

自托管(源代码)

重现步骤

  1. 创建一个类型为 "agent" 的应用程序。
  2. 将模型设置为由 xinference 提供。
  3. 使用应用程序进行对话。

✔️ 预期行为

❌ 实际行为

wz3gfoph

wz3gfoph1#

您遇到的问题是由于当前的xinference实现不支持流模式。这一点在测试文件中的注解和llm.py文件中的代码中得到了确认:

"""
Function calling of xinference does not support stream mode currently
"""

if stream:
if tools and len(tools) > 0:
raise InvokeBadRequestError('xinference tool calls does not support stream mode')

此外,BaseAgentRunner类包含一个检查,用于确定模型是否支持流式工具调用,这进一步证实了xinference不支持此功能:

check if model supports stream tool call

llm_model = cast(LargeLanguageModel, model_instance.model_type_instance)
model_schema = llm_model.get_model_schema(model_instance.model, model_instance.credentials)
if model_schema and ModelFeature.STREAM_TOOL_CALL in (model_schema.features or []):
self.stream_tool_call = True
else:
self.stream_tool_call = False

因此,当将xinference用作模型提供者时,无法进行流式返回结果是一个已知的限制。

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

u3r8eeie2#

我通过推理测试了LLM,它可以实时返回结果。

imzjd6km

imzjd6km3#

我通过推理测试了LLM,它可以流式返回结果。
你创建了一个代理类型的应用程序吗?

相关问题