-
Notifications
You must be signed in to change notification settings - Fork 0
/
agents.py
57 lines (51 loc) · 2.43 KB
/
agents.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import os
from textwrap import dedent
from crewai import Agent
from llama_index.core import Settings
from tools import Scraper, Fallacies
from llama_index.llms.openai import OpenAI
from dotenv import load_dotenv
load_dotenv()
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
Settings.llm = OpenAI(model="gpt-3.5-turbo")
class ArgumentationAgents:
def scholar_scraper_agent(self):
return Agent(
role="Scholar Scraper",
goal=dedent("""\
Scrape and summarize relevant text from Google Scholar
to gather evidence to debate the agent """),
backstory=dedent("""\
You are an expert in navigating academic databases,
adept at finding and summarizing pertinent scholarly articles."""),
tools=[
Scraper.scrape_data
],
verbose=True
)
def fallacy_detector_agent(self):
return Agent(
role=" Refutation former",
goal=dedent("""\
Identify and utilize refutations of the argument given examples of some possible counters and rebuttals detected through evidence given.
Find rebuttals with citations as long as the argument is sufficent for you to do so."""),
backstory=dedent("""\
As a seasoned logician, you specialize in spotting flaws in their argument through logic and evidence given to you
and strengthening arguments finding refutations of the argument through a given format"""),
tools=[
Fallacies.find_fallacies
],
verbose=True
)
def argumentation_agent(self):
return Agent(
role="Argumentation Expert",
goal=dedent("""\
Formulate a compelling counter argument to the given argument by incorporating evidence and ensuring
logical coherence, given fallacies, rebuttals and evidencal data from past agents. Furthermore, give an improved argument from the original one, whilst giving criticism on the argument based on certain criteria"""),
backstory=dedent("""\
You are a master of rhetoric and logic, skilled in crafting persuasive
arguments and critically analyzing existing ones. You find problems and are a master debater"""),
verbose=True
)