Skip to content
New issue

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

[Bug]: 消息链未被正确解析 #1025

Closed
7emotions opened this issue Feb 7, 2025 · 1 comment
Closed

[Bug]: 消息链未被正确解析 #1025

7emotions opened this issue Feb 7, 2025 · 1 comment
Labels
bug? Bug或Bug修复相关

Comments

@7emotions
Copy link
Contributor

消息平台适配器

qqofficial(QQ官方API Webhook)

运行环境

v3.4.6.1-2-ga8f2438、Ubuntu、x86_64、Docker部署

异常情况

异常描述

QQ官方API Webhook回调后,在pkg.pipeline.process.process.pyProcessor类的process方法中,query.message_chain为空Plain,但是query.message_event中的content是能正常收到回调的信息。如下方日志描述,消息并没有被正常回显。

关键日志

[02-07 12:28:28.994] app.py (168) - [INFO] : =======================================[02-07 12:28:48.394] process.py (44) - [INFO] : 处理 person_18EBC16FE9F7FD33D65DC2C888E2C8FA 的请求(0): [02-07 12:28:53.808] chat.py (80) - [INFO] : 对话(0)响应: assistant: Hello! Ho...

相关数据

以下为query: core_entities.Query的部分属性

{
	'query_id': 0,
	'launcher_type': < LauncherTypes.PERSON: 'person' > ,
	'launcher_id': '********SENDER_ID********',
	'sender_id': '********SENDER_ID********',
	'message_event': FriendMessage(message_chain = MessageChain([Source(id = '********D_ID********', time = datetime.datetime(2025, 2, 7, 12, 28, 48, 388313)), Plain('')]), source_platform_object = {
		't': 'C2C_MESSAGE_CREATE',
		'user_openid': '********SENDER_ID********',
		'timestamp': '2025-02-07T20:28:47+08:00',
		'd_author_id': '********SENDER_ID********',
		'content': '你是谁',
		'd_id': '********D_ID********',
		'id': '********ID********',
		'channel_id': {},
		'username': {},
		'guild_id': {},
		'member_openid': {},
		'group_openid': {},
		'image_attachments': None
	}, sender = Friend(id = '********SENDER_ID********', nickname = 'C2C_MESSAGE_CREATE', remark = '')),
	'message_chain': MessageChain([Plain('')]),
	'adapter': < pkg.platform.sources.qqofficial.QQOfficialAdapter object at 0x7fc787c13dc0 > ,
	'session': Session(),
    'messages': [],
	'prompt': Prompt(name = 'default', messages = [Message(role = 'system', name = None, content = '', tool_calls = None, tool_call_id = None)]),
	'user_message': Message(role = 'user', name = None, content = [ContentElement(type = 'text', text = '', image_url = None, image_base64 = None)], tool_calls = None, tool_call_id = None),
	'use_model': LLMModelInfo(),
    'use_funcs': [],
	'resp_messages': [],
	'resp_message_chain': [],
	'current_stage': < pkg.pipeline.stagemgr.StageInstContainer object at 0x7fc787288b20 >
}

复现步骤

由于我已经排除了消息平台与LangBotLangBotone-api之间的对接问题,我认为这可能是LangBot代码中细微的问题导致的错误,所以此处未贴出相关配置文件与元数据文件。如需贴出,请告知。

启用的插件

未曾启用插件

@7emotions 7emotions added the bug? Bug或Bug修复相关 label Feb 7, 2025
@wangcham
Copy link
Collaborator

wangcham commented Feb 7, 2025

已合并修复代码,感谢纠正!

@wangcham wangcham closed this as completed Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Bug或Bug修复相关
Projects
None yet
Development

No branches or pull requests

2 participants