소스 검색

调整

1257
H Vs 1 주 전
부모
커밋
04faaf1b48
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. +3
    -3
      app/endpoints/pipeline_endpoint.py

+ 3
- 3
app/endpoints/pipeline_endpoint.py 파일 보기

@@ -49,7 +49,7 @@ async def get_messages(request: Request, body: Dict[str, Any]):
wxids = list(config.keys())
meged_backlist_wxids=wxids+WX_BACKLIST
# 公众号ID已gh_开头
if from_wxid in meged_backlist_wxids or 'gh_' in from_wxid:
if (from_wxid in meged_backlist_wxids and from_wxid != wxid) or 'gh_' in from_wxid:
logger.warning(f'来自微信ID {from_wxid} 在黑名单,发送给 {wxid} ,不处理')
return {"message": "收到微信回调消息"}

@@ -401,7 +401,7 @@ async def handle_text_async(request: Request,token_id,app_id, wxid,msg_data,from
'''
私聊文本消息
'''
config=await request.aoo.state.gewe_service.get_wxchat_config_from_cache_async(wxid)
config=await request.app.state.gewe_service.get_wxchat_config_from_cache_async(wxid)
validated_config = AgentConfig.model_validate(config)
if not validated_config.privateGroupChatEnabled:
logger.warning(f"微信号 {wxid} 关闭好友和群自动回复功能,{handle_text_async.__name__} 不回复消息")
@@ -416,7 +416,7 @@ async def handle_text_async(request: Request,token_id,app_id, wxid,msg_data,from

input_wx_content_dialogue_message=[{"type": "text", "text": msg_content}]
input_message=dialogue_message(from_wxid,to_wxid,input_wx_content_dialogue_message)
await request.app.state.kafaka_service.send_message_async(input_message)
await request.app.state.kafka_service.send_message_async(input_message)
logger.info("发送对话 %s",input_message)
else:
callback_to_user=msg_data["FromUserName"]["string"]


Loading…
취소
저장