diff --git a/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py b/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py index 94c5cebe..5b2047ab 100644 --- a/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py +++ b/erniebot-agent/applications/erniebot_researcher/fact_check_agent.py @@ -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 @@ -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 ) @@ -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