Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ co = cohere.Client(cohere_api_key)
|
|
28 |
|
29 |
# Define the DuckDuckGoSearch tool
|
30 |
@tool('DuckDuckGoResults')
|
31 |
-
def search_results(search_query: str)
|
32 |
"""
|
33 |
Performs a web search using the DuckDuckGo search engine to gather and return a collection of search results.
|
34 |
This tool automates the retrieval of web-based information related to a specified query.
|
@@ -47,7 +47,7 @@ def search_results(search_query: str): -> dict
|
|
47 |
return DuckDuckGoSearchResults(max_results=3).run(search_query)
|
48 |
|
49 |
@tool('WebScrapper')
|
50 |
-
def web_scrapper(url: str, topic: str)
|
51 |
"""
|
52 |
A tool designed to extract and read the content of a specified link and generate a summary on a specific topic.
|
53 |
It is capable of handling various types of web pages by making HTTP requests and parsing the received HTML content.
|
@@ -101,9 +101,9 @@ def kickoff_crew(topic: str) -> dict:
|
|
101 |
# Define Agents with Groq LLM
|
102 |
researcher = Agent(
|
103 |
role='Researcher',
|
104 |
-
goal='Collect detailed information on topic ## {topic} ##',
|
105 |
tools=[search_results, web_scrapper],
|
106 |
-
llm=selected_llm, # Assigning the
|
107 |
backstory=(
|
108 |
"You are a meticulous researcher, skilled at navigating vast amounts of information to extract essential insights on any given topic. "
|
109 |
"Your dedication to detail ensures the reliability and thoroughness of your findings. "
|
@@ -111,22 +111,22 @@ def kickoff_crew(topic: str) -> dict:
|
|
111 |
),
|
112 |
allow_delegation=False,
|
113 |
max_iter=5,
|
114 |
-
verbose=True
|
115 |
)
|
116 |
|
117 |
|
118 |
editor = Agent(
|
119 |
role='Editor',
|
120 |
goal='Compile and refine the information into a comprehensive report on topic ## {topic} ##',
|
121 |
-
llm=selected_llm, # Assigning the
|
122 |
backstory=(
|
123 |
"As an expert editor, you specialize in transforming raw data into clear, engaging reports. "
|
124 |
"Your strong command of language and attention to detail ensure that each report not only conveys essential insights "
|
125 |
"but is also easily understandable and appealing to diverse audiences. "
|
126 |
),
|
127 |
allow_delegation=False,
|
128 |
-
max_iter=
|
129 |
-
verbose=True
|
130 |
)
|
131 |
|
132 |
# Define Tasks
|
|
|
28 |
|
29 |
# Define the DuckDuckGoSearch tool
|
30 |
@tool('DuckDuckGoResults')
|
31 |
+
def search_results(search_query: str) -> dict:
|
32 |
"""
|
33 |
Performs a web search using the DuckDuckGo search engine to gather and return a collection of search results.
|
34 |
This tool automates the retrieval of web-based information related to a specified query.
|
|
|
47 |
return DuckDuckGoSearchResults(max_results=3).run(search_query)
|
48 |
|
49 |
@tool('WebScrapper')
|
50 |
+
def web_scrapper(url: str, topic: str) -> str:
|
51 |
"""
|
52 |
A tool designed to extract and read the content of a specified link and generate a summary on a specific topic.
|
53 |
It is capable of handling various types of web pages by making HTTP requests and parsing the received HTML content.
|
|
|
101 |
# Define Agents with Groq LLM
|
102 |
researcher = Agent(
|
103 |
role='Researcher',
|
104 |
+
goal='Search and Collect detailed information on topic ## {topic} ##',
|
105 |
tools=[search_results, web_scrapper],
|
106 |
+
llm=selected_llm, # Assigning the LLM here
|
107 |
backstory=(
|
108 |
"You are a meticulous researcher, skilled at navigating vast amounts of information to extract essential insights on any given topic. "
|
109 |
"Your dedication to detail ensures the reliability and thoroughness of your findings. "
|
|
|
111 |
),
|
112 |
allow_delegation=False,
|
113 |
max_iter=5,
|
114 |
+
verbose=True
|
115 |
)
|
116 |
|
117 |
|
118 |
editor = Agent(
|
119 |
role='Editor',
|
120 |
goal='Compile and refine the information into a comprehensive report on topic ## {topic} ##',
|
121 |
+
llm=selected_llm, # Assigning the LLM here
|
122 |
backstory=(
|
123 |
"As an expert editor, you specialize in transforming raw data into clear, engaging reports. "
|
124 |
"Your strong command of language and attention to detail ensure that each report not only conveys essential insights "
|
125 |
"but is also easily understandable and appealing to diverse audiences. "
|
126 |
),
|
127 |
allow_delegation=False,
|
128 |
+
max_iter=2,
|
129 |
+
verbose=True
|
130 |
)
|
131 |
|
132 |
# Define Tasks
|