feat: calendar eco

This commit is contained in:
OpenSquared
2026-07-21 12:41:26 +02:00
parent 4c2103156e
commit 0bdf3f382d
6 changed files with 69 additions and 16 deletions

View File

@@ -1466,14 +1466,18 @@ def set_config(key: str, value: str):
os.environ["OPENAI_API_KEY"] = value
_MASKED_CONFIG_KEYS = ["openai_api_key", "newsapi_key", "eia_api_key", "fred_api_key", "fmp_api_key"]
def get_all_config() -> Dict[str, str]:
conn = get_conn()
rows = conn.execute("SELECT key, value FROM config").fetchall()
conn.close()
result = {r["key"]: r["value"] for r in rows}
if "openai_api_key" in result and result["openai_api_key"]:
result["openai_api_key_set"] = True
result["openai_api_key"] = "***"
for key in _MASKED_CONFIG_KEYS:
if key in result and result[key]:
result[f"{key}_set"] = True
result[key] = "***"
return result