feat:完成重构和测试
This commit is contained in:
+7
-1
@@ -10,6 +10,7 @@ from langchain.agents import AgentState
|
||||
from langchain.tools import ToolRuntime, tool
|
||||
from langchain_core.messages import ToolMessage
|
||||
from langgraph.types import Command
|
||||
from pydantic import Field
|
||||
|
||||
from app.actions.batch import BatchError, run_batch
|
||||
from app.schemas.actions import Action, AddAction
|
||||
@@ -63,7 +64,12 @@ def _result_text(actions: list[Action]) -> str:
|
||||
|
||||
@tool
|
||||
def apply_actions(
|
||||
actions: list[Action], runtime: ToolRuntime[ScreenAgentContext]
|
||||
actions: Annotated[
|
||||
list[Action],
|
||||
# 空的一批会清掉之前成功的结果;参数校验失败不改状态,之前的结果保留
|
||||
Field(min_length=1, description="至少一个动作;不需要修改时不要调用,直接回复"),
|
||||
],
|
||||
runtime: ToolRuntime[ScreenAgentContext],
|
||||
) -> Command:
|
||||
"""提交本次要对大屏做的全部修改
|
||||
|
||||
|
||||
Reference in New Issue
Block a user