AutoAgents / common.py
Orami01's picture
Upload 274 files
9c48ae2
raw
history blame
No virus
411 Bytes
from enum import Enum
from datetime import datetime
import json
class MessageType(Enum):
RunTask = "run_task"
Interrupt = "interrupt"
def timestamp():
return datetime.strftime(datetime.now(), "%Y-%m-%d_%H:%M:%S.%f")
def format_message(action = None, data = None, msg = "ok"):
message = {
"action": action,
"data": data,
"msg": msg
}
return json.dumps(message)