fix: 修复 当前时间变量输出时建议输出正常的时间格式

This commit is contained in:
shaohuzhang1 2024-06-27 11:35:35 +08:00
parent 90428641d9
commit d7984e1192
2 changed files with 4 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class WorkFlowPostHandler:
details=details,
message_tokens=message_tokens,
answer_tokens=answer_tokens,
run_time=time.time() - workflow.context['time'],
run_time=time.time() - workflow.context['start_time'],
index=0)
self.chat_info.append_chat_record(chat_record, self.client_id)
# 重新设置缓存

View File

@ -7,6 +7,7 @@
@desc:
"""
import time
from datetime import datetime
from application.flow.i_step_node import NodeResult
from application.flow.step_node.start_node.i_start_node import IStarNode
@ -17,7 +18,8 @@ class BaseStartStepNode(IStarNode):
"""
开始节点 初始化全局变量
"""
return NodeResult({'question': question}, {'time': time.time()})
return NodeResult({'question': question},
{'time': datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'start_time': time.time()})
def get_details(self, index: int, **kwargs):
return {