refactor to reorganise codebase

This commit is contained in:
Game_Time
2025-08-19 17:21:00 +05:00
parent 653605d939
commit 554ec53a25
16 changed files with 1244 additions and 1195 deletions

35
chatmock/config.py Normal file
View File

@@ -0,0 +1,35 @@
from __future__ import annotations
import os
import sys
from pathlib import Path
CLIENT_ID_DEFAULT = os.getenv("CHATGPT_LOCAL_CLIENT_ID") or "app_EMoamEEZ73f0CkXaXp7hrann"
CHATGPT_RESPONSES_URL = "https://chatgpt.com/backend-api/codex/responses"
def read_base_instructions() -> str:
candidates = [
Path(__file__).parent.parent / "prompt.md",
Path(__file__).parent / "prompt.md",
Path(getattr(sys, "_MEIPASS", "")) / "prompt.md" if getattr(sys, "_MEIPASS", None) else None,
Path.cwd() / "prompt.md",
]
for p in candidates:
if not p:
continue
try:
if p.exists():
content = p.read_text(encoding="utf-8")
if isinstance(content, str) and content.strip():
return content
except Exception:
continue
raise FileNotFoundError(
"Failed to read prompt.md; expected adjacent to package or CWD."
)
BASE_INSTRUCTIONS = read_base_instructions()