Nexent Version
v2.1.1
Problem Description
使用硅基流动大语言模型 deepseek-ai/DeepSeek-V4-Flash 时,模型连通性检测正常,状态显示可用。但在“智能体开发”页面点击“生成智能体”会报:
Model is unavailable. Please check the model status and try again.
后端日志显示真实错误为:
Failed to generate prompt from LLM: list index out of range
原因疑似是硅基流动流式响应中会出现 choices=[] 的 chunk,而 backend/utils/llm_utils.py 直接访问了 chunk.choices[0].delta。
Reproduction Steps
- Docker 部署 Nexent v2.1.1。
- 在模型管理中添加硅基流动 LLM:
- model:
deepseek-ai/DeepSeek-V4-Flash
- base_url:
https://api.siliconflow.cn/v1/
- 点击模型连通性检测,结果显示可用。
- 进入智能体开发页面,选择该模型。
- 输入智能体描述并点击“生成智能体”。
- 前端提示模型不可用,后端日志出现
list index out of range。
Additional Information
单独测试该模型时,非流式请求正常;流式请求也能返回内容,但会包含空 choices chunk:
ChatCompletionChunk(..., choices=[], ...)
建议在处理流式响应时增加判断:
if not getattr(chunk, "choices", None):
continue
Nexent Version
v2.1.1
Problem Description
使用硅基流动大语言模型
deepseek-ai/DeepSeek-V4-Flash时,模型连通性检测正常,状态显示可用。但在“智能体开发”页面点击“生成智能体”会报:Model is unavailable. Please check the model status and try again.后端日志显示真实错误为:
Failed to generate prompt from LLM: list index out of range原因疑似是硅基流动流式响应中会出现
choices=[]的 chunk,而backend/utils/llm_utils.py直接访问了chunk.choices[0].delta。Reproduction Steps
deepseek-ai/DeepSeek-V4-Flashhttps://api.siliconflow.cn/v1/list index out of range。Additional Information
单独测试该模型时,非流式请求正常;流式请求也能返回内容,但会包含空 choices chunk:
ChatCompletionChunk(..., choices=[], ...)建议在处理流式响应时增加判断: