-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtasks.py
25 lines (23 loc) · 1.35 KB
/
tasks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from crewai import Task
from langchain_community.tools.tavily_search import TavilySearchResults
from tools.website_search_tool import website_search
from tools.pdf_search_tool import PDF_search
class Law_Tasks():
def website_search_task(self,agent,query):
return Task(
description = 'Find answer to query if possible. If answer is I do not know stop and move on to next task. Do not hallucinate. Query is as follows, {query}',
expected_output = 'An answer to the question which is taken from the data provided',
agent = agent
)
def web_search_task(self,agent,query):
return Task(
description = 'Find answer to query asked. Query is as follows, {query}',
expected_output = 'An answer to the question in 2 to 3 lines if found and a list of the urls from where the content was taken from. Do not reuse the same input, just give the answer directly',
agent = agent,
)
def pdf_search_task(self,agent,query):
return Task(
description = 'Find answer to query by using the tool and searching for answer in the given content. Query is as follows, {query}. Give the source of the answer as well',
expected_output = 'An answer to the question in 2 to 3 lines.',
agent = agent
)