Browse Source

don't uer proxy in tencent NLP

highing666 4 years ago
parent
commit
1229c1145b
2 changed files with 1 additions and 5 deletions
  1. 0 4
      app/api/routers/nlp.py
  2. 1 1
      app/services/tencent_nlp.py

+ 0 - 4
app/api/routers/nlp.py

@@ -1,6 +1,4 @@
-import httpx
 from fastapi import APIRouter, Query
-from loguru import logger
 
 from app.controllers.nlp.meeting import get_caught_result
 from app.models.domain.nlp import MeetingInfoResponse
@@ -10,8 +8,6 @@ router = APIRouter()
 
 @router.get('/meeting/info', response_model=MeetingInfoResponse)
 async def catch_meeting_info(sentence: str = Query(..., max_length=100)):
-    r = httpx.get('https://www.baidu.com/')  # Test external network
-    logger.info(r.status_code)
     start_time, end_time, duration, room_size, topic, name_list = await get_caught_result(sentence)
     response = {
         'Message': 'success',

+ 1 - 1
app/services/tencent_nlp.py

@@ -32,7 +32,7 @@ class TencentNLP:
 
     def __init__(self):
         cred = credential.Credential(settings.TENCENT_SECRET_ID_V1, settings.TENCENT_SECRET_KEY_V1)
-        http_profile = HttpProfile(proxy=settings.HTTPS_PROXY)
+        http_profile = HttpProfile()
         http_profile.reqMethod = 'GET'
         http_profile.endpoint = settings.TENCENT_NLP_ENDPOINT