Added RPG

This commit is contained in:
2026-05-28 14:29:43 +03:00
parent e5c0df308f
commit 87699172de
20 changed files with 1268 additions and 22 deletions
+16
View File
@@ -31,6 +31,22 @@ async def send_message(messages: list) -> str:
return data["choices"][0]["message"]["content"]
async def send_message_with_model(messages: list, model: str) -> str:
payload = {
"model": model,
"messages": messages,
}
async with httpx.AsyncClient(timeout=90) as client:
response = await client.post(
OPENROUTER_URL,
headers=HEADERS,
json=payload
)
response.raise_for_status()
data = response.json()
return data["choices"][0]["message"]["content"]
async def stream_message(messages: list):
"""Стриминг — отдаём чанки по мере получения"""
payload = {