Files
Samuele E. Locatelli 3aea8d9db8 Update progetto
2025-09-03 06:42:58 +00:00

13 lines
379 B
Python

import httpx
from ..config import settings
async def send_chat_completion(history: list):
async with httpx.AsyncClient(timeout=settings.REQUEST_TIMEOUT) as client:
resp = await client.post(
settings.LM_STUDIO_URL,
json={"model": settings.MODEL_NAME, "messages": history},
)
resp.raise_for_status()
return resp.json()