Spaces:
Running
Running
add datetime in UTC to log files
Browse files- autoagents/utils/logger.py +4 -0
- requirements.txt +1 -0
autoagents/utils/logger.py
CHANGED
@@ -2,6 +2,8 @@ import os
|
|
2 |
import json
|
3 |
from typing import Dict, Any
|
4 |
import uuid
|
|
|
|
|
5 |
|
6 |
import huggingface_hub
|
7 |
from huggingface_hub import Repository
|
@@ -42,6 +44,8 @@ class InteractionsLogger:
|
|
42 |
self.structured_data.update(data)
|
43 |
|
44 |
def save(self):
|
|
|
|
|
45 |
if self.persist:
|
46 |
# TODO: want to add retry in a loop?
|
47 |
self.repo.git_pull()
|
|
|
2 |
import json
|
3 |
from typing import Dict, Any
|
4 |
import uuid
|
5 |
+
from datetime import datetime
|
6 |
+
import pytz
|
7 |
|
8 |
import huggingface_hub
|
9 |
from huggingface_hub import Repository
|
|
|
44 |
self.structured_data.update(data)
|
45 |
|
46 |
def save(self):
|
47 |
+
# add current datetime
|
48 |
+
self.add_message({"datetime": datetime.now(pytz.utc).strftime("%m/%d/%Y %H:%M:%S %Z%z")})
|
49 |
if self.persist:
|
50 |
# TODO: want to add retry in a loop?
|
51 |
self.repo.git_pull()
|
requirements.txt
CHANGED
@@ -2,3 +2,4 @@ openai>=0.27.7
|
|
2 |
langchain
|
3 |
duckpy
|
4 |
huggingface_hub
|
|
|
|
2 |
langchain
|
3 |
duckpy
|
4 |
huggingface_hub
|
5 |
+
pytz
|