Bringing support to o1 family back + any models that don't support stop words

This commit is contained in:
João Moura
2024-09-24 22:18:20 -03:00
parent b8aa46a767
commit e19bdcb97d
104 changed files with 56051 additions and 65319 deletions

View File

@@ -227,7 +227,7 @@ def test_crew_creation():
result = crew.kickoff()
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."
expected_string_output = "**The Rise of Generalist AI Agents:**\nImagine a future where AI agents are no longer confined to specific tasks like data analytics or speech recognition. The evolution from specialized AI tools to versatile generalist AI agents is comparable to the leap from feature phones to smartphones. This shift heralds significant transformations across diverse industries, from healthcare and finance to customer service. It also raises fascinating ethical considerations around the deployment and control of such powerful technologies. Moreover, this transformation could democratize AI, making sophisticated tools accessible to non-experts and small businesses, thus leveling the playing field in many sectors.\n\n**Ethical Implications of AI in Surveillance:**\nThe advent of advanced AI has significantly boosted surveillance capabilities, presenting a double-edged sword. On one hand, enhanced surveillance can improve public safety and combat crime more effectively. On the other, it raises substantial ethical concerns about privacy invasion and the potential for misuse by authoritarian regimes. Balancing security with privacy is a delicate task, requiring robust legal frameworks and transparent policies. Real-world case studies, from smart city deployments to airport security systems, illustrate both the benefits and the risks of AI-enhanced surveillance, highlighting the need for ethical vigilance and public discourse.\n\n**AI in Creative Industries:**\nAI is breaking new ground in creative fields, transforming how art, music, and content are produced. Far from being mere tools, AI systems are emerging as collaborators, helping artists push the boundaries of creative expression. Noteworthy are AI-generated works that have captured public imagination, like paintings auctioned at prestigious houses or music albums composed by algorithms. The future holds exciting possibilities, as AI may enable novel art forms and interactive experiences previously unimaginable, fostering a symbiotic relationship between human creativity and machine intelligence.\n\n**The Impact of Quantum Computing on AI Development:**\nQuantum computing promises to be a game-changer for AI, offering unprecedented computational power to tackle complex problems. This revolution could significantly enhance AI algorithms, enabling faster and more efficient training and execution. The potential applications are vast, from optimizing supply chains to solving intricate scientific problems and advancing natural language processing. Looking ahead, quantum-enhanced AI might unlock new frontiers, such as real-time data analysis at scales previously thought impossible, pushing the limits of what we can achieve with AI technology.\n\n**AI and Mental Health:**\nThe integration of AI into mental health care is transforming diagnosis and therapy, offering new hope for those in need. AI-driven tools have shown promise in accurately diagnosing conditions and providing personalized treatment plans through data analysis and pattern recognition. Case studies highlight successful interventions where AI has aided mental health professionals, enhancing the effectiveness of traditional therapies. However, this advancement brings ethical concerns, particularly around data privacy and the transparency of AI decision-making processes. As AI continues to evolve, it could play an even more significant role in mental health care, providing early interventions and support on a scale previously unattainable."
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 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."
== "Here are the 5 interesting ideas along with a compelling paragraph for each that showcases how good an article on the topic could be:\n\n1. **The Evolution and Future of AI Agents in Everyday Life**:\nThe rapid development of AI agents from rudimentary virtual assistants like Siri and Alexa to today's sophisticated systems marks a significant technological leap. This article will explore the evolving landscape of AI agents, detailing their seamless integration into daily activities ranging from managing smart home devices to streamlining workflows. We will examine the multifaceted benefits these agents bring, such as increased efficiency and personalized user experiences, while also addressing ethical concerns like data privacy and algorithmic bias. Looking ahead, we will forecast the advancements slated for the next decade, including AI agents in personalized health coaching and automated legal consultancy. With more advanced machine learning algorithms, the potential for these AI systems to revolutionize our daily lives is immense.\n\n2. **AI in Healthcare: Revolutionizing Diagnostics and Treatment**:\nArtificial Intelligence is poised to revolutionize the healthcare sector by offering unprecedented improvements in diagnostic accuracy and personalized treatments. This article will delve into the transformative power of AI in healthcare, highlighting real-world applications like AI-driven imaging technologies that aid in early disease detection and predictive analytics that enable personalized patient care plans. We will discuss the ethical challenges, such as data privacy and the implications of AI-driven decision-making in medicine. Through compelling case studies, we will showcase successful AI implementations that have made significant impacts, ultimately painting a picture of a future where AI plays a central role in proactive and precise healthcare delivery.\n\n3. **The Role of AI in Enhancing Cybersecurity**:\nAs cyber threats become increasingly sophisticated, AI stands at the forefront of the battle against cybercrime. This article will discuss the crucial role AI plays in detecting and responding to threats in real-time, its capacity to predict and prevent potential attacks, and the inherent challenges of an AI-dependent cybersecurity framework. We will highlight recent advancements in AI-based security tools and provide case studies where AI has been instrumental in mitigating cyber threats effectively. By examining these elements, we'll underline the potential and limitations of AI in creating a more secure digital environment, showcasing how it can adapt to evolving threats faster than traditional methods.\n\n4. **The Intersection of AI and Autonomous Vehicles: Driving Towards a Safer Future**:\nThe prospect of AI-driven autonomous vehicles promises to redefine transportation. This article will explore the technological underpinnings of self-driving cars, their developmental milestones, and the hurdles they face, including regulatory and ethical challenges. We will discuss the profound implications for various industries and employment sectors, coupled with the benefits such as reduced traffic accidents, improved fuel efficiency, and enhanced mobility for people with disabilities. By detailing these aspects, the article will offer a comprehensive overview of how AI-powered autonomous vehicles are steering us towards a safer, more efficient future.\n\n5. **AI and the Future of Work: Embracing Change in the Workplace**:\nAI is transforming the workplace by automating mundane tasks, enabling advanced data analysis, and fostering creativity and strategic decision-making. This article will explore the profound impact of AI on the job market, addressing concerns about job displacement and the evolution of new roles that demand reskilling. We will provide insights into the necessity for upskilling to keep pace with an AI-driven economy. Through interviews with industry experts and narratives from workers who have experienced AI's impact firsthand, we will present a balanced perspective. The aim is to paint a future where humans and AI work in synergy, driving innovation and productivity in a continuously evolving workplace landscape."
)
@@ -401,7 +401,7 @@ def test_crew_with_delegating_agents():
assert (
result.raw
== "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."
== "This is the complete content as specified:\nArtificial Intelligence (AI) Agents are sophisticated computer programs designed to perform tasks that typically require human intelligence, such as decision making, problem-solving, and learning. These agents operate autonomously, utilizing vast amounts of data, advanced algorithms, and machine learning techniques to analyze their environment, adapt to new information, and improve their performance over time.\n\nThe significance of AI Agents lies in their transformative potential across various industries. In healthcare, for example, they assist in diagnosing diseases with greater accuracy and speed than human practitioners, offering personalized treatment plans by analyzing patient data. In finance, AI Agents predict market trends, manage risks, and even execute trades, contributing to more stable and profitable financial systems. Customer service sectors benefit significantly from AI Agents, as they provide personalized and efficient responses, often resolving issues faster than traditional methods.\n\nMoreover, AI Agents are also making substantial contributions in fields like education and manufacturing. In education, they offer tailored learning experiences by assessing individual student needs and adjusting teaching methods accordingly. They help educators identify students who might need additional support and provide resources to enhance learning outcomes. In manufacturing, AI Agents optimize production lines, predict equipment failures, and improve supply chain management, thus boosting productivity and reducing downtime.\n\nAs these AI-powered entities continue to evolve, they are not only enhancing operational efficiencies but also driving innovation and creating new opportunities for growth and development in every sector they penetrate. The future of AI Agents looks promising, with the potential to revolutionize the way we live and work, making processes more efficient, decisions more data-driven, and solutions more innovative than ever before."
)
@@ -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 a fascinating journey marked by pioneering breakthroughs and revolutionary innovations."
"The history of artificial intelligence (AI) is marked by several pivotal events that have shaped the field into what it is today."
)
@@ -640,7 +640,7 @@ def test_single_task_with_async_execution():
result = crew.kickoff()
assert result.raw.startswith(
"- AI in healthcare: Revolutionizing diagnostics and personalized treatment."
"- Ethical implications of AI in law enforcement and surveillance."
)
@@ -1164,7 +1164,7 @@ def test_task_with_no_arguments():
crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff()
assert result.raw == "75"
assert result.raw == "The total number of sales is 75."
def test_code_execution_flag_adds_code_tool_upon_kickoff():
@@ -1274,9 +1274,9 @@ def test_agent_usage_metrics_are_captured_for_hierarchical_process():
assert result.raw == "Howdy!"
assert result.token_usage == UsageMetrics(
total_tokens=2701,
prompt_tokens=2550,
completion_tokens=151,
total_tokens=2626,
prompt_tokens=2482,
completion_tokens=144,
successful_requests=5,
)
@@ -2375,7 +2375,7 @@ def test_conditional_task_last_task_when_conditional_is_true():
)
result = crew.kickoff()
assert result.raw.startswith(
"1. **The Role of AI Agents in Revolutionizing Customer Service**"
"Hi\n\nHere are five interesting ideas for articles focused on AI and AI agents, each accompanied by a compelling paragraph to showcase the potential impact and depth of each topic:"
)