mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-09-24 15:36:23 +00:00
🐛 修复 get_message_id 被弃用的问题并简单修缮了代码格式 (#32)
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Co-authored-by: Akarin~ <60691961+Asankilp@users.noreply.github.com>
This commit is contained in:
@ -22,6 +22,7 @@ from nonebot_plugin_alconna.uniseg import (
|
||||
Text,
|
||||
UniMessage,
|
||||
UniMsg,
|
||||
get_message_id,
|
||||
get_target,
|
||||
)
|
||||
from nonebot_plugin_argot import Argot # type: ignore
|
||||
@ -57,7 +58,7 @@ class MarshoHandler:
|
||||
self.event: Event = current_event.get()
|
||||
# self.state: T_State = current_handler.get().state
|
||||
self.matcher: Matcher = current_matcher.get()
|
||||
self.message_id: str = UniMessage.get_message_id(self.event)
|
||||
self.message_id: str = get_message_id(self.event)
|
||||
self.target = get_target(self.event)
|
||||
|
||||
async def process_user_input(
|
||||
@ -124,7 +125,7 @@ class MarshoHandler:
|
||||
|
||||
async def handle_function_call(
|
||||
self,
|
||||
completion: Union[ChatCompletion],
|
||||
completion: Union[ChatCompletion, AsyncStream[ChatCompletionChunk]],
|
||||
user_message: Union[str, list],
|
||||
model_name: str,
|
||||
tools_list: list | None = None,
|
||||
@ -248,7 +249,7 @@ class MarshoHandler:
|
||||
Text(await process_completion_to_details(response)),
|
||||
command="detail",
|
||||
expired_at=timedelta(minutes=5),
|
||||
)
|
||||
) # type:ignore
|
||||
)
|
||||
# send_message.append(
|
||||
# Argot(
|
||||
|
Reference in New Issue
Block a user