feat: add dynamic variables and startup result handling in batch run schemas
- Introduced dynamic_variables field in BatchRunCreate schema to support flexible input types. - Added BatchStartupResult schema to encapsulate startup state, including greeting and auto-confirmed messages. - Updated BatchRunCaseOut schema to include startup results, enhancing the structure for test run outputs. - Enhanced test run orchestration to prepare and validate dynamic configurations, ensuring isolated variable management across test cases. - Implemented changes in the frontend to accommodate new data structures for improved test case execution and result tracking.
This commit is contained in:
@@ -681,17 +681,10 @@ class PromptBrain(BaseBrain):
|
||||
else:
|
||||
raise ValueError(f"未知系统工具: {kind}")
|
||||
|
||||
if runtime.tool_executor_factory is None:
|
||||
return schema, handler
|
||||
|
||||
async def mock_system_tool(params: FunctionCallParams) -> None:
|
||||
result = await self._tools.execute(
|
||||
tool,
|
||||
dict(params.arguments or {}),
|
||||
)
|
||||
await params.result_callback(result)
|
||||
|
||||
return schema, mock_system_tool
|
||||
# System tools are platform-owned deterministic behavior. Keep their
|
||||
# lifecycle and state semantics identical across production and tests;
|
||||
# only external HTTP, MCP, and client tools use an injected executor.
|
||||
return schema, handler
|
||||
|
||||
def _make_update_state_tool(self, tool, runtime: BrainRuntime):
|
||||
"""更新已声明的动态变量(会话状态),并让模型继续当前回答。"""
|
||||
|
||||
Reference in New Issue
Block a user