mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-10-05 16:26:57 +08:00
fix: correct typo in API section title and update links, and adjust provider aliases
- Changed "Inference API" to "Interference API" and updated corresponding documentation links in README.md - Removed "o1" and "dall-e-3" entries from Copilot.py model_aliases - Added "stream" and "extra_body" parameters with default values in Azure.py's create_async_generator method - In CopilotAccount.py, included model_aliases with "gpt-4", "gpt-4o", "o1", and "dall-e-3" - Updated conditional for provider comparison from "==" to "in" list in any_provider.py - Modified g4f/api/__init__.py to set g4f_api_key from environment variable - In backend_api.py, added "user" field to cached data with default "unknown" - Changed logic in OpenaiTemplate.py read_response to check if "choice" exists before processing, and cleaned up indentation and conditionals in response parsing - Removed unnecessary "stop" and "prompt" parameters from comments or unused code in OpenaiTemplate.py - Tightened the check for "provider" comparison in any_provider.py to handle multiple providers properly
This commit is contained in:
@@ -213,8 +213,9 @@ 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")}
|
||||
with cache_file.open("a" if cache_file.exists() else "w") as f:
|
||||
f.write(f"{json.dumps(request.json)}\n")
|
||||
f.write(f"{json.dumps(data)}\n")
|
||||
return {}
|
||||
|
||||
@app.route('/backend-api/v2/usage/<date>', methods=['GET'])
|
||||
|
Reference in New Issue
Block a user