[moonshot] Error: 'str' object has no attribute 'name' #8148

Closed
opened 2026-02-21 18:24:12 -05:00 by yindo · 2 comments
Owner

Originally created by @tyson-shen on GitHub (Feb 11, 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

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

use moonshot llm

✔️ Expected Behavior

No response

Actual Behavior

Image

Originally created by @tyson-shen on GitHub (Feb 11, 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 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce use moonshot llm ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/a2522c05-5ccf-489b-9825-75a0db87ae97)
yindo added the 🐞 bug label 2026-02-21 18:24:12 -05:00
yindo closed this issue 2026-02-21 18:24:12 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 11, 2025):

Hello, @tyson-shen! I'm here to help you with any bugs, questions, or contributions you may have. I'm an expert bot ready to assist you while you wait for a human maintainer.

I found a similar issue that was reported and has been closed: Error: 'str' object has no attribute 'name'. This issue was resolved by a pull request: fix: issue #13483 and #13434 on February 11, 2025. The error was likely caused by the _convert_prompt_message_to_dict method in the MoonshotLargeLanguageModel class, which assumed that the message object had a name attribute, leading to the error when message was a string [1][2].

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Feb 11, 2025): <!-- Greeting --> Hello, @tyson-shen! I'm here to help you with any bugs, questions, or contributions you may have. I'm an expert bot ready to assist you while you wait for a human maintainer. <!-- Answer --> I found a similar issue that was reported and has been closed: [Error: 'str' object has no attribute 'name'](https://github.com/langgenius/dify/issues/13483). This issue was resolved by a pull request: [fix: issue #13483 and #13434](https://github.com/langgenius/dify/pull/13518) on February 11, 2025. The error was likely caused by the `_convert_prompt_message_to_dict` method in the `MoonshotLargeLanguageModel` class, which assumed that the `message` object had a `name` attribute, leading to the error when `message` was a string <sup>[[1]](https://github.com/langgenius/dify/issues/13483)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/moonshot/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/08919bf5-7781-4c1a-a9fd-25850b0c5211?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/08919bf5-7781-4c1a-a9fd-25850b0c5211?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/08919bf5-7781-4c1a-a9fd-25850b0c5211?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/08919bf5-7781-4c1a-a9fd-25850b0c5211?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/08919bf5-7781-4c1a-a9fd-25850b0c5211?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/08919bf5-7781-4c1a-a9fd-25850b0c5211?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Feb 11, 2025):

Duplicated

@crazywoola commented on GitHub (Feb 11, 2025): Duplicated
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8148