mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
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:
parent
6b210f44f9
commit
1fb8b7e4c9
4 changed files with 4 additions and 2 deletions
|
|
@ -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 {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue