feat: finalize matrix platform audit and docs
This commit is contained in:
parent
6422c7db58
commit
4524a6abc8
30 changed files with 3093 additions and 176 deletions
21
sdk/mock.py
21
sdk/mock.py
|
|
@ -4,8 +4,9 @@ from __future__ import annotations
|
|||
import asyncio
|
||||
import random
|
||||
import uuid
|
||||
from collections.abc import AsyncIterator
|
||||
from datetime import UTC, datetime
|
||||
from typing import Any, AsyncIterator, Literal
|
||||
from typing import Any, Literal
|
||||
|
||||
import structlog
|
||||
|
||||
|
|
@ -222,14 +223,16 @@ class MockPlatformClient:
|
|||
response = f"[MOCK] Ответ на: «{preview}»{attachment_note}"
|
||||
tokens = len(text.split()) * 2
|
||||
|
||||
self._messages[key].append({
|
||||
"message_id": message_id,
|
||||
"user_text": text,
|
||||
"response": response,
|
||||
"tokens_used": tokens,
|
||||
"finished": True,
|
||||
"created_at": datetime.now(UTC).isoformat(),
|
||||
})
|
||||
self._messages[key].append(
|
||||
{
|
||||
"message_id": message_id,
|
||||
"user_text": text,
|
||||
"response": response,
|
||||
"tokens_used": tokens,
|
||||
"finished": True,
|
||||
"created_at": datetime.now(UTC).isoformat(),
|
||||
}
|
||||
)
|
||||
return message_id, response, tokens
|
||||
|
||||
async def _latency(self, min_ms: int = 10, max_ms: int = 80) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue