embed image
Browse files
app.py
CHANGED
@@ -65,6 +65,10 @@ class GradioUIWithExamples(GradioUI):
|
|
65 |
)
|
66 |
submit_button = gr.Button("Submit")
|
67 |
|
|
|
|
|
|
|
|
|
68 |
# Link submit button to agent logic
|
69 |
submit_button.click(
|
70 |
self.agent.run,
|
@@ -88,6 +92,21 @@ class GradioUIWithExamples(GradioUI):
|
|
88 |
demo = self.build_interface()
|
89 |
demo.launch()
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
# Define a tool for analyzing the Florentine Families graph
|
92 |
@tool
|
93 |
def analyze_florentine_graph(metric: str) -> str:
|
|
|
65 |
)
|
66 |
submit_button = gr.Button("Submit")
|
67 |
|
68 |
+
# Embed the HTML file
|
69 |
+
html_content = read_html_file("centrality_network.html")
|
70 |
+
gr.HTML(html_content)
|
71 |
+
|
72 |
# Link submit button to agent logic
|
73 |
submit_button.click(
|
74 |
self.agent.run,
|
|
|
92 |
demo = self.build_interface()
|
93 |
demo.launch()
|
94 |
|
95 |
+
# Function to read HTML file
|
96 |
+
def read_html_file(file_path: str) -> str:
|
97 |
+
"""
|
98 |
+
Reads the content of an HTML file.
|
99 |
+
|
100 |
+
Args:
|
101 |
+
file_path: Path to the HTML file.
|
102 |
+
|
103 |
+
Returns:
|
104 |
+
The content of the HTML file as a string.
|
105 |
+
"""
|
106 |
+
with open(file_path, "r", encoding="utf-8") as file:
|
107 |
+
html_content = file.read()
|
108 |
+
return html_content
|
109 |
+
|
110 |
# Define a tool for analyzing the Florentine Families graph
|
111 |
@tool
|
112 |
def analyze_florentine_graph(metric: str) -> str:
|