Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -445,7 +445,7 @@ def extract_json(text: str) -> list | dict:
|
|
| 445 |
raise ValueError(f"清理後仍然無法解析 JSON。原始錯誤: {e}")
|
| 446 |
|
| 447 |
|
| 448 |
-
def reflect_post(api_key, api_key2, user_input):
|
| 449 |
"""
|
| 450 |
API 呼叫總次數固定為 4 次。
|
| 451 |
"""
|
|
@@ -531,7 +531,7 @@ def gradio_interface(user_input):
|
|
| 531 |
return "❌ 系統錯誤", "向量資料庫未成功載入,請檢查伺服器日誌。"
|
| 532 |
|
| 533 |
try:
|
| 534 |
-
analysis_text, final_result = reflect_post(api_key, user_input)
|
| 535 |
return analysis_text, final_result
|
| 536 |
except Exception as e:
|
| 537 |
# 捕捉預期外的錯誤
|
|
|
|
| 445 |
raise ValueError(f"清理後仍然無法解析 JSON。原始錯誤: {e}")
|
| 446 |
|
| 447 |
|
| 448 |
+
def reflect_post(api_key, api_key2, api_key3, api_key4, user_input):
|
| 449 |
"""
|
| 450 |
API 呼叫總次數固定為 4 次。
|
| 451 |
"""
|
|
|
|
| 531 |
return "❌ 系統錯誤", "向量資料庫未成功載入,請檢查伺服器日誌。"
|
| 532 |
|
| 533 |
try:
|
| 534 |
+
analysis_text, final_result = reflect_post(api_key, api_key2, api_key3, api_key4, user_input)
|
| 535 |
return analysis_text, final_result
|
| 536 |
except Exception as e:
|
| 537 |
# 捕捉預期外的錯誤
|