- 新增PO号提取、预约ID解析(支持`PR@xxx`格式)工具,完善库存匹配逻辑 - 新增库存映射缓存、匹配/解析结果格式化摘要,优化用户提示 - 修复数据库迁移脚本未检查表存在的问题,避免全新部署失败 - 新增路径工具类统一管理相对路径,优化配置文件处理逻辑 - 归档旧文档,将部署、Dify配置合并到`shipping_notice.md` - 新增完整单元测试与集成测试覆盖核心流程 - 更新前端国际化与会话管理逻辑,优化界面交互
36 lines
1005 B
Python
36 lines
1005 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
|
|
def tool_response(
|
|
*,
|
|
status: str,
|
|
task_id: str | None = None,
|
|
message: str = "",
|
|
data: dict[str, Any] | None = None,
|
|
human_options: list[str] | None = None,
|
|
checkpoint: str | None = None,
|
|
next_required_action: str | None = None,
|
|
forbidden_next_tools: list[str] | None = None,
|
|
stop_agent_turn: bool = False,
|
|
) -> dict[str, Any]:
|
|
payload: dict[str, Any] = {
|
|
"status": status,
|
|
"message": message,
|
|
"data": data or {},
|
|
}
|
|
if task_id:
|
|
payload["task_id"] = task_id
|
|
if human_options:
|
|
payload["human_options"] = human_options
|
|
if checkpoint:
|
|
payload["checkpoint"] = checkpoint
|
|
if next_required_action:
|
|
payload["next_required_action"] = next_required_action
|
|
if forbidden_next_tools:
|
|
payload["forbidden_next_tools"] = forbidden_next_tools
|
|
if stop_agent_turn:
|
|
payload["stop_agent_turn"] = True
|
|
return payload
|