[LOGGER FIX]

pull/682/head^2
Kye Gomez 3 weeks ago
parent 80dcab03f7
commit 9b1106ac91

@ -0,0 +1,61 @@
# Swarms Bounty Program
## Overview
The Swarms Bounty Program is an initiative designed to incentivize contributors to help us improve and expand the Swarms framework. With an impressive $150,000 allocated for bounties, contributors have the unique opportunity to earn generous rewards while gaining prestigious recognition in the Swarms community of over 9,000 agent engineers. This program offers more than just financial benefits; it allows contributors to play a pivotal role in advancing the field of multi-agent collaboration and AI automation, while also growing their professional skills and network. By joining the Swarms Bounty Program, you become part of an innovative movement shaping the future of technology.
## Why Contribute?
1. **Generous Rewards**: The bounty pool totals $150,000, ensuring that contributors are fairly compensated for their valuable work on successfully completed tasks. Each task comes with its own reward, reflecting its complexity and impact.
2. **Community Status**: Gain coveted recognition as a valued and active contributor within the thriving Swarms community. This status not only highlights your contributions but also builds your reputation among a network of AI engineers.
3. **Skill Development**: Collaborate on cutting-edge AI projects, hone your expertise in agent engineering, and learn practical skills that can be applied to real-world challenges in the AI domain.
4. **Networking Opportunities**: Work side-by-side with over 9,000 agent engineers in our active and supportive community. This network fosters collaboration, knowledge sharing, and mentorship opportunities that can significantly boost your career.
## How It Works
1. **Explore Issues and Tasks**:
- Visit the [Swarms GitHub Issues](https://github.com/kyegomez/swarms/issues) to find a comprehensive list of open tasks requiring attention. These issues range from coding challenges to documentation improvements, offering opportunities for contributors with various skill sets.
- Check the [Swarms Project Board](https://github.com/users/kyegomez/projects/1) for prioritized tasks and ongoing milestones. This board provides a clear view of project priorities and helps contributors align their efforts with the project's immediate goals.
2. **Claim a Bounty**:
- Identify a task that aligns with your interests and expertise.
- Comment on the issue to indicate your intent to work on it and describe your approach if necessary.
- Await approval from the Swarms team before commencing work. Approval ensures clarity and avoids duplication of efforts by other contributors.
3. **Submit Your Work**:
- Complete the task as per the outlined requirements in the issue description. Pay close attention to details to ensure your submission meets the expectations.
- Submit your pull request (PR) on GitHub with all the required elements, including documentation, test cases, or any relevant files that demonstrate your work.
- Engage with reviewers to refine your submission if requested.
4. **Earn Rewards**:
- Once your PR is reviewed, accepted, and merged into the main project, you will receive the bounty payment associated with the task.
- Your contributor status in the Swarms community will be updated, showcasing your involvement and accomplishments.
## Contribution Guidelines
To ensure high-quality contributions and streamline the process, please adhere to the following guidelines:
- Familiarize yourself with the [Swarms Contribution Guidelines](https://github.com/kyegomez/swarms/blob/main/CONTRIBUTING.md). These guidelines outline coding standards, best practices, and procedures for contributing effectively.
- Ensure your code is clean, modular, and well-documented. Contributions that adhere to the project's standards are more likely to be accepted.
- Actively communicate with the Swarms team and other contributors. Clear communication helps resolve uncertainties, avoids duplication, and fosters collaboration within the community.
## Get Involved
1. **Join the Community**:
- Become an active member of the Swarms community by joining our Discord server: [Join Now](https://discord.gg/jM3Z6M9uMq). The Discord server serves as a hub for discussions, updates, and support.
2. **Stay Updated**:
- Keep track of the latest updates, announcements, and bounty opportunities by regularly checking the Discord channel and the GitHub repository.
3. **Start Contributing**:
- Dive into the Swarms GitHub repository: [Swarms GitHub](https://github.com/kyegomez/swarms). Explore the codebase, familiarize yourself with the project structure, and identify areas where you can make an impact.
## Additional Benefits
Beyond monetary rewards, contributors gain intangible benefits that elevate their professional journey:
- **Recognition**: Your contributions will be showcased to a community of over 9,000 engineers, increasing your visibility and credibility in the AI field.
- **Portfolio Building**: Add high-impact contributions to your portfolio, demonstrating your skills and experience to potential employers or collaborators.
- **Knowledge Sharing**: Learn from and collaborate with experts in agent engineering, gaining insights into the latest advancements and best practices in the field.
## Contact Us
For any questions, support, or clarifications, reach out to the Swarms team:
- **Discord**: Engage directly with the team and fellow contributors in our active channels.
- **GitHub**: Open an issue for specific questions or suggestions related to the project. Were here to guide and assist you at every step of your contribution journey.
---
Join us in building the future of multi-agent collaboration and AI automation. With your contributions, we can create something truly extraordinary and transformative. Together, lets pave the way for groundbreaking advancements in technology and innovation!

@ -263,9 +263,11 @@ nav:
- The Essence of Enterprise-Grade Prompting: "swarms/prompts/essence.md"
- An Analysis on Prompting Strategies: "swarms/prompts/overview.md"
- Managing Prompts in Production: "swarms/prompts/main.md"
- Community:
- Bounty Program: "corporate/bounty_program.md"
- Corporate:
- Culture: "corporate/culture.md"
- Hiring: "corporate/hiring.md"
- Swarms Goals & Milestone Tracking; A Vision for 2024 and Beyond: "corporate/2024_2025_goals.md"
- Clusterops:
- Overview: "clusterops/reference.md"
# - Clusterops:
# - Overview: "clusterops/reference.md"

@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "swarms"
version = "6.6.8"
version = "6.6.9"
description = "Swarms - TGSC"
license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"]

@ -76,6 +76,8 @@ class LiteLLM:
Returns:
str: The content of the response from the model.
"""
try:
messages = self._prepare_messages(task)
response = completion(
@ -92,6 +94,8 @@ class LiteLLM:
0
].message.content # Accessing the content
return content
except Exception as error:
print(error)
def __call__(self, task: str, *args, **kwargs):
"""

@ -1,60 +1,17 @@
import os
import uuid
from typing import Any, Dict
from loguru import logger
import requests
from swarms.telemetry.sys_info import system_info
def log_agent_data(data: Any) -> Dict:
"""
Send data to the agent logging API endpoint.
Args:
data: Any data structure that can be JSON serialized
Returns:
Dict: The JSON response from the API
"""
try:
# Prepare the data payload
data_dict = {"data": data}
# API endpoint configuration
url = "https://swarms.world/api/get-agents/log-agents"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer sk-f24a13ed139f757d99cdd9cdcae710fccead92681606a97086d9711f69d44869",
}
# Send the request
response = requests.post(url, json=data_dict, headers=headers)
response.raise_for_status() # Raise an error for HTTP codes 4xx/5xx
# Return the JSON response
return response.json()
except Exception as e:
logger.error(f"Failed to log agent data: {e}")
return {"error": str(e)}
def initialize_logger(log_folder: str = "logs"):
"""
Initialize and configure the Loguru logger.
Args:
log_folder: The folder where logs will be stored.
Returns:
The configured Loguru logger.
"""
AGENT_WORKSPACE = "agent_workspace"
# Check if WORKSPACE_DIR is set, if not, set it to AGENT_WORKSPACE
if "WORKSPACE_DIR" not in os.environ:
os.environ["WORKSPACE_DIR"] = AGENT_WORKSPACE
# Create the log folder within the workspace
# Create a folder within the agent_workspace
log_folder_path = os.path.join(
os.getenv("WORKSPACE_DIR"), log_folder
)
@ -67,7 +24,6 @@ def initialize_logger(log_folder: str = "logs"):
log_folder_path, f"{log_folder}_{uuid_for_log}.log"
)
# Add a Loguru sink for file logging
logger.add(
log_file_path,
level="INFO",
@ -75,48 +31,7 @@ def initialize_logger(log_folder: str = "logs"):
backtrace=True,
diagnose=True,
enqueue=True,
# retention="10 days",
retention="10 days",
# compression="zip",
)
# Add a Loguru sink to intercept all log messages and send them to `log_agent_data`
class AgentLogHandler:
def write(self, message):
if message.strip(): # Avoid sending empty messages
payload = {
"log": str(message.strip()),
"folder": log_folder,
"metadata": system_info(),
}
response = log_agent_data(payload)
logger.debug(
f"Sent to API: {payload}, Response: {response}"
)
logger.add(AgentLogHandler(), level="INFO")
return logger
# if __name__ == "__main__":
# # Initialize the logger
# logger = initialize_logger()
# # Generate test log messages
# logger.info("This is a test info log.")
# logger.warning("This is a test warning log.")
# logger.error("This is a test error log.")
# # Simulate agent data logging
# test_data = {
# "agent_name": "TestAgent",
# "task": "Example Task",
# "status": "Running",
# "details": {
# "runtime": "5s",
# "success": True
# }
# }
# log_agent_data(test_data)
# print("Test logging completed.")

Loading…
Cancel
Save