Refactor PollinationsAI model alias handling for improved string conversion; add audio_tokens field to CompletionTokenDetails; update data structure in Backend_Api for user data handling.

This commit is contained in:
hlohaus 2025-10-04 00:48:46 +02:00
parent 6b210f44f9
commit 1fb8b7e4c9
4 changed files with 4 additions and 2 deletions

View file

@ -239,7 +239,7 @@ class Backend_Api(Api):
cache_dir = Path(get_cookies_dir()) / ".usage"
cache_file = cache_dir / f"{datetime.date.today()}.jsonl"
cache_dir.mkdir(parents=True, exist_ok=True)
data = {**request.json, "user": request.headers.get("x-user", "unknown")}
data = {"user": request.headers.get("x-user", "unknown"), **request.json}
with cache_file.open("a" if cache_file.exists() else "w") as f:
f.write(f"{json.dumps(data)}\n")
return {}