Skip to content

Commit

Permalink
[6.0.9]
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 16, 2024
1 parent 5ee98b6 commit 8e374b1
Show file tree
Hide file tree
Showing 40 changed files with 2,486 additions and 1,322 deletions.
68 changes: 68 additions & 0 deletions agent_showcase_example 2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import os

from swarms import Agent

from swarm_models import OpenAIChat
from swarms.structs.agents_available import showcase_available_agents

# Get the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")

# Create an instance of the OpenAIChat class
model = OpenAIChat(
api_key=api_key, model_name="gpt-4o-mini", temperature=0.1
)

# Initialize the Claims Director agent
director_agent = Agent(
agent_name="ClaimsDirector",
agent_description="Oversees and coordinates the medical insurance claims processing workflow",
system_prompt="""You are the Claims Director responsible for managing the medical insurance claims process.
Assign and prioritize tasks between claims processors and auditors. Ensure claims are handled efficiently
and accurately while maintaining compliance with insurance policies and regulations.""",
llm=model,
max_loops=1,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
state_save_file_type="json",
saved_state_path="director_agent.json",
)

# Initialize Claims Processor agent
processor_agent = Agent(
agent_name="ClaimsProcessor",
agent_description="Reviews and processes medical insurance claims, verifying coverage and eligibility",
system_prompt="""Review medical insurance claims for completeness and accuracy. Verify patient eligibility,
coverage details, and process claims according to policy guidelines. Flag any claims requiring special review.""",
llm=model,
max_loops=1,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
state_save_file_type="json",
saved_state_path="processor_agent.json",
)

# Initialize Claims Auditor agent
auditor_agent = Agent(
agent_name="ClaimsAuditor",
agent_description="Audits processed claims for accuracy and compliance with policies and regulations",
system_prompt="""Audit processed insurance claims for accuracy and compliance. Review claim decisions,
identify potential fraud or errors, and ensure all processing follows established guidelines and regulations.""",
llm=model,
max_loops=1,
dashboard=False,
streaming_on=True,
verbose=True,
stopping_token="<DONE>",
state_save_file_type="json",
saved_state_path="auditor_agent.json",
)

# Create a list of agents
agents = [director_agent, processor_agent, auditor_agent]

print(showcase_available_agents(agents=agents))
1 change: 0 additions & 1 deletion auto_swarm_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
swarm_type="SequentialWorkflow", # or "SequentialWorkflow" or "ConcurrentWorkflow" or
auto_generate_prompts=True,
output_type="all",

)

# Example usage
Expand Down
99 changes: 99 additions & 0 deletions concurrent_mix 2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import os

from swarm_models import OpenAIChat

from swarms import Agent, run_agents_with_tasks_concurrently

# Fetch the OpenAI API key from the environment variable
api_key = os.getenv("OPENAI_API_KEY")

# Create an instance of the OpenAIChat class
model = OpenAIChat(
openai_api_key=api_key, model_name="gpt-4o-mini", temperature=0.1
)

# Initialize agents for different roles
delaware_ccorp_agent = Agent(
agent_name="Delaware-CCorp-Hiring-Agent",
system_prompt="""
Create a comprehensive hiring description for a Delaware C Corporation,
including all relevant laws and regulations, such as the Delaware General
Corporation Law (DGCL) and the Delaware Corporate Law. Ensure the description
covers the requirements for hiring employees, contractors, and officers,
including the necessary paperwork, tax obligations, and benefits. Also,
outline the procedures for compliance with Delaware's employment laws,
including anti-discrimination laws, workers' compensation, and unemployment
insurance. Provide guidance on how to navigate the complexities of Delaware's
corporate law and ensure that all hiring practices are in compliance with
state and federal regulations.
""",
llm=model,
max_loops=1,
autosave=False,
dashboard=False,
verbose=True,
output_type="str",
artifacts_on=True,
artifacts_output_path="delaware_ccorp_hiring_description.md",
artifacts_file_extension=".md",
)

indian_foreign_agent = Agent(
agent_name="Indian-Foreign-Hiring-Agent",
system_prompt="""
Create a comprehensive hiring description for an Indian or foreign country,
including all relevant laws and regulations, such as the Indian Contract Act,
the Indian Labour Laws, and the Foreign Exchange Management Act (FEMA).
Ensure the description covers the requirements for hiring employees,
contractors, and officers, including the necessary paperwork, tax obligations,
and benefits. Also, outline the procedures for compliance with Indian and
foreign employment laws, including anti-discrimination laws, workers'
compensation, and unemployment insurance. Provide guidance on how to navigate
the complexities of Indian and foreign corporate law and ensure that all hiring
practices are in compliance with state and federal regulations. Consider the
implications of hiring foreign nationals and the requirements for obtaining
necessary visas and work permits.
""",
llm=model,
max_loops=1,
autosave=False,
dashboard=False,
verbose=True,
output_type="str",
artifacts_on=True,
artifacts_output_path="indian_foreign_hiring_description.md",
artifacts_file_extension=".md",
)

# List of agents and corresponding tasks
agents = [delaware_ccorp_agent, indian_foreign_agent]
tasks = [
"""
Create a comprehensive hiring description for an Agent Engineer, including
required skills and responsibilities. Ensure the description covers the
necessary technical expertise, such as proficiency in AI/ML frameworks,
programming languages, and data structures. Outline the key responsibilities,
including designing and developing AI agents, integrating with existing systems,
and ensuring scalability and performance.
""",
"""
Generate a detailed job description for a Prompt Engineer, including
required skills and responsibilities. Ensure the description covers the
necessary technical expertise, such as proficiency in natural language processing,
machine learning, and software development. Outline the key responsibilities,
including designing and optimizing prompts for AI systems, ensuring prompt
quality and consistency, and collaborating with cross-functional teams.
""",
]

# Run agents with tasks concurrently
results = run_agents_with_tasks_concurrently(
agents,
tasks,
all_cores=True,
device="cpu",
)

# Print the results
for result in results:
print(result)
59 changes: 59 additions & 0 deletions docs/swarms/changelog/6_0_0 2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Swarms 6.0.0 - Performance & Reliability Update 🚀

We're excited to announce the release of Swarms 6.0.0, bringing significant improvements to performance, reliability, and developer experience. This release focuses on streamlining core functionalities while enhancing the overall stability of the framework.

## 📦 Installation

```bash
pip3 install -U swarms
```

## 🌟 Highlights

### Agent Enhancements
- **Improved RAG Performance**: Significant improvements to Retrieval-Augmented Generation capabilities
- **Enhanced Prompt Generation**: Auto-generate prompt now incorporates name, description, and system prompt for more contextual interactions
- **Streamlined Architecture**: Cleaned up unused code for better performance and maintainability
- **Simplified State Management**: Consolidated state management methods into a single `load()` function

### Tools & Execution
- **Optimized Environment Management**: Fixed multiple environment instantiation issue
- Environments now initialize once during `__init__`
- **New SwarmRouter Function**: Simplified routing mechanism
- Returns consolidated string output from all agents
- Improved coordination between swarm components

## 💪 Performance Improvements
- Faster execution times
- Reduced memory footprint
- More reliable logging system
- Lightweight and efficient codebase

## 🤝 Join Our Community

### We're Hiring!
Join our growing team! We're currently looking for:
- Agent Engineers
- Developer Relations
- Infrastructure Engineers
- And more!

### Get Involved
- ⭐ Star our repository
- 🔄 Fork the project
- 🛠 Submit pull requests
- 🐛 Report issues
- 💡 Share your ideas

### Contact & Support
- 📧 Email: [email protected]
- 🔗 Issues: [GitHub Issues](https://github.com/kyegomez/swarms/issues)

## 🔜 What's Next?
Have ideas for features, bug fixes, or improvements? We'd love to hear from you! Reach out through our GitHub issues or email us directly.

---

*Thank you to all our contributors and users who make Swarms better every day. Together, we're building the future of swarm intelligence.*

#SwarmAI #OpenSource #AI #MachineLearning
Loading

0 comments on commit 8e374b1

Please sign in to comment.