Spaces:
Building
Building
Upload 2 files
Browse files
app.py
CHANGED
@@ -232,7 +232,7 @@ GEMINI_MODELS = [
|
|
232 |
|
233 |
@app.route('/')
|
234 |
def index():
|
235 |
-
main_content = "Moonfanz Reminiproxy v2.3.
|
236 |
html_template = """
|
237 |
<!DOCTYPE html>
|
238 |
<html>
|
@@ -398,7 +398,7 @@ def chat_completions():
|
|
398 |
show_thoughts = request_data.get('show_thoughts', False)
|
399 |
stream = request_data.get('stream', False)
|
400 |
hint = "流式" if stream else "非流"
|
401 |
-
logger.info(f"\n{model} [{hint}] → ...")
|
402 |
is_thinking = 'thinking' in model
|
403 |
api_version = 'v1alpha' if is_thinking else 'v1beta'
|
404 |
response_type = 'streamGenerateContent' if stream else 'generateContent'
|
@@ -539,6 +539,9 @@ def chat_completions():
|
|
539 |
finish_reason = response.finish_reason
|
540 |
# json_dumps = response.json_dumps
|
541 |
# logger.info(f"AI响应处理成功↓\n{json_dumps}")
|
|
|
|
|
|
|
542 |
if is_thinking and show_thoughts:
|
543 |
text_content = response.thoughts + '\n' + text_content
|
544 |
except AttributeError:
|
@@ -654,7 +657,7 @@ if __name__ == '__main__':
|
|
654 |
|
655 |
scheduler.add_job(keep_alive, 'interval', hours=12)
|
656 |
scheduler.start()
|
657 |
-
logger.info(f"Reminiproxy v2.3.
|
658 |
logger.info(f"最大尝试次数/MaxRetries: {MAX_RETRIES}")
|
659 |
logger.info(f"最大请求次数/MaxRequests: {MAX_REQUESTS}")
|
660 |
logger.info(f"请求限额窗口/LimitWindow: {LIMIT_WINDOW} 秒")
|
|
|
232 |
|
233 |
@app.route('/')
|
234 |
def index():
|
235 |
+
main_content = "Moonfanz Reminiproxy v2.3.3 2025-01-14"
|
236 |
html_template = """
|
237 |
<!DOCTYPE html>
|
238 |
<html>
|
|
|
398 |
show_thoughts = request_data.get('show_thoughts', False)
|
399 |
stream = request_data.get('stream', False)
|
400 |
hint = "流式" if stream else "非流"
|
401 |
+
logger.info(f"\n{model} [{hint}] → {current_api_key[:11]}...{current_api_key[-3:]}")
|
402 |
is_thinking = 'thinking' in model
|
403 |
api_version = 'v1alpha' if is_thinking else 'v1beta'
|
404 |
response_type = 'streamGenerateContent' if stream else 'generateContent'
|
|
|
539 |
finish_reason = response.finish_reason
|
540 |
# json_dumps = response.json_dumps
|
541 |
# logger.info(f"AI响应处理成功↓\n{json_dumps}")
|
542 |
+
if text_content == '':
|
543 |
+
logger.error(f"生成内容失败↙\n{response}")
|
544 |
+
continue
|
545 |
if is_thinking and show_thoughts:
|
546 |
text_content = response.thoughts + '\n' + text_content
|
547 |
except AttributeError:
|
|
|
657 |
|
658 |
scheduler.add_job(keep_alive, 'interval', hours=12)
|
659 |
scheduler.start()
|
660 |
+
logger.info(f"Reminiproxy v2.3.3 启动")
|
661 |
logger.info(f"最大尝试次数/MaxRetries: {MAX_RETRIES}")
|
662 |
logger.info(f"最大请求次数/MaxRequests: {MAX_REQUESTS}")
|
663 |
logger.info(f"请求限额窗口/LimitWindow: {LIMIT_WINDOW} 秒")
|