diff --git a/app/endpoints/pipeline_endpoint.py b/app/endpoints/pipeline_endpoint.py index 04779c4..0fb0684 100644 --- a/app/endpoints/pipeline_endpoint.py +++ b/app/endpoints/pipeline_endpoint.py @@ -450,7 +450,11 @@ async def handle_text_async(request: Request,token_id,app_id, wxid,msg_data,from 18664262743 wxid_9pocbage7cdb22 ''' - await request.app.state.gewe_service.post_text_async(token_id, app_id, 'wxid_9pocbage7cdb22', msg_content) + contacts_brief= await request.app.state.gewe_service.get_contacts_brief_from_cache_async(wxid) + + contact_nick_name=next(filter(lambda x:x.get("userName") == callback_to_user,contacts_brief),{}).get("nickName","") + assistant_msg_content=f'AI管家转人工提醒:【{contact_nick_name}】有{found_keywords[0]}需求' + await request.app.state.gewe_service.post_text_async(token_id, app_id, 'wxid_9pocbage7cdb22', assistant_msg_content) return diff --git a/app/main.py b/app/main.py index 78d8d9f..df3d4a8 100644 --- a/app/main.py +++ b/app/main.py @@ -153,7 +153,8 @@ async def lifespan(app: FastAPI): # redis_service_instance=app.state.redis_service # 初始化 GeWeChatCom - app.state.gewe_service = await GeWeService.get_instance(redis_service,"http://api.geweapi.com/gewe") + #app.state.gewe_service = await GeWeService.get_instance(redis_service,"http://api.geweapi.com/gewe") + app.state.gewe_service = await GeWeService.get_instance(redis_service,"http://218.78.116.24:10883/gewe") gewe_service=app.state.gewe_service # # 初始化 GeWeChatCom #app.state.gwechat_service = GeWeService(app) diff --git a/celery_config.py b/celery_config.py index 91e0894..6424299 100644 --- a/celery_config.py +++ b/celery_config.py @@ -52,7 +52,8 @@ kafka_config = { 'group_id': KAFKA_GROUP_ID, } gewe_config = { - 'api_url': "http://api.geweapi.com/gewe", + #'api_url': "http://api.geweapi.com/gewe", + 'api_url':"http://218.78.116.24:10883/gewe", } diff --git a/services/gewe_service.py b/services/gewe_service.py index 0dda45f..e9ebe20 100644 --- a/services/gewe_service.py +++ b/services/gewe_service.py @@ -628,7 +628,7 @@ class GeWeService: 'X-GEWE-TOKEN': token_id, 'Content-Type': 'application/json' } - url = 'http://api.geweapi.com/gewe/v2/api/message/downloadVoice' + url = f'{self.base_url}/v2/api/message/downloadVoice' async with aiohttp.ClientSession() as session: async with session.post(url, json=data, headers=headers) as response: if response.ok: