Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -270,8 +270,8 @@ def agent_LA(query):
|
|
| 270 |
# Format the results dictionary into a markdown string
|
| 271 |
markdown_output = ""
|
| 272 |
for query, answer in results.items():
|
| 273 |
-
|
| 274 |
-
|
| 275 |
|
| 276 |
#render_markdown(markdown_output) # Pass the formatted string to render_markdown
|
| 277 |
|
|
@@ -282,13 +282,16 @@ def agent_LA(query):
|
|
| 282 |
else:
|
| 283 |
health_result = "NO ALERTTTTTTTTTTT"
|
| 284 |
|
| 285 |
-
final_result = markdown_output + health_result
|
| 286 |
-
return final_result
|
|
|
|
| 287 |
|
| 288 |
|
| 289 |
def greet(query):
|
| 290 |
print("greet")
|
| 291 |
return agent_LA(query)
|
| 292 |
|
| 293 |
-
|
| 294 |
-
|
|
|
|
|
|
|
|
|
| 270 |
# Format the results dictionary into a markdown string
|
| 271 |
markdown_output = ""
|
| 272 |
for query, answer in results.items():
|
| 273 |
+
markdown_out += f"## Query: {query}\n\n"
|
| 274 |
+
markdown_out += f"{answer}\n\n---\n\n" # Add separator between results
|
| 275 |
|
| 276 |
#render_markdown(markdown_output) # Pass the formatted string to render_markdown
|
| 277 |
|
|
|
|
| 282 |
else:
|
| 283 |
health_result = "NO ALERTTTTTTTTTTT"
|
| 284 |
|
| 285 |
+
#final_result = markdown_output + "\n" + "HEALTH DOC" + "\n" + health_result
|
| 286 |
+
#return final_result
|
| 287 |
+
return markdown_out
|
| 288 |
|
| 289 |
|
| 290 |
def greet(query):
|
| 291 |
print("greet")
|
| 292 |
return agent_LA(query)
|
| 293 |
|
| 294 |
+
markdown_output = gr.Markdown()
|
| 295 |
+
|
| 296 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs=markdown_output, title="Log Analyzer agent")
|
| 297 |
+
demo.launch()
|