13 lines
379 B
Python
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()
|
|
|