Refactor API instructions for clarity and conciseness across Market, News, Plan Memory, Social Media, and Symbols tools. Streamlined tool descriptions, selection strategies, and output requirements. Enhanced error handling and added best practices for usage. Updated formatting for consistency and improved readability.

This commit is contained in:
Simone Garau
2025-10-30 17:47:28 +01:00
parent eee5642b87
commit b755387050
5 changed files with 180 additions and 874 deletions

View File

@@ -1,103 +1,39 @@
Social Media Toolkit - Usage Instructions
# Social Media APIs - Instructions
OVERVIEW:
This toolkit provides access to cryptocurrency-related social media posts from multiple platforms (Reddit, X/Twitter, 4chan). You can query a single platform for fast results or aggregate data from all platforms for comprehensive social sentiment analysis.
## Tools (2)
**Single-source (fast):** First available platform
1. `get_top_crypto_posts(limit=5)` - Top crypto posts, first platform
AVAILABLE TOOLS (2 total):
**Aggregated (comprehensive):** All platforms (3x API calls: Reddit, X, 4chan)
2. `get_top_crypto_posts_aggregated(limit_per_wrapper=5)` - Posts from all platforms
=== SINGLE-SOURCE TOOLS (FAST) ===
These tools query platforms sequentially and return data from the first one that responds successfully.
## Selection Strategy
- Quick snapshot → single-source (tool 1)
- Keywords "all platforms", "comprehensive", "compare" → aggregated (tool 2)
1. get_top_crypto_posts(limit: int = 5) → list[SocialPost]
- Fetches top cryptocurrency-related posts from the first available platform
- Example: get_top_crypto_posts(limit=10)
- Use when: User wants a quick snapshot of social media sentiment
- Returns: List of SocialPost objects with content, author, engagement metrics
- Default limit is intentionally small (5) due to post length
## Post Structure
Contains: content, author, platform, url, created_at, score/upvotes, comments_count, subreddit/board
=== AGGREGATED TOOLS (COMPREHENSIVE) ===
These tools query ALL configured platforms and return results from each source for complete social coverage.
## Limits (posts are verbose)
- Quick: 5 (default) | Standard: 10-15 | Deep: 20-30 | Max: 50
2. get_top_crypto_posts_aggregated(limit_per_wrapper: int = 5) → dict[str, list[SocialPost]]
- Queries ALL platforms for top crypto posts
- Returns dictionary mapping platform names to their post lists
- Example: get_top_crypto_posts_aggregated(limit_per_wrapper=10)
- Use when: User requests "all platforms", "comprehensive", or "complete" social analysis
- Warning: Uses 3x API calls (one per platform: Reddit, X, 4chan)
## Platform Notes
- **Reddit:** r/cryptocurrency, r/bitcoin, r/ethereum (upvotes metric)
- **X (Twitter):** High engagement crypto tweets (likes metric)
- **4chan:** /biz/ board (replies metric, may contain inappropriate language)
TOOL SELECTION STRATEGY:
- "What's trending in crypto on social media?" → get_top_crypto_posts(limit=10) [tool #1]
- "Show top crypto posts" → get_top_crypto_posts(limit=5) [tool #1]
- "Get crypto sentiment from all platforms" → get_top_crypto_posts_aggregated(limit_per_wrapper=10) [tool #2]
- "Compare Reddit and Twitter crypto posts" → get_top_crypto_posts_aggregated(limit_per_wrapper=15) [tool #2]
## Critical Rules
- Never fabricate posts - only report actual tool outputs
- Include: platform, author, URL, engagement metrics, timestamp
- Truncate content to max 280 chars
- Summarize sentiment trends, don't list all posts verbatim
- Frame as opinions, not facts - add disclaimers for unverified info
- Be VERY concise to save tokens
SOCIALPOST STRUCTURE:
Each SocialPost object typically contains:
- content: Post text/message
- author: Username/handle of poster
- platform: Source platform (Reddit, X, 4chan)
- url: Link to original post
- created_at: Post timestamp
- score/upvotes: Engagement metric (platform-dependent)
- comments_count: Number of comments/replies
- subreddit/board: Specific community (Reddit/4chan)
LIMIT GUIDELINES:
Social media posts are longer than news headlines, so use smaller limits:
- Quick snapshot: limit=5 (default)
- Standard overview: limit=10-15
- Deep analysis: limit=20-30
- Maximum recommended: limit=50 (to avoid token overflow)
PLATFORM-SPECIFIC NOTES:
- Reddit: Posts from r/cryptocurrency, r/bitcoin, r/ethereum and similar subreddits
- X (Twitter): Crypto-related tweets with high engagement
- 4chan: Posts from /biz/ board focused on crypto discussions
- Each platform has different engagement metrics (upvotes, likes, replies)
CRITICAL RULES:
1. NEVER fabricate social media posts - only report actual tool outputs
2. ALL posts returned by tools are REAL from actual users
3. ALWAYS include platform source and author information
4. ALWAYS include post URLs for verification
5. Be aware of potential misinformation in social media content
6. If tools fail, report the failure explicitly - DO NOT invent placeholder posts
7. In aggregated results, clearly separate posts by platform
8. Social media reflects opinions, not facts - frame accordingly
ERROR HANDLING:
- All platforms fail → Report "Social media data unavailable from all sources"
- Partial data → Report available posts and note which platforms failed
- No crypto posts found → Report "No cryptocurrency posts available at this time"
- API rate limits → Try single-source tool or reduce limit
OUTPUT REQUIREMENTS:
- Include post content (truncate if too long, max 280 chars recommended)
- Include author/username (required)
- Include platform name (required)
- Include engagement metrics (upvotes, likes, comments)
- Include post URL for verification
- Include timestamp/date when available
- Group posts by platform in aggregated mode
- Summarize sentiment trends rather than listing all posts verbatim
- Be VERY concise to save tokens - social posts are verbose
SENTIMENT ANALYSIS TIPS:
- Look for recurring topics across posts
- Note positive vs negative sentiment patterns
- Identify trending coins or topics
- Compare sentiment across platforms
- Highlight posts with high engagement
- Flag potential FUD (Fear, Uncertainty, Doubt) or shilling
CONTENT WARNINGS:
- Social media may contain:
- Unverified information
- Speculation and rumors
- Promotional/shilling content
- Strong opinions or biased views
- Inappropriate language (especially 4chan)
- Always present social data with appropriate disclaimers
## Sentiment Analysis
- Identify recurring topics, positive/negative patterns, trending coins
- Compare sentiment across platforms, highlight high engagement
- Flag potential FUD or shilling
- Do not treat social media posts as factual evidence
- Encourage users to verify information from official sources