diff options
| author | yifei cheng <[email protected]> | 2024-09-06 06:31:21 +0000 |
|---|---|---|
| committer | yifei cheng <[email protected]> | 2024-09-06 06:31:21 +0000 |
| commit | 342285e74fd8a592df0455bf3eb4d04a0947ad7f (patch) | |
| tree | 7ae97eb15cebccd06efa55338c317c4b07f653dc | |
| parent | d4df6fa16bfc8031e13433137ad7db0ad8a7af7b (diff) | |
Upload New File
| -rw-r--r-- | strategy_adjust_code/kimi_strategy.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/strategy_adjust_code/kimi_strategy.py b/strategy_adjust_code/kimi_strategy.py new file mode 100644 index 0000000..4588a8b --- /dev/null +++ b/strategy_adjust_code/kimi_strategy.py @@ -0,0 +1,31 @@ +# 执行流程
+# 1. 接收初始化指令,获得参数包括策略选择<拒绝服务;数据欺骗>;目标感知结果;状态感知结果;初始的攻击脚本及参数 --> 初始化接口调用
+# 1.1 创建会话
+# 1.2 发送第一条信息,介绍任务背景信息(与下面的合并)
+# 1.3 发送第一条信息,格式化上述参数,并发送当前任务介绍
+# 2. 接收询问策略调整命令,获得参数包括状态感知结果 --> 询问策略调整接口
+
+from flask import Flask, request, jsonify
+import kimi_main
+
+app = Flask(__name__)
+
+
[email protected]('/initial', methods=['POST'])
+def process_initial():
+ data = request.get_json()
+ if kimi_main.initial(data):
+ return jsonify({"message": "Task processed"}), 200
+ else:
+ return jsonify({"error": "Service is currently unavailable"}), 503
+
+
[email protected]('/adjustment', methods=['POST'])
+def process_adjustment():
+ data = request.get_json()
+ kimi_response = kimi_main.adjusting(data)
+ return jsonify(kimi_response), 200
+
+
+if __name__ == '__main__':
+ app.run(debug=True)
\ No newline at end of file |
