mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-12 00:36:03 +00:00
feat: 删除代码中对 mirai 的引用
This commit is contained in:
@@ -4,7 +4,6 @@ import typing
|
||||
import enum
|
||||
import pydantic
|
||||
|
||||
# import mirai
|
||||
|
||||
from ..platform.types import message as platform_message
|
||||
|
||||
@@ -75,14 +74,14 @@ class Message(pydantic.BaseModel):
|
||||
|
||||
def readable_str(self) -> str:
|
||||
if self.content is not None:
|
||||
return str(self.role) + ": " + str(self.get_content_mirai_message_chain())
|
||||
return str(self.role) + ": " + str(self.get_content_platform_message_chain())
|
||||
elif self.tool_calls is not None:
|
||||
return f'调用工具: {self.tool_calls[0].id}'
|
||||
else:
|
||||
return '未知消息'
|
||||
|
||||
def get_content_mirai_message_chain(self, prefix_text: str="") -> platform_message.MessageChain | None:
|
||||
"""将内容转换为 Mirai MessageChain 对象
|
||||
def get_content_platform_message_chain(self, prefix_text: str="") -> platform_message.MessageChain | None:
|
||||
"""将内容转换为平台消息 MessageChain 对象
|
||||
|
||||
Args:
|
||||
prefix_text (str): 首个文字组件的前缀文本
|
||||
@@ -108,7 +107,7 @@ class Message(pydantic.BaseModel):
|
||||
b64_str = b64_str.split(",")[1]
|
||||
|
||||
mc.append(platform_message.Image(base64=b64_str))
|
||||
|
||||
|
||||
# 找第一个文字组件
|
||||
if prefix_text:
|
||||
for i, c in enumerate(mc):
|
||||
|
||||
Reference in New Issue
Block a user