Update app.py
Browse files
app.py
CHANGED
@@ -92,14 +92,14 @@ def format_results(results):
|
|
92 |
except Exception as e:
|
93 |
markdown_output += f"*Error processing results: {str(e)}*\n\n"
|
94 |
|
95 |
-
# 디버그 정보 추가
|
96 |
-
markdown_output += f"### Debug Info:\n\n```json\n{json.dumps(results, indent=2)}\n```\n"
|
97 |
-
|
98 |
return markdown_output
|
99 |
|
100 |
def serphouse_search(query, country, page, num_result):
|
101 |
results = search_serphouse(query, country, page, num_result)
|
102 |
-
|
|
|
|
|
|
|
103 |
|
104 |
css = """
|
105 |
footer {
|
@@ -115,7 +115,7 @@ iface = gr.Interface(
|
|
115 |
gr.Slider(1, 10, 1, label="Page"),
|
116 |
gr.Slider(1, 100, 10, label="Number of Results")
|
117 |
],
|
118 |
-
outputs=gr.
|
119 |
title="SERPHouse News Search Interface",
|
120 |
description="Enter your search query and select a country to get recent news results from the SERPHouse API.",
|
121 |
theme="Nymbo/Nymbo_Theme",
|
|
|
92 |
except Exception as e:
|
93 |
markdown_output += f"*Error processing results: {str(e)}*\n\n"
|
94 |
|
|
|
|
|
|
|
95 |
return markdown_output
|
96 |
|
97 |
def serphouse_search(query, country, page, num_result):
|
98 |
results = search_serphouse(query, country, page, num_result)
|
99 |
+
print("Raw results:", results) # 콘솔에 원본 결과 출력
|
100 |
+
formatted_results = format_results(results)
|
101 |
+
print("Formatted results:", formatted_results) # 콘솔에 포맷된 결과 출력
|
102 |
+
return f"Raw Results:\n\n```json\n{json.dumps(results, indent=2)}\n```\n\nFormatted Results:\n\n{formatted_results}"
|
103 |
|
104 |
css = """
|
105 |
footer {
|
|
|
115 |
gr.Slider(1, 10, 1, label="Page"),
|
116 |
gr.Slider(1, 100, 10, label="Number of Results")
|
117 |
],
|
118 |
+
outputs=gr.Textbox(label="Results", lines=20),
|
119 |
title="SERPHouse News Search Interface",
|
120 |
description="Enter your search query and select a country to get recent news results from the SERPHouse API.",
|
121 |
theme="Nymbo/Nymbo_Theme",
|