Spaces:
Build error
Build error
Download agents/report_generator_agent.py from Samagra07/KnowledgeKeeper: direct link, hf CLI and curl.
- Browser
- Download file 825 Bytes
-
https://huggingface.co/spaces/Samagra07/KnowledgeKeeper/resolve/main/agents/report_generator_agent.py
- Command line
-
hf download hf://spaces/Samagra07/KnowledgeKeeper/agents/report_generator_agent.py
-
curl -L -o report_generator_agent.py https://huggingface.co/spaces/Samagra07/KnowledgeKeeper/resolve/main/agents/report_generator_agent.py
825 Bytes
| from crewai import Agent, Task | |
| class ReportGeneratorAgent(Agent): | |
| def __init__(self, llm): | |
| super().__init__( | |
| llm=llm, | |
| role="report generator", | |
| backstory="I generate a final comprehensive report without a bias", | |
| goal="Create a detailed report summarizing the research findings." | |
| ) | |
| def execute_task(self, task: Task, context: dict = None, tools: list = None): | |
| """Generate a comprehensive report.""" | |
| summaries = context | |
| report = self.generate_report(summaries) | |
| return report | |
| def generate_report(self, summaries): | |
| """Generate a comprehensive research report.""" | |
| return self.llm.call([ | |
| {"role": "user", "content": summaries} | |
| ]) |