feat(testing): add fixed tool simulations
This commit is contained in:
@@ -154,6 +154,14 @@ async def create_test_run(
|
||||
raise HTTPException(422, f"用例“{row.name}”校验失败: {exc}") from exc
|
||||
definitions_by_id[row.id] = definition
|
||||
has_image_input = has_image_input or bool(image_asset_ids(definition))
|
||||
for simulation in definition.tool_simulations:
|
||||
tool = tools_by_id.get(simulation.tool_id)
|
||||
if tool is None or tool.function_name != simulation.function_name:
|
||||
raise HTTPException(
|
||||
422,
|
||||
f"用例“{row.name}”引用的工具 {simulation.function_name} "
|
||||
"不属于当前被测助手",
|
||||
)
|
||||
for turn in definition.turns:
|
||||
for behavior in turn.behaviors:
|
||||
if behavior.type != "tool_call":
|
||||
|
||||
Reference in New Issue
Block a user