intentkit 0.6.7.dev7__py3-none-any.whl → 0.6.7.dev8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of intentkit might be problematic. Click here for more details.

intentkit/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  A powerful platform for building AI agents with blockchain and cryptocurrency capabilities.
4
4
  """
5
5
 
6
- __version__ = "0.6.7-dev7"
6
+ __version__ = "0.6.7-dev8"
7
7
  __author__ = "hyacinthus"
8
8
  __email__ = "hyacinthus@gmail.com"
9
9
 
@@ -1,6 +1,12 @@
1
1
  # Elfa Skills - Social Media Intelligence
2
2
 
3
- Integration with [Elfa AI API](https://api.elfa.ai) providing real-time social media data analysis and processing capabilities for crypto and stock market sentiment tracking.
3
+ Integration with [Elfa AI API v2](https://api.elfa.ai/v2) providing real-time social media data analysis and processing capabilities for crypto and stock market sentiment tracking.
4
+
5
+ **Important: V2 API Changes**
6
+ - **No Raw Content**: V2 API removes raw tweet content for platform compliance
7
+ - **Sanitized Data**: Returns engagement metrics, timestamps, and account metadata only
8
+ - **New Endpoints**: Updated endpoints with consistent response format
9
+ - **Enhanced Pagination**: Different pagination patterns for search vs aggregation endpoints
4
10
 
5
11
  ## Setup
6
12
 
@@ -15,86 +21,132 @@ ELFA_API_KEY=your_elfa_api_key_here
15
21
 
16
22
  Ranks the most discussed tokens based on smart mentions count for a given period, updated every 5 minutes.
17
23
 
24
+ **Endpoint**: `v2/aggregations/trending-tokens` - Direct Migration
25
+
18
26
  **Example Prompts:**
19
27
  ```
20
28
  "What are the trending crypto tokens in the last 24 hours?"
21
- "Show me the most discussed tokens today with at least 10 mentions"
22
- "Get trending tokens for the past week"
23
- "Which tokens are gaining attention on social media?"
29
+ "Get trending tokens with minimum 50 mentions in the past week"
24
30
  ```
25
31
 
26
32
  **Parameters:**
27
- - `timeWindow`: "1h", "24h", "7d" (default: "24h")
33
+ - `timeWindow`: "30m", "1h", "4h", "24h", "7d", "30d" (default: "7d")
34
+ - `page`: Page number for pagination (default: 1)
35
+ - `pageSize`: Number of items per page (default: 50)
28
36
  - `minMentions`: Minimum mentions required (default: 5)
29
37
 
38
+ **V2 Changes:**
39
+ - Same functionality and parameters
40
+ - Enhanced response format with metadata
41
+ - Uses page+pageSize pagination for aggregations
42
+
30
43
  ---
31
44
 
32
45
  ### 2. Get Top Mentions (`get_top_mentions`)
33
46
 
34
47
  Queries tweets mentioning a specific stock/crypto ticker, ranked by view count for market sentiment analysis.
35
48
 
49
+ **Endpoint**: `v2/data/top-mentions` - Breaking Changes
50
+
36
51
  **Example Prompts:**
37
52
  ```
38
53
  "Get the top mentions for Bitcoin in the last 24 hours"
39
- "Show me the most viewed tweets about $ETH today"
40
- "What are people saying about TSLA stock on Twitter?"
41
- "Find viral tweets mentioning $SOL with account details"
54
+ "Show me engagement metrics for tweets about $ETH today"
42
55
  ```
43
56
 
44
57
  **Parameters:**
45
- - `ticker`: Stock/crypto symbol (e.g., "BTC", "$ETH", "AAPL")
46
- - `timeWindow`: "24h", "7d" (default: "24h")
47
- - `includeAccountDetails`: Include account info (default: false)
58
+ - `ticker`: Stock/crypto symbol (e.g., "BTC", "$ETH", "AAPL") - required
59
+ - `timeWindow`: "1h", "24h", "7d" (default: "1h")
60
+ - `page`: Page number for pagination (default: 1)
61
+ - `pageSize`: Number of items per page (default: 10)
62
+
63
+ **V2 Changes:**
64
+ - **Removed**: Raw tweet content/text
65
+ - **Removed**: `includeAccountDetails` parameter (always included)
66
+ - **Preserved**: Engagement metrics (view_count, like_count, etc.)
67
+ - **Preserved**: Account information and verification status
68
+ - **Enhanced**: Account tags (e.g., "smart" accounts)
48
69
 
49
70
  ---
50
71
 
51
72
  ### 3. Search Mentions (`search_mentions`)
52
73
 
53
- Searches tweets mentioning up to 5 keywords. Can access 30 days of recent data (updated every 5 minutes) or 6 months of historical data.
54
-
55
- **Example Prompts:**
56
- ```
57
- "Search for tweets mentioning 'DeFi, NFT, blockchain'"
58
- "Find recent mentions of 'AI, artificial intelligence, machine learning'"
59
- "Search historical tweets about 'bitcoin, cryptocurrency' from last month"
60
- "Look for discussions about 'climate change, renewable energy'"
61
- ```
62
-
63
- **Parameters:**
64
- - `keywords`: Up to 5 keywords (comma-separated, phrases accepted)
65
- - `from_`: Start timestamp (default: 24 hours ago)
66
- - `to`: End timestamp (default: yesterday)
67
-
68
- ---
69
-
70
- ### 4. Get Mentions (`get_mentions`)
74
+ Searches tweets mentioning up to 5 keywords or from specific accounts with sanitized engagement data.
71
75
 
72
- Retrieves hourly-updated tweets from "smart accounts" (influential accounts) that have received at least 10 interactions.
76
+ **Endpoint**: `v2/data/keyword-mentions` - Breaking Changes
73
77
 
74
78
  **Example Prompts:**
75
79
  ```
76
- "Get the latest mentions from smart accounts"
77
- "Show me recent tweets from influential crypto accounts"
78
- "What are the smart accounts talking about?"
79
- "Get the latest buzz from verified influencers"
80
+ "Search for engagement metrics of tweets mentioning 'DeFi, NFT, blockchain'"
81
+ "Find tweets from account 'elonmusk' about cryptocurrency"
80
82
  ```
81
83
 
82
- **Parameters:** None (uses default limits)
84
+ **Parameters:**
85
+ - `keywords`: Up to 5 keywords (comma-separated, phrases accepted) - optional if accountName provided
86
+ - `accountName`: Account username to filter by - optional if keywords provided
87
+ - `timeWindow`: Time window for search (default: "7d")
88
+ - `limit`: Number of results to return, max 30 (default: 20)
89
+ - `searchType`: Type of search - "and" or "or" (default: "or")
90
+ - `cursor`: Cursor for pagination (optional)
91
+
92
+ **V2 Changes:**
93
+ - **Removed**: Raw tweet content/text
94
+ - **Preserved**: Engagement metrics and sentiment analysis
95
+ - **Enhanced**: Account filtering with `accountName` parameter
96
+ - **Updated**: Uses limit+cursor pagination for search
97
+ - **Added**: Account tags and metadata
83
98
 
84
99
  ---
85
100
 
86
- ### 5. Get Smart Stats (`get_smart_stats`)
101
+ ### 4. Get Smart Stats (`get_smart_stats`)
87
102
 
88
103
  Retrieves key social media metrics for a specific username including engagement ratios and smart following count.
89
104
 
105
+ **Endpoint**: `v2/account/smart-stats` - Direct Migration
106
+
90
107
  **Example Prompts:**
91
108
  ```
92
109
  "Get smart stats for @elonmusk"
93
110
  "Analyze the social metrics for username 'VitalikButerin'"
94
- "Show me engagement stats for @cz_binance"
95
- "What are the social media metrics for @jack?"
96
111
  ```
97
112
 
98
113
  **Parameters:**
99
- - `username`: Twitter username (with or without @)
114
+ - `username`: Twitter username (with or without @) - required
115
+
116
+ **V2 Changes:**
117
+ - Same functionality and parameters
118
+ - Consistent response format with metadata
119
+
120
+ ## V2 Response Format
121
+
122
+ All V2 endpoints return a consistent format:
123
+
124
+ ```json
125
+ {
126
+ "success": boolean,
127
+ "data": [...], // Array or object with actual data
128
+ "metadata": { // Pagination and additional info
129
+ "total": number,
130
+ "page": number,
131
+ "pageSize": number,
132
+ "cursor": "string" // For search endpoints
133
+ }
134
+ }
135
+ ```
136
+
137
+ ## Migration Notes
138
+
139
+ ### What's Removed in V2:
140
+ - Raw tweet content/text (compliance requirement)
141
+ - Direct access to tweet body/message content
142
+ - `includeAccountDetails` parameter (always included)
143
+ - **Deprecated**: `get_mentions` skill (no v2 equivalent)
144
+
145
+ ### What's Preserved:
146
+ - Engagement metrics (likes, views, reposts, replies)
147
+ - Account information and verification status
148
+ - Timestamps and metadata
149
+ - Sentiment analysis
150
+ - Core functionality for trend analysis
151
+
100
152
 
@@ -7,7 +7,6 @@ from intentkit.abstracts.skill import SkillStoreABC
7
7
  from intentkit.skills.base import SkillConfig, SkillState
8
8
  from intentkit.skills.elfa.base import ElfaBaseTool
9
9
  from intentkit.skills.elfa.mention import (
10
- ElfaGetMentions,
11
10
  ElfaGetTopMentions,
12
11
  ElfaSearchMentions,
13
12
  )
@@ -21,7 +20,6 @@ logger = logging.getLogger(__name__)
21
20
 
22
21
 
23
22
  class SkillStates(TypedDict):
24
- get_mentions: SkillState
25
23
  get_top_mentions: SkillState
26
24
  search_mentions: SkillState
27
25
  get_trending_tokens: SkillState
@@ -83,14 +81,7 @@ def get_elfa_skill(
83
81
  The requested Elfa skill
84
82
  """
85
83
 
86
- if name == "get_mentions":
87
- if name not in _cache:
88
- _cache[name] = ElfaGetMentions(
89
- skill_store=store,
90
- )
91
- return _cache[name]
92
-
93
- elif name == "get_top_mentions":
84
+ if name == "get_top_mentions":
94
85
  if name not in _cache:
95
86
  _cache[name] = ElfaGetTopMentions(
96
87
  skill_store=store,
@@ -5,7 +5,7 @@ from pydantic import BaseModel, Field
5
5
  from intentkit.abstracts.skill import SkillStoreABC
6
6
  from intentkit.skills.base import IntentKitSkill, SkillContext
7
7
 
8
- base_url = "https://api.elfa.ai"
8
+ base_url = "https://api.elfa.ai/v2"
9
9
 
10
10
 
11
11
  class ElfaBaseTool(IntentKitSkill):