(self, username: str, thread_id: str)
| 1309 | return await self.create_thread(username, self._dashboard_payload(payload)) |
| 1310 | |
| 1311 | async def get_thread(self, username: str, thread_id: str) -> dict: |
| 1312 | thread = await self.db.get_webchat_thread_by_id(thread_id) |
| 1313 | if not thread: |
| 1314 | raise ChatServiceError(f"Thread {thread_id} not found") |
| 1315 | if thread.creator != username: |
| 1316 | raise ChatServiceError("Permission denied") |
| 1317 | |
| 1318 | history_ls = await self.platform_history_mgr.get( |
| 1319 | platform_id="webchat_thread", |
| 1320 | user_id=thread_id, |
| 1321 | page=1, |
| 1322 | page_size=1000, |
| 1323 | ) |
| 1324 | return { |
| 1325 | "thread": serialize_thread(thread), |
| 1326 | "history": [history.model_dump() for history in history_ls], |
| 1327 | "is_running": self.running_convs.get(thread_id, False), |
| 1328 | } |
| 1329 | |
| 1330 | async def get_thread_from_dashboard_query( |
| 1331 | self, |
no test coverage detected