-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
32 lines (26 loc) · 881 Bytes
/
Copy pathconfig.py
File metadata and controls
32 lines (26 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import json
from datetime import datetime
# --- Constants & Settings ---
MAX_CHARS = 10000
WORKING_DIR = "./workspace/project" # rename project to your project folder
MAX_ITERS = 20
REASONING_EFFORT = "low"
VERBOSE = True
# --- Model Configuration ---
MODEL_ID = "google/gemini-2.5-flash"
# --- Session & Logging Setup ---
SESSION_ID = datetime.now().strftime("%Y%m%d_%H%M%S")
LOG_DIR = "logs"
os.makedirs(LOG_DIR, exist_ok=True)
# Unique filename for this specific run
LOG_FILE = os.path.join(LOG_DIR, f"session_{SESSION_ID}.jsonl")
def log_event(event_type: str, data: str):
"""Appends a JSON-formatted event to the session-specific log file."""
entry = {
"timestamp": datetime.now().isoformat(),
"event": event_type,
"data": data
}
with open(LOG_FILE, "a", encoding="utf-8") as f:
f.write(json.dumps(entry) + "\n")