DrishtiSharma commited on
Commit
50b26b1
·
verified ·
1 Parent(s): 351a203

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
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=True,
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=True,
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=True,
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=True
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
- st.markdown("### Advanced Visualization")
159
- fig = px.bar(data, x="Category", y="Values", title="Patent Trends by Category")
160
- st.plotly_chart(fig)
 
 
 
161
  except Exception as e:
162
- st.warning(f"Failed to create visualizations: {e}")
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...'):