"添加前端模板和运行代码模块"
This commit is contained in:
23
qiming-run_code_rmcp/fixtures/test_python_simple.py
Normal file
23
qiming-run_code_rmcp/fixtures/test_python_simple.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
# 简单的Python测试脚本,用于测试参数传递机制
|
||||
|
||||
def main(args: dict) -> dict:
|
||||
print(f"接收到的参数: {args}")
|
||||
|
||||
# 尝试通过两种方式获取参数
|
||||
direct_params = args.get("input", "direct_default")
|
||||
nested_params = None
|
||||
|
||||
params = args.get("params")
|
||||
if params:
|
||||
if isinstance(params, dict):
|
||||
nested_params = params.get("input", "nested_default")
|
||||
else:
|
||||
nested_params = str(params)
|
||||
|
||||
# 返回结果,展示两种方式获取的参数
|
||||
return {
|
||||
"direct_access": direct_params,
|
||||
"nested_access": nested_params,
|
||||
"args_structure": args
|
||||
}
|
||||
Reference in New Issue
Block a user