Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,7 @@ db_json_str = json.dumps(PLACE_DB, ensure_ascii=False)
|
|
| 81 |
db_base64 = base64.b64encode(db_json_str.encode('utf-8')).decode('utf-8')
|
| 82 |
|
| 83 |
# ==========================================
|
| 84 |
-
# π₯οΈ 3. ν΅ν© νλ‘ νΈμλ (
|
| 85 |
# ==========================================
|
| 86 |
html_template = """
|
| 87 |
<!DOCTYPE html>
|
|
@@ -131,7 +131,7 @@ html_template = """
|
|
| 131 |
.review-content-box { flex: 1; overflow-y: auto; padding: 20px; }
|
| 132 |
.review-header { text-align: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 15px; }
|
| 133 |
.review-title { font-size: 24px; font-weight: bold; color: var(--gold); margin-bottom: 5px; }
|
| 134 |
-
.review-body { font-size:
|
| 135 |
.review-signature { text-align: right; margin-top: 20px; color: var(--gold); font-weight: bold; }
|
| 136 |
.detail-actions { display: flex; gap: 10px; margin-top: 20px; }
|
| 137 |
.detail-btn { flex: 1; padding: 12px; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; font-size: 14px; text-transform: uppercase; }
|
|
@@ -387,7 +387,8 @@ html_template = """
|
|
| 387 |
}
|
| 388 |
if(found) {
|
| 389 |
const mapUrl = getMapUrl(found, fCountry);
|
| 390 |
-
|
|
|
|
| 391 |
}
|
| 392 |
}
|
| 393 |
addChatMessage(finalHtml, 'bot', true);
|
|
@@ -510,7 +511,6 @@ html_template = """
|
|
| 510 |
const contextDesc = placeData ? (placeData['desc_'+currentLang.toLowerCase()] || placeData.desc_ko) : "";
|
| 511 |
const addressInfo = placeData.address || "Address not available";
|
| 512 |
|
| 513 |
-
// --- [NEW LOGIC] Dual Strategy: Korea (Internal) vs World (External Simulation) ---
|
| 514 |
let searchStrategy = "";
|
| 515 |
if (c.includes("Korea") || c.includes("νκ΅")) {
|
| 516 |
searchStrategy = "SOURCE: Strictly base your review on the provided [CONTEXT] and your general knowledge of Korean geography. Do not hallucinate.";
|
|
@@ -547,7 +547,6 @@ html_template = """
|
|
| 547 |
</html>
|
| 548 |
"""
|
| 549 |
|
| 550 |
-
# μ¬κΈ°κ° μ€μν©λλ€! μμμ """λ‘ λ«μμ€μΌ νμ΄μ¬ μ½λκ° μ΄μ΄μ§λλ€.
|
| 551 |
html_code = html_template.replace("IMAGE_DATA", f"data:image/jpeg;base64,{emily_base64}")
|
| 552 |
html_code = html_code.replace("DB_DATA_BASE64", db_base64)
|
| 553 |
html_code = html_code.replace("GROQ_KEY_INJECTED", GROQ_API_KEY)
|
|
|
|
| 81 |
db_base64 = base64.b64encode(db_json_str.encode('utf-8')).decode('utf-8')
|
| 82 |
|
| 83 |
# ==========================================
|
| 84 |
+
# π₯οΈ 3. ν΅ν© νλ‘ νΈμλ (λ²νΌ ν΄λ¦ μλ¬ νν¬μΈνΈ μμ )
|
| 85 |
# ==========================================
|
| 86 |
html_template = """
|
| 87 |
<!DOCTYPE html>
|
|
|
|
| 131 |
.review-content-box { flex: 1; overflow-y: auto; padding: 20px; }
|
| 132 |
.review-header { text-align: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 15px; }
|
| 133 |
.review-title { font-size: 24px; font-weight: bold; color: var(--gold); margin-bottom: 5px; }
|
| 134 |
+
.review-body { font-size: 16px; line-height: 1.8; color: #e0e0e0; font-family: 'Georgia', serif; font-style: italic; text-align: justify; }
|
| 135 |
.review-signature { text-align: right; margin-top: 20px; color: var(--gold); font-weight: bold; }
|
| 136 |
.detail-actions { display: flex; gap: 10px; margin-top: 20px; }
|
| 137 |
.detail-btn { flex: 1; padding: 12px; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; font-size: 14px; text-transform: uppercase; }
|
|
|
|
| 387 |
}
|
| 388 |
if(found) {
|
| 389 |
const mapUrl = getMapUrl(found, fCountry);
|
| 390 |
+
// [μμ ] μ±λ΄μ μΆμ² λ²νΌμμλ markVisited κΈ°λ₯ μ κ±° (μΌκ΄μ± μ μ§)
|
| 391 |
+
finalHtml += `<br><button class="reco-btn" onclick="openReview('${found.name.replace(/'/g, "\\\\'")}', '${fCountry}')">π ${TRANSLATIONS[currentLang].mapBtn}: ${pName}</button>`;
|
| 392 |
}
|
| 393 |
}
|
| 394 |
addChatMessage(finalHtml, 'bot', true);
|
|
|
|
| 511 |
const contextDesc = placeData ? (placeData['desc_'+currentLang.toLowerCase()] || placeData.desc_ko) : "";
|
| 512 |
const addressInfo = placeData.address || "Address not available";
|
| 513 |
|
|
|
|
| 514 |
let searchStrategy = "";
|
| 515 |
if (c.includes("Korea") || c.includes("νκ΅")) {
|
| 516 |
searchStrategy = "SOURCE: Strictly base your review on the provided [CONTEXT] and your general knowledge of Korean geography. Do not hallucinate.";
|
|
|
|
| 547 |
</html>
|
| 548 |
"""
|
| 549 |
|
|
|
|
| 550 |
html_code = html_template.replace("IMAGE_DATA", f"data:image/jpeg;base64,{emily_base64}")
|
| 551 |
html_code = html_code.replace("DB_DATA_BASE64", db_base64)
|
| 552 |
html_code = html_code.replace("GROQ_KEY_INJECTED", GROQ_API_KEY)
|