LLMResultChunk cause concatenate str and list exception #13401

Closed
opened 2026-02-21 19:12:00 -05:00 by yindo · 1 comment
Owner

Originally created by @hjlarry on GitHub (Apr 26, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

newest main branch

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. in a workflow run a LLM node
  2. choose any gemini model, require the plugin version == 0.2.0 (only this version response LLMResultChunk)

Image

debug panel:
Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @hjlarry on GitHub (Apr 26, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version newest main branch ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce 1. in a workflow run a LLM node 2. choose any gemini model, require the plugin version == 0.2.0 (only this version response LLMResultChunk) ![Image](https://github.com/user-attachments/assets/c59d385c-4b3e-4ce3-9873-f6d41bfddf43) debug panel: ![Image](https://github.com/user-attachments/assets/ecd8fc75-1dfc-4c93-89db-ba3b96097c10) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:12:00 -05:00
yindo closed this issue 2026-02-21 19:12:00 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 26, 2025):

To resolve the "can only concatenate str (not 'list') to str" exception when using the LLMResultChunk with the Gemini 2.5 Pro model in a self-hosted workflow, ensure that the content being processed is correctly handled as a list. In the api/core/model_runtime/model_providers/tongyi/llm/llm.py file, if the resp_content is a list, it should be extracted using resp_content = resp_content[0]["text"]. This ensures that the content is converted to a string before further processing, preventing the error. Additionally, using Gemini plugin version 0.1.5 can help resolve related issues with model parameters and errors that occur with version 0.2.0 [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 26, 2025): <!-- Answer --> To resolve the "can only concatenate str (not 'list') to str" exception when using the LLMResultChunk with the Gemini 2.5 Pro model in a self-hosted workflow, ensure that the content being processed is correctly handled as a list. In the `api/core/model_runtime/model_providers/tongyi/llm/llm.py` file, if the `resp_content` is a list, it should be extracted using `resp_content = resp_content[0]["text"]`. This ensures that the content is converted to a string before further processing, preventing the error. Additionally, using Gemini plugin version 0.1.5 can help resolve related issues with model parameters and errors that occur with version 0.2.0 <sup>[[1]](https://github.com/langgenius/dify/issues/18394)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/tongyi/llm/llm.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/d9c23900-e585-410c-a8f9-8a4b7c13d468?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/d9c23900-e585-410c-a8f9-8a4b7c13d468?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/d9c23900-e585-410c-a8f9-8a4b7c13d468?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/d9c23900-e585-410c-a8f9-8a4b7c13d468?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d9c23900-e585-410c-a8f9-8a4b7c13d468?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/d9c23900-e585-410c-a8f9-8a4b7c13d468?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d9c23900-e585-410c-a8f9-8a4b7c13d468?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13401