MCPcopy
hub / github.com/AstrBotDevs/AstrBot / get_thread

Method get_thread

astrbot/dashboard/services/chat_service.py:1311–1328  ·  view source on GitHub ↗
(self, username: str, thread_id: str)

Source from the content-addressed store, hash-verified

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,

Callers 2

get_chat_threadFunction · 0.80

Calls 4

ChatServiceErrorClass · 0.85
serialize_threadFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected