7dd95d8a59
* chore: auto fix by ruff * refactor: 统一修正返回类型注解为 None/bool 以匹配实现 * refactor: 将 _get_next_page 改为异步并移除多余的请求错误抛出 * refactor: 将 get_client 的返回类型改为 object * style: 为 LarkMessageEvent 的相关方法添加返回类型注解 None --------- Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
31 lines
862 B
Python
31 lines
862 B
Python
from typing import Generic
|
|
|
|
import mcp
|
|
|
|
from astrbot.core.agent.tool import FunctionTool
|
|
from astrbot.core.provider.entities import LLMResponse
|
|
|
|
from .run_context import ContextWrapper, TContext
|
|
|
|
|
|
class BaseAgentRunHooks(Generic[TContext]):
|
|
async def on_agent_begin(self, run_context: ContextWrapper[TContext]) -> None: ...
|
|
async def on_tool_start(
|
|
self,
|
|
run_context: ContextWrapper[TContext],
|
|
tool: FunctionTool,
|
|
tool_args: dict | None,
|
|
) -> None: ...
|
|
async def on_tool_end(
|
|
self,
|
|
run_context: ContextWrapper[TContext],
|
|
tool: FunctionTool,
|
|
tool_args: dict | None,
|
|
tool_result: mcp.types.CallToolResult | None,
|
|
) -> None: ...
|
|
async def on_agent_done(
|
|
self,
|
|
run_context: ContextWrapper[TContext],
|
|
llm_response: LLMResponse,
|
|
) -> None: ...
|