You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AttributeError: 'RunnableSequence'无'prompt'属性问题原因解析

错误原因解析
  • 类型不匹配是根本问题:
    • 用reduce_prompt | llm_model生成的reduce_chain是RunnableSequence对象(LangChain表达式链的产物),这个对象没有prompt属性。
    • StuffDocumentsChain的llm_chain参数必须接收LLMChain类的实例,LLMChain内部自带prompt属性,能被StuffDocumentsChain正常调用。
  • 改用LLMChain(prompt = reduce_prompt, llm=llm_model)后,生成的是标准LLMChain实例,完全满足StuffDocumentsChain的参数要求,所以代码能正常运行。

内容的提问来源于stack exchange,提问作者PingPong

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 10:58:09