Skip to content

Commit

Permalink
[REQUIREMENTS]
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Oct 8, 2024
1 parent 71a3cf8 commit a271c2e
Show file tree
Hide file tree
Showing 4 changed files with 1,938 additions and 0 deletions.
67 changes: 67 additions & 0 deletions api_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import requests

# Swappable base URL for your FastAPI app
BASE_URL = "https://tickragent-285321057562.us-central1.run.app"


def analyze_stocks():
"""
Function to send a POST request to the `/v1/agent/analyze` endpoint.
"""
url = f"{BASE_URL}/v1/agent/analyze"

# Example request payload
data = {
"stocks": ["AAPL", "GOOGL", "MSFT"],
"query": "Conduct an analysis on this stock and show me if it's a buy or not and why",
"max_loops": 1,
"workers": 10,
"retry_attempts": 1,
"context_length": 16000,
"return_json_on": True
}

try:
# Send the POST request
response = requests.post(url, json=data)
# Print the response status and JSON content
print(f"Status Code: {response.status_code}")
print(f"Response JSON: {response.json()}")
except Exception as e:
print(f"Error occurred while calling analyze_stocks: {e}")


def get_status():
"""
Function to send a GET request to the `/v1/agent/status` endpoint.
"""
url = f"{BASE_URL}/v1/agent/status"

try:
# Send the GET request
response = requests.get(url)
# Print the response status and JSON content
print(f"Status Code: {response.status_code}")
print(f"Response JSON: {response.json()}")
except Exception as e:
print(f"Error occurred while calling get_status: {e}")


def main():
"""
Main function to execute all the tests.
"""
print("Running tests for FastAPI app endpoints...\n")

# Call each endpoint test
print("Testing `/v1/agent/analyze` endpoint:")
analyze_stocks()
print("\n")

print("Testing `/v1/agent/status` endpoint:")
get_status()
print("\n")


if __name__ == "__main__":
main()
48 changes: 48 additions & 0 deletions ee94b0a26b2245a2a73fa3c808b1e314_agent_creation_dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"swarm_name": "Social Media Marketing Swarm",
"rules": "1. Each agent is responsible for a specific social media platform or marketing strategy. 2. Agents must coordinate to ensure consistent messaging across all platforms. 3. All agents must report back with performance metrics and feedback. 4. Ensure all content is aligned with the brand guidelines and marketing objectives. 5. Use analytics to refine and improve strategies continuously.",
"plan": "The goal is to promote the new SpreadSheet Swarm feature across various social media platforms, highlighting its ability to manage multiple agents from a single dashboard. The plan involves creating specialized content and marketing strategies for each platform to maximize reach and engagement. Agents will focus on creating engaging content, targeting the right audience, and analyzing performance metrics to optimize campaigns.",
"task": "Promote the new SpreadSheet Swarm feature across multiple social media platforms, highlighting its capabilities and benefits.",
"agents": [
{
"agent_name": "Twitter Marketing Agent",
"system_prompt": "You are responsible for promoting the SpreadSheet Swarm feature on Twitter. Create engaging tweets, threads, and hashtags that highlight the benefits of using the SpreadSheet Swarm for managing multiple agents. Engage with followers and participate in relevant discussions. Monitor Twitter analytics to measure success."
},
{
"agent_name": "Facebook Marketing Agent",
"system_prompt": "Your task is to market the SpreadSheet Swarm feature on Facebook. Develop posts, stories, and ads that explain the feature's benefits. Engage with the community through comments and messages. Use Facebook Insights to track engagement and reach."
},
{
"agent_name": "LinkedIn Marketing Agent",
"system_prompt": "Promote the SpreadSheet Swarm feature on LinkedIn. Create professional posts and articles that appeal to businesses and professionals. Highlight case studies and success stories. Connect with industry leaders and participate in relevant groups. Analyze LinkedIn analytics for performance insights."
},
{
"agent_name": "Instagram Marketing Agent",
"system_prompt": "Focus on promoting the SpreadSheet Swarm feature on Instagram. Create visually appealing posts, stories, and reels that showcase the feature. Use relevant hashtags and collaborate with influencers. Track engagement through Instagram Insights."
},
{
"agent_name": "YouTube Marketing Agent",
"system_prompt": "Create video content for YouTube that explains and demonstrates the SpreadSheet Swarm feature. Develop tutorials, testimonials, and promotional videos. Optimize video titles and descriptions for SEO. Analyze YouTube analytics to measure video performance."
},
{
"agent_name": "TikTok Marketing Agent",
"system_prompt": "Promote the SpreadSheet Swarm feature on TikTok. Create short, engaging videos that highlight the feature's benefits. Use trending sounds and hashtags to increase visibility. Collaborate with TikTok influencers and monitor performance through TikTok analytics."
},
{
"agent_name": "Reddit Marketing Agent",
"system_prompt": "Engage with the Reddit community to promote the SpreadSheet Swarm feature. Participate in relevant subreddits and discussions. Share informative posts and answer questions. Use Reddit's analytics to track engagement and feedback."
},
{
"agent_name": "Pinterest Marketing Agent",
"system_prompt": "Promote the SpreadSheet Swarm feature on Pinterest. Create visually appealing pins and boards that highlight the feature's benefits. Use keywords and descriptions to optimize for search. Track performance through Pinterest analytics."
},
{
"agent_name": "Snapchat Marketing Agent",
"system_prompt": "Market the SpreadSheet Swarm feature on Snapchat. Create engaging snaps and stories that showcase the feature. Collaborate with influencers and use Snapchat ads. Monitor engagement through Snapchat analytics."
},
{
"agent_name": "Quora Marketing Agent",
"system_prompt": "Promote the SpreadSheet Swarm feature on Quora by answering relevant questions and creating informative posts. Highlight the benefits and use cases of the feature. Use Quora analytics to track engagement and reach."
}
]
}
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ swarms
loguru
pydantic
yfinance
aiocache
tenacity
uvicorn
swarm_models
fastapi
Loading

0 comments on commit a271c2e

Please sign in to comment.