main
py 21 lines 652 Bytes
Raw
1 import httpx
2 from loguru import logger
3
4 from app.integrations.modules.schema.duo import CollectDuo
5
6
7 async def post_to_copilot_duo_module(data: CollectDuo):
8 """
9 Send a POST request to the copilot-duo-module Docker container.
10
11 Args:
12 data (CollectDuo): The data to send to the copilot-duo-module Docker container.
13 """
14 logger.info(f"Sending POST request to http://copilot-duo-module/auth with data: {data.model_dump()}")
15 async with httpx.AsyncClient() as client:
16 await client.post(
17 "http://copilot-duo-module/auth",
18 json=data.model_dump(),
19 timeout=120,
20 )
21 return None