mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-19 10:22:04 +08:00
* test(skills): align sandbox cache tests with readonly behavior * ci(release): enforce core quality gate before publish * ci: enforce locked dependency installs in workflows * security: remove curl-pipe-shell installs * chore: align project python baseline to 3.12 * ci(dashboard): add explicit typecheck gate * chore(pre-commit): align ruff hook version with project * ci(codeql): add javascript-typescript analysis * chore(ruff): defer py312 migration lint rules * fix: resolve ruff violations without new ignores * fix: resolve ASYNC230 and ASYNC240 without ignores * fix(auth): replace utcnow with timezone-aware UTC now * fix: avoid blocking file read in file_to_base64
29 lines
815 B
Python
29 lines
815 B
Python
import mcp
|
|
|
|
from astrbot.core.agent.tool import FunctionTool
|
|
from astrbot.core.provider.entities import LLMResponse
|
|
|
|
from .run_context import ContextWrapper
|
|
|
|
|
|
class BaseAgentRunHooks[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: ...
|