updating tests

This commit is contained in:
João Moura
2024-09-23 17:45:20 -03:00
parent 493f046c03
commit 2d54b096af
96 changed files with 65055 additions and 30874 deletions

View File

@@ -227,7 +227,7 @@ def test_crew_creation():
result = crew.kickoff()
expected_string_output = "**1. The Rise of Autonomous AI Agents in the Business Sector**\n\nThe business sector is experiencing a radical transformation with the rise of autonomous AI agents taking on roles traditionally filled by human employees. These intelligent systems are revolutionizing customer service, sales, and administrative tasks by offering unmatched efficiency and cost savings. Yet, this shift brings forward ethical and practical challenges that need careful navigation. Companies like IPsoft have pioneered the deployment of AI agents, demonstrating both the immense potential and the hurdles encountered. By automating routine tasks, businesses can reallocate human talent towards more strategic initiatives, driving innovation while maintaining operational excellence.\n\n**2. AI and Creativity: Can Machines Be Truly Creative?**\n\nThe debate over whether machines can truly be creative is gaining momentum as AI algorithms begin to compose music, create visual art, and author literature. This exploration into AI's creative potential raises profound questions about the nature of creativity and consciousness. AI systems like OpenAI's GPT-3 have crafted compelling narratives and artistic expressions, showcasing glimpses of what the future holds for the fusion of technology and creativity. Highlighting such AI-generated works provides a tantalizing view into a future where humans and machines could collaborate in groundbreaking artistic ventures, reshaping our understanding of creativity itself.\n\n**3. Ethical AI: Navigating the Moral Landscape of Artificial Intelligence**\n\nAs AI technologies advance, the need for ethical considerations becomes increasingly critical. This topic delves into the frameworks and guidelines being developed to ensure that AI systems align with human values and morals. The ethical landscape of AI intersects with various fields including law, philosophy, and social justice, prompting a multidisciplinary approach to responsible AI development. Featuring insights from AI ethicists, policymakers, and technologists, the article explores the balance between innovation and ethical responsibility. By navigating these moral complexities, society can harness the benefits of AI while mitigating potential risks and ensuring equitable outcomes.\n\n**4. AI in Healthcare: Transforming Diagnosis and Treatment**\n\nAI is on the brink of revolutionizing healthcare, offering transformative changes in diagnosis and treatment. From predictive diagnostics to personalized treatment plans, and even robotic surgery, AI technologies are improving patient outcomes and reducing healthcare costs. Virtual health assistants powered by AI are broadening access to care, making healthcare more inclusive and efficient. Real-world examples, such as IBM Watson's ability to diagnose complex medical conditions, underscore the profound impact AI can have in the medical field. By examining these advancements, the article provides a comprehensive look at how AI is poised to redefine the future of healthcare.\n\n**5. AI and Cybersecurity: The Arms Race of the Future**\n\nIn the ever-evolving world of cybersecurity, AI is emerging as both a potent defender and a formidable adversary. AI technologies are now capable of identifying and responding to threats in real-time, offering robust protection against cyber-attacks. However, malicious actors are also harnessing AI to launch more sophisticated and stealthy attacks, leading to an ongoing arms race in the digital landscape. The relevance of this topic is underscored by the multitude of high-profile security breaches, driving public and private sectors to invest heavily in AI-driven cybersecurity measures. Through expert insights and case studies, this article will explore the capabilities of AI in safeguarding sensitive data and anticipating future threats, painting a vivid picture of the cybersecurity landscape of tomorrow."
expected_string_output = "1. **AI in Healthcare Diagnostics**\n\nIn the realm of healthcare, AI is paving the way for groundbreaking advancements in diagnostic processes. By leveraging sophisticated deep learning algorithms, AI can analyze medical imaging and patient data with unprecedented accuracy, offering a transformative approach to identifying diseases early on. This innovative use of AI significantly reduces the margin of diagnostic errors and expedites the diagnosis process. For instance, conditions such as cancer or neurological disorders, which necessitate rapid and accurate detection for effective treatment, can be diagnosed much earlier and more accurately with AI, potentially transforming patient outcomes and elevating the standard of care.\n\n2. **Autonomous Agents in Financial Trading**\n\nThe financial trading industry is witnessing a revolutionary shift with the introduction of AI-powered autonomous agents. These advanced systems are designed to analyze market trends, execute trades, and manage investment portfolios in real-time without the need for human intervention. By processing vast amounts of financial data at speeds unattainable by humans, these AI agents can identify patterns, predict market movements, and make informed trading decisions that maximize returns and minimize risks. This technological leap not only enhances the efficiency of financial markets but also democratizes access to sophisticated trading strategies, leveling the playing field for individual investors.\n\n3. **AI-Powered Personal Assistants Beyond Siri and Alexa**\n\nAI personal assistants are evolving beyond simple voice commands to become indispensable parts of our daily lives, offering tailored, context-aware recommendations and handling complex tasks. Imagine a personal assistant that not only manages your schedule but also understands your preferences to make personalized online shopping suggestions or provides emotional support during stressful times. These advancements signify a deeper integration of AI into our routines, enhancing productivity and revolutionizing how we interact with technology. The potential impact on personal digital management is immense, promising a future where AI seamlessly assists in various aspects of life, from mundane chores to emotional well-being.\n\n4. **Ethical Implications of AI in Surveillance**\n\nAs AI technology advances, its application in surveillance raises critical ethical concerns. AI-driven tools like facial recognition and predictive policing can significantly enhance security measures but also pose substantial risks to privacy and civil liberties. The deployment of such technologies necessitates a careful balance between security and the protection of individual rights, as well as fostering societal trust. This tension between technological capabilities and ethical standards underscores the need for ongoing dialogue and robust regulatory frameworks to ensure that the benefits of AI-driven surveillance do not come at the expense of fundamental freedoms and societal trust.\n\n5. **AI and Creativity: From Art to Music**\n\nAI is not just a tool for analytical tasks; it is also making waves in the creative industries by producing original artworks, music compositions, and literary pieces. This fascinating blend of technology and creativity raises profound questions about the nature of creativity and the role of human artists in an era where machines can autonomously generate culturally significant works. AI's ability to mimic and innovate upon human creativity challenges traditional notions of authorship and artistic value, pushing the boundaries of what technology can achieve and offering fresh perspectives on the future of creative expression. The implications for the arts, as well as the cultural industries reliant on human creativity, are profound, suggesting a future where collaboration between humans and AI could lead to unprecedented creative heights."
assert str(result) == expected_string_output
assert result.raw == expected_string_output
@@ -295,7 +295,7 @@ def test_hierarchical_process():
assert (
result.raw
== "1. **The Rise of AI in Healthcare: Transformations and Challenges**\n The advent of artificial intelligence is profoundly transforming the healthcare landscape, ushering in a new era of diagnostics and personalized treatment plans. AI is not only enhancing the accuracy and speed of diagnostics through advanced medical imaging and predictive analytics but also empowering physicians to devise highly tailored treatment plans based on individual patient data. Despite these substantial benefits, the integration of AI into healthcare systems is not without its challenges, including issues related to data privacy, the need for substantial infrastructural changes, and the necessity of re-skilling healthcare professionals to work alongside AI technologies. As we navigate these transformations, it is crucial to address these challenges comprehensively to fully harness the potential of AI in improving patient outcomes.\n\n2. **From Chatbots to Autonomous Agents: The Evolution of AI-driven Customer Service**\n Customer service has undergone a significant evolution with the advent of AI, transitioning from basic chatbots to sophisticated autonomous agents. Early chatbots provided rudimentary assistance, often limited to scripted responses. However, the advent of advanced natural language processing and machine learning algorithms has birthed autonomous agents capable of understanding context, generating human-like responses, and even predicting customer needs. These intelligent agents are now handling complex customer inquiries, providing personalized interactions, and operating across multiple channels seamlessly. Companies deploying these technologies are witnessing increased customer satisfaction and operational efficiency, marking a pivotal shift in the realm of customer service.\n\n3. **AI for Good: How Artificial Intelligence is Addressing Global Challenges**\n Artificial intelligence is increasingly becoming a powerful tool in addressing some of the world's most pressing challenges, from climate change and poverty to healthcare disparities. One transformative example is AIs capability to analyze vast datasets to predict natural disasters, enabling timely interventions and life-saving measures. Projects like AI-driven agricultural systems are optimizing crop yields to combat hunger, while intelligent algorithms are being used to identify and bridge gaps in healthcare delivery in underserved regions. Through these innovative applications, AI is not just a technological advancement but a catalyst for global good, proving that technology can indeed play a pivotal role in solving critical human issues.\n\n4. **The Future of Work: AI and its Implications on Employment and Skillsets**\n As artificial intelligence continues to develop, its implications on the job market are profound and multifaceted. AI is automating routine and repetitive tasks, prompting a shift towards jobs that require more complex problem-solving, creativity, and emotional intelligence. This evolution is creating an imperative for a new set of skills, including proficiency in AI tools, data analysis, and adaptability to new technologies. The role of education and policy cannot be overstated in this transition, as they must adapt to prepare the workforce for these emerging requirements. Lifelong learning and reskilling are becoming essential as AI redefines existing job roles and creates entirely new ones.\n\n5. **Ethical AI: Navigating the Principles and Practices of Responsible AI Development**\n The development and deployment of artificial intelligence bring a suite of ethical considerations that are critical to its responsible use. Foundational principles such as fairness, accountability, and transparency must guide AI development to prevent biases and ensure equitable outcomes. For instance, algorithmic transparency is crucial to understanding and mitigating biases that may arise from training data. Furthermore, accountability measures are necessary to address the impacts of AI decisions, particularly in high-stakes areas like criminal justice and employment. Current guidelines and case studies highlight the importance of these ethical frameworks, urging developers and policymakers to adopt practices that promote responsible AI usage, thereby fostering public trust and maximizing societal benefits."
== "1. **The Rise of Autonomous AI Agents: Transforming Industries and Everyday Life**\n - Autonomous AI agents are revolutionizing the landscape of various industries, from healthcare to logistics, by making independent decisions that enhance efficiency and accuracy. In healthcare, these agents can diagnose diseases with remarkable precision, while in finance, they're optimizing trading strategies and risk management in real-time. Customer service has seen a transformation with AI agents offering 24/7 support, significantly improving user satisfaction. Despite their numerous advantages, the deployment of autonomous AI comes with challenges such as ethical considerations, the need for transparency, and mitigating biases in decision-making algorithms. As the technology evolves, understanding how these agents function and their potential to reshape our everyday life is becoming increasingly crucial, sparking widespread curiosity and debate.\n\n2. **Ethical Considerations in AI Development: Balancing Innovation and Responsibility**\n - The rapid advancement of AI brings forth critical ethical considerations that need to be addressed to ensure responsible development. Issues like algorithmic bias, privacy violations, and the displacement of jobs present significant challenges. However, many companies and researchers are pioneering efforts to tackle these ethical dilemmas. For instance, some are developing frameworks for bias detection and mitigation, while others are advocating for stronger data privacy regulations. The ongoing discourse around balancing innovation with responsibility is not only relevant but essential, as it shapes the future trajectory of AI in our society. This article will provide a deep dive into these ethical challenges and highlight exemplary initiatives, making it a compelling read for developers, policymakers, and concerned citizens alike.\n\n3. **AI in Creative Fields: Revolutionizing Art, Music, and Writing**\n - AI has made significant inroads in creative fields, sparking a new era of artistic expression and collaboration. From AI-generated paintings that fetch high prices at auctions to algorithms composing symphonies and writing novels, the intersection of creativity and technology is pushing boundaries. Renowned artists and musicians are now working alongside sophisticated AI systems, creating works that were previously unimaginable. These collaborations challenge our perceptions of creativity and originality, inviting debates about the role of human intuition versus machine learning. Highlighting these fascinating stories of innovation, this article will captivate readers who are intrigued by the limitless potential of AI to inspire and transform the arts.\n\n4. **AI-Powered Personal Assistants: The Next Generation of Smart Living**\n - AI-powered personal assistants such as Google Assistant, Alexa, and Siri are at the forefront of the next generation of smart living, becoming more intuitive and context-aware by the day. These assistants are no longer just about setting reminders or playing music; they are evolving to understand and anticipate our needs, manage complex tasks, and even provide personalized recommendations. They are seamlessly integrating into various aspects of daily life, from home automation to health management. This article will explore the latest advancements and future directions of AI-powered personal assistants, offering readers an insight into how these innovations are shaping a smarter, more connected world.\n\n5. **The Future of Work: How AI and Automation are Reshaping the Job Market**\n - The advent of AI and automation is fundamentally altering the job market, raising both opportunities and concerns. While certain repetitive and mundane jobs are at risk of being automated, new industries and job categories are emerging, requiring skills in AI management and oversight. Educational institutions and individuals are actively adapting by developing curricula and acquiring skills that align with these technological advancements. This article will provide a comprehensive analysis of the job roles most susceptible to automation and those that are emerging as a result of AI. It will also delve into how various sectors are preparing for this transition, making it a vital read for anyone concerned about navigating career futures in an AI-driven world."
)
@@ -401,7 +401,7 @@ def test_crew_with_delegating_agents():
assert (
result.raw
== "In today's rapidly evolving technological landscape, AI agents stand at the forefront of innovation, reshaping industries with their unparalleled capabilities. These intelligent systems, capable of performing complex tasks autonomously, are revolutionizing a myriad of sectors—from healthcare, where they assist in diagnosing and personalizing treatment plans, to finance, where they enhance trading strategies and fraud detection. The significance of AI agents lies in their ability to learn and adapt, continuously improving their performance through advanced machine learning algorithms. As businesses strive for optimization and efficiency, AI agents emerge as indispensable allies, driving progress and heralding a new era of intelligent automation."
== "1. **Introduction**\nAI Agents, often referred to as autonomous agents, are sophisticated software programs capable of performing tasks and making decisions independently. By leveraging advanced algorithms and vast datasets, these agents can analyze complex information and execute actions with minimal human intervention. The significance of AI Agents lies in their ability to optimize operations, provide personalized recommendations, and enhance decision-making processes across various industries.\n\n2. **Applications and Impact**\nFrom managing customer service inquiries through chatbots to optimizing supply chain logistics and even assisting in medical diagnostics, the potential applications of AI Agents are vast and transformative. In the financial sector, for instance, AI Agents can predict market trends and provide investment advice, while in healthcare, they can analyze patient data to support early diagnosis and treatment plans. The integration of AI Agents in various fields not only improves efficiency but also opens up new opportunities for innovation and growth.\n\n3. **Challenges and Ethical Considerations**\nDespite their numerous advantages, the deployment of AI Agents is not without challenges. Issues such as data privacy, algorithmic biases, and the potential for job displacement raise significant ethical and societal questions. Ensuring that AI Agents operate transparently and fairly requires robust regulatory frameworks and continuous monitoring. Additionally, as AI Agents increasingly participate in decision-making processes, it is crucial to maintain a balance between automation and human oversight to prevent unintended consequences.\n\n4. **Future Prospects**\nAs technology advances, the capabilities of AI Agents are expected to grow exponentially. Future developments may include more sophisticated natural language processing, enhanced emotional intelligence, and greater adaptability to diverse environments. These advancements could enable AI Agents to perform more complex tasks, such as creative problem-solving and strategic planning. Ultimately, the evolution of AI Agents will have a profound impact on various aspects of our lives, driving progress and innovation while reshaping the future of work and human interaction with technology."
)
@@ -612,7 +612,7 @@ def test_sequential_async_task_execution_completion():
sequential_result = sequential_crew.kickoff()
assert sequential_result.raw.startswith(
"The history of artificial intelligence (AI) is marked by a series of pivotal events that have shaped its progress and applications across diverse sectors."
"The history of Artificial Intelligence (AI) is a fascinating journey marked by pioneering breakthroughs and revolutionary innovations."
)
@@ -639,7 +639,9 @@ def test_single_task_with_async_execution():
)
result = crew.kickoff()
assert result.raw.startswith("- The rise of AI in healthcare diagnostics.")
assert result.raw.startswith(
"- AI in healthcare: Revolutionizing diagnostics and personalized treatment."
)
@pytest.mark.vcr(filter_headers=["authorization"])
@@ -1162,7 +1164,7 @@ def test_task_with_no_arguments():
crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff()
assert result.raw == "The total number of sales is 75."
assert result.raw == "75"
def test_code_execution_flag_adds_code_tool_upon_kickoff():
@@ -1272,9 +1274,9 @@ def test_agent_usage_metrics_are_captured_for_hierarchical_process():
assert result.raw == "Howdy!"
assert result.token_usage == UsageMetrics(
total_tokens=2634,
prompt_tokens=2492,
completion_tokens=142,
total_tokens=2701,
prompt_tokens=2550,
completion_tokens=151,
successful_requests=5,
)
@@ -2373,7 +2375,7 @@ def test_conditional_task_last_task_when_conditional_is_true():
)
result = crew.kickoff()
assert result.raw.startswith(
"1. **The Rise of AI Agents in Customer Service: Enhancing User Experience Through Intelligent Automation**"
"1. **The Role of AI Agents in Revolutionizing Customer Service**"
)