Browse Source

调整base_url

develop
H Vs 6 days ago
parent
commit
a3a1f3439a
4 changed files with 10 additions and 4 deletions
  1. +5
    -1
      app/endpoints/pipeline_endpoint.py
  2. +2
    -1
      app/main.py
  3. +2
    -1
      celery_config.py
  4. +1
    -1
      services/gewe_service.py

+ 5
- 1
app/endpoints/pipeline_endpoint.py View File

@@ -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



+ 2
- 1
app/main.py View File

@@ -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)


+ 2
- 1
celery_config.py View File

@@ -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",
}




+ 1
- 1
services/gewe_service.py View File

@@ -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:


Loading…
Cancel
Save