Skip to content

Commit

Permalink
[NEW VERISON]
Browse files Browse the repository at this point in the history
  • Loading branch information
kyegomez committed Jan 15, 2025
1 parent 0e3238c commit 62263b6
Show file tree
Hide file tree
Showing 6 changed files with 735 additions and 50 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __pycache__/
.Python
build/
develop-eggs/
swarm_history.db
dist/
experimental
agent_workspace
Expand Down
2 changes: 1 addition & 1 deletion example_api_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
callable_name = (
"SequentialWorkflow" # Replace with the actual callable name
)
swarm_id = "f082e01f-1957-45a4-98a9-7be9bf7d83a6" # Replace with the actual swarm ID
swarm_id = "f0d58e55-9d96-4268-bf67-51a5074be5d9" # Replace with the actual swarm ID
url = f"http://localhost:8000/v1/swarms/completions/{callable_name}/{swarm_id}"

# Define the payload
Expand Down
25 changes: 6 additions & 19 deletions examples.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
import os
from dotenv import load_dotenv
from swarms import Agent, SequentialWorkflow
from swarm_models import OpenAIChat
from swarm_deploy import SwarmDeploy

load_dotenv()

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

# Model
model = OpenAIChat(
openai_api_base="https://api.groq.com/openai/v1",
openai_api_key=api_key,
model_name="llama-3.1-70b-versatile",
temperature=0.1,
)


# Initialize specialized agents
data_extractor_agent = Agent(
Expand All @@ -28,7 +15,7 @@
- Company background information
- Risk factors and challenges
Present the extracted information in a clear, structured format.""",
llm=model,
model_name="gpt-4o",
max_loops=1,
autosave=True,
verbose=True,
Expand All @@ -49,7 +36,7 @@
- Organize information in a logical structure
- Ensure all critical details are preserved
Focus on making complex information accessible while retaining all crucial insights.""",
llm=model,
model_name="gpt-4o",
max_loops=1,
autosave=True,
verbose=True,
Expand All @@ -71,7 +58,7 @@
- Examine debt structure and financing
- Identify potential areas for financial optimization
Provide detailed insights and recommendations based on financial data.""",
llm=model,
model_name="gpt-4o",
max_loops=1,
autosave=True,
verbose=True,
Expand All @@ -93,7 +80,7 @@
- Review customer segments and needs
- Examine regulatory environment
Provide strategic insights on market positioning and growth opportunities.""",
llm=model,
model_name="gpt-4o",
max_loops=1,
autosave=True,
verbose=True,
Expand All @@ -115,7 +102,7 @@
- Examine organizational structure
- Identify potential areas for operational improvement
Provide detailed insights on operational optimization and scaling opportunities.""",
llm=model,
model_name="gpt-4o",
max_loops=1,
autosave=True,
verbose=True,
Expand Down Expand Up @@ -146,7 +133,7 @@
# 5 lines of code to deploy your swarm
# Advanced usage with configuration
swarm = SwarmDeploy(
router,
callable_obj=router,
)

# Select your host and port!
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
swarms
asyncio
uuid
datetime
Expand All @@ -8,5 +9,4 @@ aiocache
fastapi
prometheus_client
pydantic
rich
swarms
rich
Loading

0 comments on commit 62263b6

Please sign in to comment.