Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,16 +122,19 @@ def render_results(data: Dict[str, Any], max_items: int = 10) -> str:
|
|
| 122 |
origin = it.get("originallink", "")
|
| 123 |
pub = _format_pubdate(it.get("pubDate", ""))
|
| 124 |
|
| 125 |
-
#
|
| 126 |
-
lines.append(f"{i}
|
|
|
|
|
|
|
| 127 |
if pub:
|
| 128 |
-
lines.append(f"
|
| 129 |
if origin:
|
| 130 |
-
lines.append(f"
|
| 131 |
if link:
|
| 132 |
-
lines.append(f"
|
| 133 |
if desc:
|
| 134 |
-
lines.append(f"
|
|
|
|
| 135 |
lines.append("")
|
| 136 |
lines.append("")
|
| 137 |
|
|
@@ -507,8 +510,7 @@ def aggregate_search(
|
|
| 507 |
|
| 508 |
def render_results_from_items(items: List[Dict[str, Any]]) -> str:
|
| 509 |
"""
|
| 510 |
-
|
| 511 |
-
ํตํฉ/์ฌ๋ญํน๋ items ๋ฆฌ์คํธ๋ฅผ ๋์ผ ์คํ์ผ๋ก ์ถ๋ ฅํ๋ ํจ์ ์ถ๊ฐ
|
| 512 |
"""
|
| 513 |
lines: List[str] = []
|
| 514 |
lines.append(f"- ์ต์ข
๋ฐํ ๊ฐ์: {len(items)}๊ฑด")
|
|
@@ -521,20 +523,25 @@ def render_results_from_items(items: List[Dict[str, Any]]) -> str:
|
|
| 521 |
origin = it.get("originallink", "")
|
| 522 |
pub = _format_pubdate(it.get("pubDate", ""))
|
| 523 |
|
| 524 |
-
|
|
|
|
|
|
|
|
|
|
| 525 |
if pub:
|
| 526 |
-
lines.append(f"
|
| 527 |
if origin:
|
| 528 |
-
lines.append(f"
|
| 529 |
if link:
|
| 530 |
-
lines.append(f"
|
| 531 |
if desc:
|
| 532 |
-
lines.append(f"
|
|
|
|
| 533 |
lines.append("")
|
| 534 |
|
| 535 |
return "\n".join(lines).strip()
|
| 536 |
|
| 537 |
|
|
|
|
| 538 |
def handle_search(
|
| 539 |
user_query: str,
|
| 540 |
chat_history: List[Dict[str, str]],
|
|
|
|
| 122 |
origin = it.get("originallink", "")
|
| 123 |
pub = _format_pubdate(it.get("pubDate", ""))
|
| 124 |
|
| 125 |
+
# โ
ordered list ๋ฌธ๋ฒ์ ๊นจ์ง ์๋๋ก ์ด์ค์ผ์ดํ ์ ๊ฑฐ
|
| 126 |
+
lines.append(f"{i}. **{title}**")
|
| 127 |
+
|
| 128 |
+
# โ
ํ์ ํญ๋ชฉ์ 4์นธ ๋ค์ฌ์ฐ๊ธฐ(ordered list ํ์ ๋ฆฌ์คํธ ์ธ์ ์์ ํ)
|
| 129 |
if pub:
|
| 130 |
+
lines.append(f" - ๋ฐํ: {pub}")
|
| 131 |
if origin:
|
| 132 |
+
lines.append(f" - ์๋ฌธ: {origin}")
|
| 133 |
if link:
|
| 134 |
+
lines.append(f" - ๋งํฌ: {link}")
|
| 135 |
if desc:
|
| 136 |
+
lines.append(f" - ์์ฝ: {desc}")
|
| 137 |
+
|
| 138 |
lines.append("")
|
| 139 |
lines.append("")
|
| 140 |
|
|
|
|
| 510 |
|
| 511 |
def render_results_from_items(items: List[Dict[str, Any]]) -> str:
|
| 512 |
"""
|
| 513 |
+
ํตํฉ/์ฌ๋ญํน๋ items ๋ฆฌ์คํธ๋ฅผ ๋์ผ ์คํ์ผ๋ก ์ถ๋ ฅ
|
|
|
|
| 514 |
"""
|
| 515 |
lines: List[str] = []
|
| 516 |
lines.append(f"- ์ต์ข
๋ฐํ ๊ฐ์: {len(items)}๊ฑด")
|
|
|
|
| 523 |
origin = it.get("originallink", "")
|
| 524 |
pub = _format_pubdate(it.get("pubDate", ""))
|
| 525 |
|
| 526 |
+
# โ
ordered list ๋ฌธ๋ฒ ์ ์ง
|
| 527 |
+
lines.append(f"{i}. **{title}**")
|
| 528 |
+
|
| 529 |
+
# โ
ํ์ ํญ๋ชฉ 4์นธ ๋ค์ฌ์ฐ๊ธฐ
|
| 530 |
if pub:
|
| 531 |
+
lines.append(f" - ๋ฐํ: {pub}")
|
| 532 |
if origin:
|
| 533 |
+
lines.append(f" - ์๋ฌธ: {origin}")
|
| 534 |
if link:
|
| 535 |
+
lines.append(f" - ๋งํฌ: {link}")
|
| 536 |
if desc:
|
| 537 |
+
lines.append(f" - ์์ฝ: {desc}")
|
| 538 |
+
|
| 539 |
lines.append("")
|
| 540 |
|
| 541 |
return "\n".join(lines).strip()
|
| 542 |
|
| 543 |
|
| 544 |
+
|
| 545 |
def handle_search(
|
| 546 |
user_query: str,
|
| 547 |
chat_history: List[Dict[str, str]],
|