Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ planner = Agent(
|
|
61 |
"You're tasked with researching {topic} patents and identifying key trends and players. Your work supports the Patent Writer and Data Analyst."
|
62 |
),
|
63 |
allow_delegation=False,
|
64 |
-
verbose=
|
65 |
llm=llm
|
66 |
)
|
67 |
|
@@ -72,7 +72,7 @@ writer = Agent(
|
|
72 |
"Using the research from the Planner and data from the Analyst, craft a professional document summarizing patent insights for {stakeholder}."
|
73 |
),
|
74 |
allow_delegation=False,
|
75 |
-
verbose=
|
76 |
llm=llm
|
77 |
)
|
78 |
|
@@ -83,7 +83,7 @@ analyst = Agent(
|
|
83 |
"Analyze patent filing data and innovation trends in {topic} to provide statistical insights. Your analysis will guide the Writer's final report."
|
84 |
),
|
85 |
allow_delegation=False,
|
86 |
-
verbose=
|
87 |
llm=llm
|
88 |
)
|
89 |
|
@@ -126,7 +126,7 @@ analyse = Task(
|
|
126 |
crew = Crew(
|
127 |
agents=[planner, analyst, writer],
|
128 |
tasks=[plan, analyse, write],
|
129 |
-
verbose=
|
130 |
)
|
131 |
|
132 |
def generate_pdf_report(result):
|
@@ -155,11 +155,14 @@ def create_visualizations(analyst_output):
|
|
155 |
if enable_custom_visualization and analyst_output:
|
156 |
try:
|
157 |
data = pd.DataFrame(analyst_output)
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
|
|
|
|
161 |
except Exception as e:
|
162 |
-
st.
|
163 |
|
164 |
if st.button("Generate Patent Insights"):
|
165 |
with st.spinner('Processing...'):
|
|
|
61 |
"You're tasked with researching {topic} patents and identifying key trends and players. Your work supports the Patent Writer and Data Analyst."
|
62 |
),
|
63 |
allow_delegation=False,
|
64 |
+
verbose=False,
|
65 |
llm=llm
|
66 |
)
|
67 |
|
|
|
72 |
"Using the research from the Planner and data from the Analyst, craft a professional document summarizing patent insights for {stakeholder}."
|
73 |
),
|
74 |
allow_delegation=False,
|
75 |
+
verbose=False,
|
76 |
llm=llm
|
77 |
)
|
78 |
|
|
|
83 |
"Analyze patent filing data and innovation trends in {topic} to provide statistical insights. Your analysis will guide the Writer's final report."
|
84 |
),
|
85 |
allow_delegation=False,
|
86 |
+
verbose=False,
|
87 |
llm=llm
|
88 |
)
|
89 |
|
|
|
126 |
crew = Crew(
|
127 |
agents=[planner, analyst, writer],
|
128 |
tasks=[plan, analyse, write],
|
129 |
+
verbose=False
|
130 |
)
|
131 |
|
132 |
def generate_pdf_report(result):
|
|
|
155 |
if enable_custom_visualization and analyst_output:
|
156 |
try:
|
157 |
data = pd.DataFrame(analyst_output)
|
158 |
+
if 'Category' in data.columns and 'Values' in data.columns:
|
159 |
+
st.markdown("### Advanced Visualization")
|
160 |
+
fig = px.bar(data, x="Category", y="Values", title="Patent Trends by Category")
|
161 |
+
st.plotly_chart(fig)
|
162 |
+
else:
|
163 |
+
st.warning("Data does not have the required columns for visualization.")
|
164 |
except Exception as e:
|
165 |
+
st.error(f"Failed to create visualizations: {e}")
|
166 |
|
167 |
if st.button("Generate Patent Insights"):
|
168 |
with st.spinner('Processing...'):
|