19 lines
416 B
Python
19 lines
416 B
Python
import httpx
|
|
from logger import logger
|
|
|
|
|
|
class AgentClient:
|
|
def __init__(self):
|
|
self._client = httpx.AsyncClient()
|
|
|
|
async def send_message(self, message):
|
|
logger.info(f"Sending message to agent: {message}")
|
|
|
|
response = await self._client.post(
|
|
"http://localhost:8010/chat",
|
|
json={"messages": message},
|
|
timeout=60
|
|
)
|
|
|
|
return response
|