Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ import plotly.express as px
|
|
9 |
import tempfile
|
10 |
import time
|
11 |
|
12 |
-
# Title and Application
|
13 |
st.title("Patent Strategy and Innovation Consultant")
|
14 |
st.sidebar.write(
|
15 |
"This application uses AI to provide actionable insights and comprehensive analysis for patent-related strategies."
|
@@ -91,7 +91,7 @@ plan = Task(
|
|
91 |
"2. Identify key players and emerging technologies.\n"
|
92 |
"3. Provide recommendations for stakeholders on strategic directions.\n"
|
93 |
"4. Identify key statistics such as top regions, top players, and hot areas of innovation.\n"
|
94 |
-
"5. Limit the output to
|
95 |
),
|
96 |
expected_output="A research document with structured insights, strategic recommendations, and key statistics.",
|
97 |
agent=planner
|
@@ -149,8 +149,11 @@ def generate_pdf_report(result, charts=None, table_data=None, metadata=None):
|
|
149 |
|
150 |
if charts:
|
151 |
for chart_path in charts:
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
154 |
|
155 |
if table_data:
|
156 |
pdf.add_page()
|
|
|
9 |
import tempfile
|
10 |
import time
|
11 |
|
12 |
+
# Title and Application Introduction
|
13 |
st.title("Patent Strategy and Innovation Consultant")
|
14 |
st.sidebar.write(
|
15 |
"This application uses AI to provide actionable insights and comprehensive analysis for patent-related strategies."
|
|
|
91 |
"2. Identify key players and emerging technologies.\n"
|
92 |
"3. Provide recommendations for stakeholders on strategic directions.\n"
|
93 |
"4. Identify key statistics such as top regions, top players, and hot areas of innovation.\n"
|
94 |
+
"5. Limit the output to 500 words."
|
95 |
),
|
96 |
expected_output="A research document with structured insights, strategic recommendations, and key statistics.",
|
97 |
agent=planner
|
|
|
149 |
|
150 |
if charts:
|
151 |
for chart_path in charts:
|
152 |
+
try:
|
153 |
+
pdf.add_page()
|
154 |
+
pdf.image(chart_path, x=10, y=20, w=180)
|
155 |
+
except Exception as e:
|
156 |
+
st.error(f"Failed to include chart in PDF: {e}")
|
157 |
|
158 |
if table_data:
|
159 |
pdf.add_page()
|