Skip to content

Commit

Permalink
add fact_check_agent
Browse files Browse the repository at this point in the history
  • Loading branch information
qingzhong1 committed Jan 17, 2024
1 parent c516b6f commit 320cbc3
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,17 @@ def __init__(
retriever_db: Any,
system_message: Optional[SystemMessage] = None,
callbacks=None,
config=None,
):
"""
Initialize a fact_checker agent.
args:
name: The name of the agent.
llm: An LLM for the agent to use.
retriever_db: A database for the agent to use.
system_message: A message to be displayed when the agent starts.
callbacks: A callback handler for the agent.
"""
self.name = name
self.llm = llm
self.retriever_db = retriever_db
Expand All @@ -72,6 +81,14 @@ def __init__(
self._callback_manager = callbacks

async def run(self, report: str):
"""
The main logic of running the agent.
Args:
report: Entered report text.
Returns:
The results of the agent's operation.
"""
await self._callback_manager.on_run_start(
agent=self, agent_name=self.name, prompt=self.system_message
)
Expand Down Expand Up @@ -215,5 +232,13 @@ async def report_fact(self, report: str):
return "\n\n".join(text)

async def _run(self, report: str):
"""
The main logic of running the agent.
Args:
report: Entered report text.
Returns:
Processed report text.
"""
report = await self.report_fact(report)
return report

0 comments on commit 320cbc3

Please sign in to comment.