mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-10 15:56:03 +00:00
feat: 为NormalMessageResponded事件添加finish_reason参数
This commit is contained in:
@@ -20,7 +20,7 @@ class ContinueCommand(AbstractCommandNode):
|
||||
|
||||
session = pkg.openai.session.get_session(session_name)
|
||||
|
||||
text = session.append()
|
||||
text, _ = session.append()
|
||||
|
||||
reply = [text]
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def process_normal_message(text_message: str, mgr, config, launcher_type: str,
|
||||
try:
|
||||
prefix = "[GPT]" if config.show_prefix else ""
|
||||
|
||||
text = session.append(text_message)
|
||||
text, finish_reason = session.append(text_message)
|
||||
|
||||
# 触发插件事件
|
||||
args = {
|
||||
@@ -49,7 +49,8 @@ def process_normal_message(text_message: str, mgr, config, launcher_type: str,
|
||||
"sender_id": sender_id,
|
||||
"session": session,
|
||||
"prefix": prefix,
|
||||
"response_text": text
|
||||
"response_text": text,
|
||||
"finish_reason": finish_reason,
|
||||
}
|
||||
|
||||
event = pkg.plugin.host.emit(plugin_models.NormalMessageResponded, **args)
|
||||
|
||||
Reference in New Issue
Block a user