mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 06:07:13 +08:00
fix: no need to send when message is empty
This commit is contained in:
@@ -92,6 +92,7 @@ class LinkAIBot(Bot):
|
|||||||
"frequency_penalty": conf().get("frequency_penalty", 0.0), # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
"frequency_penalty": conf().get("frequency_penalty", 0.0), # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
||||||
"presence_penalty": conf().get("presence_penalty", 0.0), # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
"presence_penalty": conf().get("presence_penalty", 0.0), # [-2,2]之间,该值越大则更倾向于产生不同的内容
|
||||||
"session_id": session_id,
|
"session_id": session_id,
|
||||||
|
"sender_id": session_id,
|
||||||
"channel_type": conf().get("channel_type", "wx")
|
"channel_type": conf().get("channel_type", "wx")
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -170,11 +170,13 @@ class ChatChannel(Channel):
|
|||||||
reply = self._generate_reply(context)
|
reply = self._generate_reply(context)
|
||||||
|
|
||||||
logger.debug("[WX] ready to decorate reply: {}".format(reply))
|
logger.debug("[WX] ready to decorate reply: {}".format(reply))
|
||||||
# reply的包装步骤
|
|
||||||
reply = self._decorate_reply(context, reply)
|
|
||||||
|
|
||||||
# reply的发送步骤
|
# reply的包装步骤
|
||||||
self._send_reply(context, reply)
|
if reply and reply.content:
|
||||||
|
reply = self._decorate_reply(context, reply)
|
||||||
|
|
||||||
|
# reply的发送步骤
|
||||||
|
self._send_reply(context, reply)
|
||||||
|
|
||||||
def _generate_reply(self, context: Context, reply: Reply = Reply()) -> Reply:
|
def _generate_reply(self, context: Context, reply: Reply = Reply()) -> Reply:
|
||||||
e_context = PluginManager().emit_event(
|
e_context = PluginManager().emit_event(
|
||||||
|
|||||||
Reference in New Issue
Block a user