fix:解析
This commit is contained in:
@@ -77,7 +77,7 @@ class DefaultExpressor:
|
|||||||
reasoning: str,
|
reasoning: str,
|
||||||
anchor_message: MessageRecv,
|
anchor_message: MessageRecv,
|
||||||
thinking_id: str,
|
thinking_id: str,
|
||||||
) -> tuple[bool, Optional[List[str]]]:
|
) -> tuple[bool, Optional[List[Tuple[str, str]]]]:
|
||||||
# 创建思考消息
|
# 创建思考消息
|
||||||
await self._create_thinking_message(anchor_message, thinking_id)
|
await self._create_thinking_message(anchor_message, thinking_id)
|
||||||
|
|
||||||
@@ -265,7 +265,7 @@ class DefaultExpressor:
|
|||||||
is_emoji = False
|
is_emoji = False
|
||||||
reply_to = not mark_head
|
reply_to = not mark_head
|
||||||
|
|
||||||
bot_message = self._build_single_sending_message(
|
bot_message = await self._build_single_sending_message(
|
||||||
anchor_message=anchor_message,
|
anchor_message=anchor_message,
|
||||||
message_id=part_message_id,
|
message_id=part_message_id,
|
||||||
message_segment=message_segment,
|
message_segment=message_segment,
|
||||||
@@ -282,6 +282,9 @@ class DefaultExpressor:
|
|||||||
else:
|
else:
|
||||||
typing = True
|
typing = True
|
||||||
|
|
||||||
|
if type == "emoji":
|
||||||
|
typing = False
|
||||||
|
|
||||||
await self.heart_fc_sender.send_message(bot_message, has_thinking=True, typing=typing)
|
await self.heart_fc_sender.send_message(bot_message, has_thinking=True, typing=typing)
|
||||||
|
|
||||||
reply_message_ids.append(part_message_id) # 记录我们生成的ID
|
reply_message_ids.append(part_message_id) # 记录我们生成的ID
|
||||||
@@ -302,6 +305,7 @@ class DefaultExpressor:
|
|||||||
"""
|
"""
|
||||||
选择表情,根据send_emoji文本选择表情,返回表情base64
|
选择表情,根据send_emoji文本选择表情,返回表情base64
|
||||||
"""
|
"""
|
||||||
|
emoji_base64 = ""
|
||||||
emoji_raw = await emoji_manager.get_emoji_for_text(send_emoji)
|
emoji_raw = await emoji_manager.get_emoji_for_text(send_emoji)
|
||||||
if emoji_raw:
|
if emoji_raw:
|
||||||
emoji_path, _description = emoji_raw
|
emoji_path, _description = emoji_raw
|
||||||
|
|||||||
@@ -560,9 +560,7 @@ class HeartFChatting:
|
|||||||
return await handler(reasoning, cycle_timers, thinking_id)
|
return await handler(reasoning, cycle_timers, thinking_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"{self.log_prefix} 处理{action}时出错: {e}")
|
logger.error(f"{self.log_prefix} 处理{action}时出错: {e}")
|
||||||
# 出错时也重置计数器
|
traceback.print_exc()
|
||||||
self.total_no_reply_count = 0
|
|
||||||
self.total_waiting_time = 0.0
|
|
||||||
return False, ""
|
return False, ""
|
||||||
|
|
||||||
async def _handle_no_reply(self, reasoning: str, cycle_timers: dict, thinking_id: str) -> bool:
|
async def _handle_no_reply(self, reasoning: str, cycle_timers: dict, thinking_id: str) -> bool:
|
||||||
@@ -969,7 +967,12 @@ class HeartFChatting:
|
|||||||
|
|
||||||
reply_text = ""
|
reply_text = ""
|
||||||
for reply in reply_set:
|
for reply in reply_set:
|
||||||
reply_text += reply
|
type = reply[0]
|
||||||
|
data = reply[1]
|
||||||
|
if type == "text":
|
||||||
|
reply_text += data
|
||||||
|
elif type == "emoji":
|
||||||
|
reply_text += data
|
||||||
|
|
||||||
self._current_cycle.set_response_info(
|
self._current_cycle.set_response_info(
|
||||||
response_text=reply_text,
|
response_text=reply_text,
|
||||||
|
|||||||
Reference in New Issue
Block a user