We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题描述 title
复现方法 Paste code below
期望的行为 ?
日志信息 ...
相关代码
In [19]: msg1=MessageSegment.text('seg1') In [20]: msg2=MessageSegment.text('seg2') In [21]: msg1 + msg2 Out[21]: [{'type': 'text', 'data': {'text': 'seg1seg2'}}] In [22]: msg1 Out[22]: {'type': 'text', 'data': {'text': 'seg1seg2'}} # changed In [23]: msg2 Out[23]: {'type': 'text', 'data': {'text': 'seg2'}} In [24]:
运行环境
MessageSegment 因爲繼承了 dict,所以是可變類型。不過對於這個問題還要討論,歡迎給出建議。
The text was updated successfully, but these errors were encountered:
居然还有这问题
似乎应该在 Message.__init__ 里面 extend 和 append 的时候做深拷贝
Message.__init__
extend
append
Sorry, something went wrong.
主要问题在于 Message.reduce 会合并 text 消息段,而 MessageSegment 又直接 append 到了 Message 的里,没有拷贝
Message.reduce
text
MessageSegment
Message
No branches or pull requests
问题描述
title
复现方法
Paste code below
期望的行为
?
日志信息
...
相关代码
运行环境
MessageSegment 因爲繼承了 dict,所以是可變類型。不過對於這個問題還要討論,歡迎給出建議。
The text was updated successfully, but these errors were encountered: