| 72 | ) |
| 73 | |
| 74 | async def append(self, ov_session_id: str, messages: List[Dict[str, Any]]) -> int: |
| 75 | total = 0 |
| 76 | for start in range(0, len(messages), _BATCH): |
| 77 | chunk = messages[start : start + _BATCH] |
| 78 | result = await self._client.batch_add_messages(ov_session_id, chunk) |
| 79 | total += int(result.get("added", len(chunk)) or 0) |
| 80 | return total |
| 81 | |
| 82 | async def commit(self, ov_session_id: str, keep_recent_count: int = 0) -> Dict[str, Any]: |
| 83 | return await self._client.commit_session(ov_session_id, keep_recent_count=keep_recent_count) |