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