fix: reduce prompt time precision

This commit is contained in:
JOJO 2026-02-25 17:56:05 +08:00
parent 8f7e704a7a
commit dc6d998afb
3 changed files with 12 additions and 4 deletions

View File

@ -1310,7 +1310,7 @@ class MainTerminal:
def define_tools(self) -> List[Dict]: def define_tools(self) -> List[Dict]:
"""定义可用工具(添加确认工具)""" """定义可用工具(添加确认工具)"""
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S") current_time = datetime.now().strftime("%Y-%m-%d %H")
tools = [ tools = [
{ {
@ -2550,7 +2550,7 @@ class MainTerminal:
project_storage=project_storage, project_storage=project_storage,
file_tree=context["project_info"]["file_tree"], file_tree=context["project_info"]["file_tree"],
memory=context["memory"], memory=context["memory"],
current_time=datetime.now().strftime("%Y-%m-%d"), current_time=datetime.now().strftime("%Y-%m-%d %H"),
model_description=prompt_replacements.get("model_description", "") model_description=prompt_replacements.get("model_description", "")
) )

8
requirements.txt Normal file
View File

@ -0,0 +1,8 @@
flask
flask-socketio
flask-cors
werkzeug
httpx
openai
cryptography
pillow

View File

@ -1677,7 +1677,7 @@ class ContextManager:
container_cpus=self.container_cpu_limit, container_cpus=self.container_cpu_limit,
container_memory=self.container_memory_limit, container_memory=self.container_memory_limit,
project_storage=self.project_storage_limit, project_storage=self.project_storage_limit,
current_time=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), current_time=datetime.now().strftime("%Y-%m-%d %H"),
file_tree=( file_tree=(
"(以下为工作区根目录的部分文件和文件夹)\n" + context["project_info"]["file_tree"] "(以下为工作区根目录的部分文件和文件夹)\n" + context["project_info"]["file_tree"]
if context["project_info"].get("file_tree") if context["project_info"].get("file_tree")
@ -1709,7 +1709,7 @@ class ContextManager:
project_storage=project_storage, project_storage=project_storage,
file_tree=context["project_info"]["file_tree"], file_tree=context["project_info"]["file_tree"],
memory=context["memory"], memory=context["memory"],
current_time=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), current_time=datetime.now().strftime("%Y-%m-%d %H"),
model_description=prompt_replacements.get("model_description", "") model_description=prompt_replacements.get("model_description", "")
) )