This commit is contained in:
wuyifan18
2025-10-18 14:31:34 +08:00
parent e40cdd1dee
commit da2318a40c
27 changed files with 14793 additions and 3642 deletions

View File

@@ -1,5 +1,6 @@
from flask import Flask, request, jsonify
import json
import time
from DataProcess import Add_Collaboration_Brief_FrontEnd
from AgentCoord.RehearsalEngine_V2.ExecutePlan import executePlan
from AgentCoord.PlanEngine.basePlan_Generator import generate_basePlan
@@ -48,6 +49,7 @@ def Handle_fill_stepTask_TaskProcess():
if USE_CACHE:
if requestIdentifier in Request_Cache:
time.sleep(1)
return jsonify(Request_Cache[requestIdentifier])
filled_stepTask = fill_stepTask_TaskProcess(
@@ -118,6 +120,7 @@ def Handle_fill_stepTask():
if USE_CACHE:
if requestIdentifier in Request_Cache:
time.sleep(1)
return jsonify(Request_Cache[requestIdentifier])
filled_stepTask = fill_stepTask(
@@ -211,6 +214,7 @@ def Handle_generate_basePlan():
if USE_CACHE:
if requestIdentifier in Request_Cache:
time.sleep(2)
return jsonify(Request_Cache[requestIdentifier])
basePlan = generate_basePlan(
@@ -239,6 +243,7 @@ def Handle_executePlan():
if USE_CACHE:
if requestIdentifier in Request_Cache:
time.sleep(3)
return jsonify(Request_Cache[requestIdentifier])
RehearsalLog = executePlan(
@@ -252,14 +257,14 @@ def Handle_executePlan():
return response
@app.route("/_saveRequestCashe", methods=["post"])
@app.route("/_saveRequestCashe", methods=["GET"])
def Handle_saveRequestCashe():
with open(
os.path.join(os.getcwd(), "RequestCache", "Request_Cache.json"), "w"
) as json_file:
json.dump(Request_Cache, json_file, indent=4)
response = jsonify(
{"code": 200, "content": "request cashe sucessfully saved"}
{"code": 200, "content": "request cashe sucessfully saved: " + os.path.join(os.getcwd(), "RequestCache", "Request_Cache.json")}
)
return response