Fixed RPG

This commit is contained in:
2026-05-29 08:52:33 +03:00
parent e5c0df308f
commit 600ad78f05
24 changed files with 2804 additions and 144 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 = {