add
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import re
|
||||
|
||||
from typing import Type
|
||||
@@ -176,7 +177,10 @@ class AiBotPlugin(AbsExtraConfigPlugin):
|
||||
formatted_body=markdown.render(display)
|
||||
)
|
||||
new_content.set_edit(response_event_id)
|
||||
await self.client.send_message(evt.room_id, new_content)
|
||||
await asyncio.wait_for(
|
||||
self.client.send_message(evt.room_id, new_content),
|
||||
timeout=5.0
|
||||
)
|
||||
last_edit_len = len(accumulated)
|
||||
except Exception as edit_err:
|
||||
self.log.warning(f"Streaming mid-edit failed (skipping): {edit_err}")
|
||||
@@ -195,7 +199,10 @@ class AiBotPlugin(AbsExtraConfigPlugin):
|
||||
formatted_body=markdown.render(accumulated)
|
||||
)
|
||||
final_content.set_edit(response_event_id)
|
||||
await self.client.send_message(evt.room_id, final_content)
|
||||
await asyncio.wait_for(
|
||||
self.client.send_message(evt.room_id, final_content),
|
||||
timeout=15.0
|
||||
)
|
||||
|
||||
def get_ai_platform(self) -> Platform:
|
||||
use_platform = self.config.cur_platform
|
||||
|
||||
Reference in New Issue
Block a user