chore: add initial structure for examples, documentation, and tests

pull/819/head
Pavan Kumar 3 days ago committed by ascender1729
parent 4b12ecae7b
commit 7febc47960

@ -82,3 +82,12 @@ args = "sleep 2"
[[workflows.workflow.tasks]] [[workflows.workflow.tasks]]
task = "shell.exec" task = "shell.exec"
args = "python examples/mcp_example/mock_multi_agent.py" args = "python examples/mcp_example/mock_multi_agent.py"
[[workflows.workflow]]
name = "Run Tests"
author = 13983571
mode = "sequential"
[[workflows.workflow.tasks]]
task = "shell.exec"
args = "python -m unittest tests/test_basic_example.py -v"

@ -0,0 +1,24 @@
# Basic Usage Guide
## Getting Started
This guide demonstrates how to use the basic features of the Swarms framework.
### Basic Agent Example
```python
from swarms.structs.agent import Agent
# Initialize agent
agent = Agent(
agent_name="Basic-Example-Agent",
agent_description="A simple example agent",
system_prompt="You are a helpful assistant.",
model_name="gpt-4",
)
# Run the agent
response = agent.run("What is 2+2?")
print(f"Agent response: {response}")
```

@ -0,0 +1,18 @@
from swarms.structs.agent import Agent
def main():
# Initialize basic agent
agent = Agent(
agent_name="Basic-Example-Agent",
agent_description="A simple example agent",
system_prompt="You are a helpful assistant.",
model_name="gpt-4",
)
# Run the agent
response = agent.run("What is 2+2?")
print(f"Agent response: {response}")
if __name__ == "__main__":
main()

@ -0,0 +1,23 @@
import unittest
from swarms.structs.agent import Agent
class TestBasicExample(unittest.TestCase):
def setUp(self):
self.agent = Agent(
agent_name="Test-Agent",
agent_description="A test agent",
system_prompt="You are a helpful assistant.",
model_name="gpt-4",
)
def test_agent_initialization(self):
self.assertEqual(self.agent.agent_name, "Test-Agent")
self.assertEqual(self.agent.agent_description, "A test agent")
def test_agent_run(self):
response = self.agent.run("What is 2+2?")
self.assertIsNotNone(response)
if __name__ == "__main__":
unittest.main()
Loading…
Cancel
Save