Spaces:
Build error
Build error
| from crewai import Task | |
| from textwrap import dedent | |
| class ContentTasks: | |
| def planner_task(self, agent, topic): | |
| return Task( | |
| description=dedent(f""" | |
| 1. Identify the latest trends, key players, and noteworthy news on {topic}. | |
| 2. Develop a detailed content outline for a blog post that includes the following sections: | |
| - Introduction: Brief overview of the topic. | |
| - Definition: Explanation of key terms and concepts. | |
| - Applications: Real-world use cases and benefits of the technology. | |
| - Model Architecture (if applicable): Explanation of the underlying models and their structure. | |
| - How It Works: Step-by-step description of the technology's functioning. | |
| - Ethical Considerations: Discussion of any ethical implications. | |
| - Conclusion: Summarizing insights and future prospects. | |
| - References: List of sources and further reading. | |
| 3. Identify the target audience, considering their interests and pain points. | |
| 4. Include SEO keywords and relevant data or sources. | |
| 5. Suggest images that would be relevant to include in the article. | |
| """), | |
| expected_output=dedent(f""" | |
| A comprehensive content plan document formatted as markdown with: | |
| - An outline | |
| - Audience analysis | |
| - SEO keywords | |
| - Image suggestions | |
| - References and resources. | |
| """), | |
| agent=agent | |
| ) | |
| def researcher_task(self, agent, topic): | |
| return Task( | |
| description=dedent(f""" | |
| 1. Research the latest and accurate trends on the topic {topic}. | |
| 2. Provide detailed knowledge, including: | |
| - Definitions and explanations of key concepts. | |
| - Examples of applications in various industries. | |
| - Explanation of any relevant model architectures. | |
| - Detailed description of how the technology works. | |
| - Discussion of ethical considerations (if any). | |
| - Sources and references for all information provided. | |
| 3. Search for open-source images related to the topic, providing links, descriptions, and attributions. | |
| 4. Ensure all information is accurate, non-controversial, and free from harmful content. | |
| """), | |
| expected_output=dedent(f""" | |
| A markdown document containing: | |
| - Detailed research on the topic, including all required sections. | |
| - A list of relevant images with descriptions and attributions. | |
| - References for all sources used. | |
| """), | |
| agent=agent | |
| ) | |
| def writer_task(self, agent, topic): | |
| return Task( | |
| description=dedent(f""" | |
| 1. Using the content plan and research, write a well-structured blog post on {topic}, including the following sections: | |
| - Introduction: Provide a brief overview and context of the topic. | |
| - Definition: Explain key terms and concepts related to the topic. | |
| - Applications: Discuss real-world use cases and benefits of the technology. | |
| - Model Architecture (if applicable): Describe the structure and workings of any relevant models. | |
| - How It Works: Provide a step-by-step explanation of the technology's functionality. | |
| - Ethical Considerations: Discuss any ethical implications or concerns. | |
| - Conclusion: Summarize the key points and suggest future prospects. | |
| - References: Include a list of all sources cited in the post. | |
| 2. Integrate SEO keywords naturally within the content. | |
| 3. Create engaging section titles and subtitles. | |
| 4. Use images at relevant parts of the article, ensuring proper attribution. | |
| 5. Proofread for grammatical accuracy and alignment with the brand's voice. | |
| 6. Ensure all references and image attributions are correctly cited at the end of the post. | |
| """), | |
| expected_output=dedent(f""" | |
| A complete and polished blog post in markdown format, including: | |
| - Introduction | |
| - Definition | |
| - Applications | |
| - Model Architecture (if applicable) | |
| - How It Works | |
| - Ethical Considerations | |
| - Conclusion | |
| - References | |
| - Properly attributed images embedded in relevant sections. | |
| """), | |
| agent=agent | |
| ) |