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

@@ -237,8 +237,10 @@ async def _achat_completion_stream(messages: list[dict]) -> str:
def _chat_completion(messages: list[dict]) -> str:
print(messages, flush=True)
rsp = openai.ChatCompletion.create(**_cons_kwargs(messages))
content = rsp["choices"][0]["message"]["content"]
print(content, flush=True)
return content

View File

@@ -51,6 +51,7 @@ TaskContent: Describe the task of the current step.
InputObject_List: The list of the input obejects that will be used in current step.
OutputObject: The name of the final output object of current step.
请用中文回答
"""

View File

@@ -90,6 +90,7 @@ InputObject_List: List existing objects that should be utilized in current step.
AgentName: Specify the agent who will perform the action, You CAN ONLY USE THE NAME APPEARS IN "AgentInvolved".
ActionType: Specify the type of action, note that only the last action can be of type "Finalize", and the last action must be "Finalize".
请用中文回答
"""

File diff suppressed because one or more lines are too long

View File

@@ -9,4 +9,4 @@ GROQ_API_KEY: ""
MISTRAL_API_KEY: ""
## options under experimentation, leave them as Fasle unless you know what it is for
USE_CACHE: False
USE_CACHE: True

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