Compare commits

..

2 Commits

Author SHA1 Message Date
Soulter 5f54becbe2 chore: bump version to 4.12.3 2026-01-17 19:11:05 +08:00
Soulter 317b6fa475 refactor: update event types for LLM tool usage and response 2026-01-17 19:09:49 +08:00
7 changed files with 21 additions and 8 deletions
+1 -1
View File
@@ -1 +1 @@
__version__ = "4.12.2"
__version__ = "4.12.3"
+2 -2
View File
@@ -34,7 +34,7 @@ class MainAgentHooks(BaseAgentRunHooks[AstrAgentContext]):
):
await call_event_hook(
run_context.context.event,
EventType.OnCallingFuncToolEvent,
EventType.OnUsingLLMToolEvent,
tool,
tool_args,
)
@@ -49,7 +49,7 @@ class MainAgentHooks(BaseAgentRunHooks[AstrAgentContext]):
run_context.context.event.clear_result()
await call_event_hook(
run_context.context.event,
EventType.OnAfterCallingFuncToolEvent,
EventType.OnLLMToolRespondEvent,
tool,
tool_args,
tool_result,
+1 -1
View File
@@ -5,7 +5,7 @@ from typing import Any, TypedDict
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
VERSION = "4.12.2"
VERSION = "4.12.3"
DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db")
WEBHOOK_SUPPORTED_PLATFORMS = [
+2 -2
View File
@@ -427,7 +427,7 @@ def register_on_using_llm_tool(**kwargs):
"""
def decorator(awaitable):
_ = get_handler_or_create(awaitable, EventType.OnCallingFuncToolEvent, **kwargs)
_ = get_handler_or_create(awaitable, EventType.OnUsingLLMToolEvent, **kwargs)
return awaitable
return decorator
@@ -453,7 +453,7 @@ def register_on_llm_tool_respond(**kwargs):
def decorator(awaitable):
_ = get_handler_or_create(
awaitable, EventType.OnAfterCallingFuncToolEvent, **kwargs
awaitable, EventType.OnLLMToolRespondEvent, **kwargs
)
return awaitable
+2 -1
View File
@@ -189,7 +189,8 @@ class EventType(enum.Enum):
OnLLMResponseEvent = enum.auto() # LLM 响应后
OnDecoratingResultEvent = enum.auto() # 发送消息前
OnCallingFuncToolEvent = enum.auto() # 调用函数工具
OnAfterCallingFuncToolEvent = enum.auto() # 调用函数工具
OnUsingLLMToolEvent = enum.auto() # 使用 LLM 工具
OnLLMToolRespondEvent = enum.auto() # 调用函数工具后
OnAfterMessageSentEvent = enum.auto() # 发送消息后
+12
View File
@@ -0,0 +1,12 @@
## What's Changed
- fix: 只跳过 AstrBot 预设的位于开头的 System Message,防止一些非预期行为。
- feat: 优化 ChatUI 默认的 System Message
- feat: 新增 tool 调用时 `on_using_llm_tool`、tool 调用后 `on_llm_tool_respond` 的事件钩子。
- feat: 优化 ChatUI 对 Tavily 网页搜索工具的渲染,支持内联搜索引用、引用网页。
hotfix of 4.12.2
- fix: tool call error in some cases
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "AstrBot"
version = "4.12.2"
version = "4.12.3"
description = "Easy-to-use multi-platform LLM chatbot and development framework"
readme = "README.md"
requires-python = ">=3.10"