Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import cohere
|
4 |
-
from crewai import Agent, Task, Crew
|
5 |
from langchain_groq import ChatGroq
|
6 |
from langchain_community.tools import DuckDuckGoSearchRun, DuckDuckGoSearchResults
|
7 |
from crewai_tools import tool, SeleniumScrapingTool, ScrapeWebsiteTool
|
@@ -91,6 +91,8 @@ def kickoff_crew(topic: str) -> dict:
|
|
91 |
"and piece of data gathered. Your research is thorough, ensuring that no stone is left unturned. "
|
92 |
"This dedication not only enhances the quality of the information but also ensures "
|
93 |
"reliability and trustworthiness in your findings."
|
|
|
|
|
94 |
),
|
95 |
allow_delegation=False,
|
96 |
max_iter=5,
|
@@ -117,8 +119,9 @@ def kickoff_crew(topic: str) -> dict:
|
|
117 |
# Define Tasks
|
118 |
research_task = Task(
|
119 |
description=(
|
120 |
-
"
|
121 |
-
"
|
|
|
122 |
"Compile your findings into an initial draft, ensuring to include all sources with their titles and links relevant to the topic. "
|
123 |
"Throughout this process, maintain a high standard of accuracy and ensure that no information is fabricated or misrepresented."
|
124 |
),
|
@@ -137,7 +140,8 @@ def kickoff_crew(topic: str) -> dict:
|
|
137 |
"correct any discrepancies, and ensure that the information is current and well-supported by sources. "
|
138 |
"Enhance the readability of the report by improving language clarity, adjusting sentence structure, and ensuring consistency in tone. "
|
139 |
"Include a dedicated section that lists all sources used in the research_task. "
|
140 |
-
"Each source used in the analysis should be presented as a bullet point in the format:
|
|
|
141 |
"Ensure that all sources you include in the final report exist by scrapping them if necessary. "
|
142 |
"This section should be comprehensive, clearly formatted, and easy to navigate, providing full transparency on the references used."
|
143 |
),
|
@@ -153,7 +157,8 @@ def kickoff_crew(topic: str) -> dict:
|
|
153 |
# Forming the Crew
|
154 |
crew = Crew(
|
155 |
agents=[researcher, editor],
|
156 |
-
tasks=[research_task, edit_task]
|
|
|
157 |
)
|
158 |
|
159 |
# Kick-off the research process
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import cohere
|
4 |
+
from crewai import Agent, Task, Crew, Process
|
5 |
from langchain_groq import ChatGroq
|
6 |
from langchain_community.tools import DuckDuckGoSearchRun, DuckDuckGoSearchResults
|
7 |
from crewai_tools import tool, SeleniumScrapingTool, ScrapeWebsiteTool
|
|
|
91 |
"and piece of data gathered. Your research is thorough, ensuring that no stone is left unturned. "
|
92 |
"This dedication not only enhances the quality of the information but also ensures "
|
93 |
"reliability and trustworthiness in your findings."
|
94 |
+
"To achieve your objectives, think carefully about the {topic}, develop strategies to expand "
|
95 |
+
"and follows a step-by-step strategy to build conclusions."
|
96 |
),
|
97 |
allow_delegation=False,
|
98 |
max_iter=5,
|
|
|
119 |
# Define Tasks
|
120 |
research_task = Task(
|
121 |
description=(
|
122 |
+
"First, use DuckDuckGoResults tool to gather snippets from search results about ## {topic} ##. "
|
123 |
+
"If you need to expand the search on the ## {topic} ##, generate new search queries. "
|
124 |
+
"Then, use the WebScrapper tool to extract additional information and insights from all links or URLs that appear significant regarding {topic} after analyzing the snippets of the search results. "
|
125 |
"Compile your findings into an initial draft, ensuring to include all sources with their titles and links relevant to the topic. "
|
126 |
"Throughout this process, maintain a high standard of accuracy and ensure that no information is fabricated or misrepresented."
|
127 |
),
|
|
|
140 |
"correct any discrepancies, and ensure that the information is current and well-supported by sources. "
|
141 |
"Enhance the readability of the report by improving language clarity, adjusting sentence structure, and ensuring consistency in tone. "
|
142 |
"Include a dedicated section that lists all sources used in the research_task. "
|
143 |
+
"Each source used in the analysis should be presented as a bullet point in the follwint format: "
|
144 |
+
"- title: link "
|
145 |
"Ensure that all sources you include in the final report exist by scrapping them if necessary. "
|
146 |
"This section should be comprehensive, clearly formatted, and easy to navigate, providing full transparency on the references used."
|
147 |
),
|
|
|
157 |
# Forming the Crew
|
158 |
crew = Crew(
|
159 |
agents=[researcher, editor],
|
160 |
+
tasks=[research_task, edit_task],
|
161 |
+
process=Process.sequential,
|
162 |
)
|
163 |
|
164 |
# Kick-off the research process
|