mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
docs: update docstrings for message metadata and reply fields; fix markdown capability check in format instructions; improve streaming card update logic in Feishu
This commit is contained in:
@@ -162,6 +162,8 @@ class StreamingHandler:
|
|||||||
:param user_id: 用户ID
|
:param user_id: 用户ID
|
||||||
:param username: 用户名
|
:param username: 用户名
|
||||||
:param title: 消息标题
|
:param title: 消息标题
|
||||||
|
:param original_message_id: 原始消息ID(如果是回复消息)
|
||||||
|
:param original_chat_id: 原始聊天ID(如果是回复消息)
|
||||||
"""
|
"""
|
||||||
self._channel = channel
|
self._channel = channel
|
||||||
self._source = source
|
self._source = source
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ class PromptManager:
|
|||||||
根据渠道能力动态生成格式指令
|
根据渠道能力动态生成格式指令
|
||||||
"""
|
"""
|
||||||
instructions = []
|
instructions = []
|
||||||
if ChannelCapability.RICH_TEXT not in caps.capabilities:
|
if ChannelCapability.MARKDOWN not in caps.capabilities:
|
||||||
instructions.append(
|
instructions.append(
|
||||||
"- Formatting: Use **Plain Text ONLY**. The channel does NOT support Markdown."
|
"- Formatting: Use **Plain Text ONLY**. The channel does NOT support Markdown."
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1559,6 +1559,7 @@ class ChainBase(metaclass=ABCMeta):
|
|||||||
:param text: 新的消息内容
|
:param text: 新的消息内容
|
||||||
:param title: 消息标题
|
:param title: 消息标题
|
||||||
:param buttons: 更新后的按钮列表
|
:param buttons: 更新后的按钮列表
|
||||||
|
:param metadata: 其他消息元数据
|
||||||
:return: 编辑是否成功
|
:return: 编辑是否成功
|
||||||
"""
|
"""
|
||||||
return self.run_module(
|
return self.run_module(
|
||||||
|
|||||||
@@ -1251,13 +1251,15 @@ class Feishu:
|
|||||||
sequence = int(stream_meta.get("sequence") or 0) + 1
|
sequence = int(stream_meta.get("sequence") or 0) + 1
|
||||||
# 无论远端是否响应成功都自增 sequence,防止某次超时导致后续 sequence 一直因为没有递增而被拒绝
|
# 无论远端是否响应成功都自增 sequence,防止某次超时导致后续 sequence 一直因为没有递增而被拒绝
|
||||||
stream_meta["sequence"] = sequence
|
stream_meta["sequence"] = sequence
|
||||||
if card_id and element_id and self._update_streaming_card_content(
|
if card_id and element_id:
|
||||||
card_id=card_id,
|
if self._update_streaming_card_content(
|
||||||
element_id=element_id,
|
card_id=card_id,
|
||||||
content=self._escape_card_text(text).strip() or " ",
|
element_id=element_id,
|
||||||
sequence=sequence,
|
content=self._escape_card_text(text).strip() or " ",
|
||||||
):
|
sequence=sequence,
|
||||||
return True
|
):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
card = self._build_card(title=title, text=text, link=None, buttons=buttons)
|
card = self._build_card(title=title, text=text, link=None, buttons=buttons)
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user