File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99@router .get ("/health" , summary = "AI service availability check" )
1010async def ai_health ():
1111 try :
12- async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 10.0 ) as client :
12+ async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 10.0 , trust_env = False ) as client :
1313 response = await client .get (f"{ settings .AI_SERVICE_URL } /health" )
1414 response .raise_for_status ()
1515 data = response .json ()
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ async def send_message(request: ChatRequest) -> ChatResponse:
6464
6565 # AI LLM отвечает до 60 сек — таймаут 90 с запасом
6666 try :
67- async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 90.0 ) as client :
67+ async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 90.0 , trust_env = False ) as client :
6868 response = await client .post (
6969 f"{ settings .AI_SERVICE_URL } /ai/process" , json = payload
7070 )
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ async def onboarding_step(request: OnboardingRequest) -> OnboardingResponse:
7171 )
7272
7373 try :
74- async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 60.0 ) as client :
74+ async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 60.0 , trust_env = False ) as client :
7575 response = await client .post (
7676 f"{ settings .AI_SERVICE_URL } /ai/onboarding" ,
7777 json = {
@@ -106,7 +106,7 @@ async def onboarding_step(request: OnboardingRequest) -> OnboardingResponse:
106106
107107async def _save_profile (db , login : str , ai_user_id : str ) -> None :
108108 try :
109- async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 5.0 ) as client :
109+ async with httpx .AsyncClient (verify = settings .httpx_verify , timeout = 5.0 , trust_env = False ) as client :
110110 response = await client .get (
111111 f"{ settings .AI_SERVICE_URL } /ai/onboarding/{ ai_user_id } /status"
112112 )
You can’t perform that action at this time.
0 commit comments