intentkit 0.8.11__py3-none-any.whl → 0.8.12__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 +1 -1
- intentkit/abstracts/graph.py +4 -0
- intentkit/abstracts/skill.py +2 -140
- intentkit/clients/twitter.py +35 -28
- intentkit/core/agent.py +2 -374
- intentkit/core/asset.py +63 -16
- intentkit/core/engine.py +16 -7
- intentkit/core/scheduler.py +8 -8
- intentkit/models/agent.py +109 -94
- intentkit/models/agent_schema.json +6 -9
- intentkit/models/llm.csv +15 -12
- intentkit/models/skill.py +38 -40
- intentkit/skills/acolyt/__init__.py +2 -9
- intentkit/skills/acolyt/base.py +2 -5
- intentkit/skills/aixbt/__init__.py +2 -13
- intentkit/skills/aixbt/base.py +0 -4
- intentkit/skills/aixbt/projects.py +1 -2
- intentkit/skills/allora/__init__.py +2 -9
- intentkit/skills/allora/base.py +2 -5
- intentkit/skills/base.py +168 -27
- intentkit/skills/basename/__init__.py +1 -3
- intentkit/skills/carv/__init__.py +116 -121
- intentkit/skills/carv/base.py +184 -185
- intentkit/skills/casino/__init__.py +4 -15
- intentkit/skills/casino/base.py +0 -4
- intentkit/skills/casino/deck_draw.py +4 -6
- intentkit/skills/casino/deck_shuffle.py +5 -4
- intentkit/skills/casino/dice_roll.py +1 -2
- intentkit/skills/cdp/__init__.py +0 -5
- intentkit/skills/cdp/base.py +0 -4
- intentkit/skills/cdp/schema.json +1 -17
- intentkit/skills/chainlist/__init__.py +2 -7
- intentkit/skills/chainlist/base.py +0 -4
- intentkit/skills/common/__init__.py +2 -9
- intentkit/skills/common/base.py +0 -4
- intentkit/skills/cookiefun/__init__.py +6 -9
- intentkit/skills/cookiefun/base.py +0 -4
- intentkit/skills/cryptocompare/__init__.py +7 -24
- intentkit/skills/cryptocompare/base.py +4 -18
- intentkit/skills/cryptocompare/fetch_news.py +1 -1
- intentkit/skills/cryptocompare/fetch_price.py +1 -1
- intentkit/skills/cryptocompare/fetch_top_exchanges.py +1 -1
- intentkit/skills/cryptocompare/fetch_top_market_cap.py +1 -1
- intentkit/skills/cryptocompare/fetch_top_volume.py +1 -1
- intentkit/skills/cryptocompare/fetch_trading_signals.py +1 -1
- intentkit/skills/cryptopanic/__init__.py +3 -6
- intentkit/skills/cryptopanic/base.py +53 -55
- intentkit/skills/cryptopanic/fetch_crypto_news.py +0 -2
- intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +1 -3
- intentkit/skills/dapplooker/__init__.py +2 -9
- intentkit/skills/dapplooker/base.py +2 -5
- intentkit/skills/defillama/__init__.py +24 -74
- intentkit/skills/defillama/base.py +3 -13
- intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_block.py +2 -2
- intentkit/skills/defillama/coins/fetch_current_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_first_price.py +2 -2
- intentkit/skills/defillama/coins/fetch_historical_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_price_chart.py +2 -2
- intentkit/skills/defillama/coins/fetch_price_percentage.py +2 -2
- intentkit/skills/defillama/fees/fetch_fees_overview.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +2 -2
- intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_chains.py +2 -2
- intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocol.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocols.py +2 -2
- intentkit/skills/defillama/volumes/fetch_dex_overview.py +2 -2
- intentkit/skills/defillama/volumes/fetch_dex_summary.py +2 -2
- intentkit/skills/defillama/volumes/fetch_options_overview.py +2 -2
- intentkit/skills/defillama/yields/fetch_pool_chart.py +2 -2
- intentkit/skills/defillama/yields/fetch_pools.py +2 -2
- intentkit/skills/dexscreener/__init__.py +97 -102
- intentkit/skills/dexscreener/base.py +125 -130
- intentkit/skills/dexscreener/get_pair_info.py +2 -3
- intentkit/skills/dexscreener/get_token_pairs.py +2 -3
- intentkit/skills/dexscreener/get_tokens_info.py +2 -3
- intentkit/skills/dexscreener/search_token.py +2 -4
- intentkit/skills/dune_analytics/__init__.py +4 -6
- intentkit/skills/dune_analytics/base.py +50 -52
- intentkit/skills/dune_analytics/fetch_kol_buys.py +0 -2
- intentkit/skills/dune_analytics/fetch_nation_metrics.py +0 -2
- intentkit/skills/elfa/__init__.py +5 -18
- intentkit/skills/elfa/base.py +8 -10
- intentkit/skills/enso/__init__.py +9 -29
- intentkit/skills/enso/base.py +3 -6
- intentkit/skills/enso/networks.py +1 -6
- intentkit/skills/enso/route.py +4 -8
- intentkit/skills/enso/tokens.py +2 -12
- intentkit/skills/erc20/__init__.py +1 -5
- intentkit/skills/erc721/__init__.py +1 -3
- intentkit/skills/firecrawl/__init__.py +5 -18
- intentkit/skills/firecrawl/base.py +2 -5
- intentkit/skills/firecrawl/clear.py +3 -6
- intentkit/skills/firecrawl/crawl.py +10 -9
- intentkit/skills/firecrawl/query.py +3 -1
- intentkit/skills/firecrawl/scrape.py +10 -14
- intentkit/skills/firecrawl/utils.py +39 -31
- intentkit/skills/github/__init__.py +2 -7
- intentkit/skills/github/base.py +0 -4
- intentkit/skills/heurist/__init__.py +8 -27
- intentkit/skills/heurist/base.py +2 -5
- intentkit/skills/heurist/image_generation_animagine_xl.py +5 -5
- intentkit/skills/heurist/image_generation_arthemy_comics.py +5 -5
- intentkit/skills/heurist/image_generation_arthemy_real.py +5 -5
- intentkit/skills/heurist/image_generation_braindance.py +5 -5
- intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +5 -5
- intentkit/skills/heurist/image_generation_flux_1_dev.py +5 -5
- intentkit/skills/heurist/image_generation_sdxl.py +5 -5
- intentkit/skills/http/__init__.py +4 -15
- intentkit/skills/http/base.py +0 -4
- intentkit/skills/lifi/__init__.py +1 -6
- intentkit/skills/lifi/base.py +0 -4
- intentkit/skills/lifi/token_execute.py +1 -4
- intentkit/skills/lifi/token_quote.py +1 -3
- intentkit/skills/moralis/__init__.py +3 -7
- intentkit/skills/moralis/base.py +2 -5
- intentkit/skills/morpho/__init__.py +1 -3
- intentkit/skills/nation/__init__.py +2 -7
- intentkit/skills/nation/base.py +4 -7
- intentkit/skills/openai/__init__.py +5 -18
- intentkit/skills/openai/base.py +8 -10
- intentkit/skills/openai/dalle_image_generation.py +2 -5
- intentkit/skills/openai/gpt_image_generation.py +2 -5
- intentkit/skills/openai/gpt_image_to_image.py +2 -5
- intentkit/skills/openai/image_to_text.py +2 -5
- intentkit/skills/portfolio/__init__.py +11 -35
- intentkit/skills/portfolio/base.py +2 -5
- intentkit/skills/pyth/__init__.py +1 -5
- intentkit/skills/slack/__init__.py +5 -17
- intentkit/skills/slack/base.py +0 -4
- intentkit/skills/supabase/__init__.py +7 -23
- intentkit/skills/supabase/base.py +0 -4
- intentkit/skills/superfluid/__init__.py +1 -3
- intentkit/skills/system/__init__.py +7 -24
- intentkit/skills/system/add_autonomous_task.py +2 -2
- intentkit/skills/system/delete_autonomous_task.py +2 -2
- intentkit/skills/system/edit_autonomous_task.py +2 -4
- intentkit/skills/system/list_autonomous_tasks.py +2 -2
- intentkit/skills/system/read_agent_api_key.py +6 -4
- intentkit/skills/system/regenerate_agent_api_key.py +6 -4
- intentkit/skills/tavily/__init__.py +3 -12
- intentkit/skills/tavily/base.py +2 -5
- intentkit/skills/tavily/tavily_extract.py +1 -2
- intentkit/skills/tavily/tavily_search.py +3 -3
- intentkit/skills/token/__init__.py +5 -10
- intentkit/skills/token/base.py +2 -6
- intentkit/skills/twitter/__init__.py +11 -35
- intentkit/skills/twitter/base.py +18 -29
- intentkit/skills/twitter/follow_user.py +1 -4
- intentkit/skills/twitter/get_mentions.py +2 -8
- intentkit/skills/twitter/get_timeline.py +3 -10
- intentkit/skills/twitter/get_user_by_username.py +1 -4
- intentkit/skills/twitter/get_user_tweets.py +3 -10
- intentkit/skills/twitter/like_tweet.py +1 -4
- intentkit/skills/twitter/post_tweet.py +3 -5
- intentkit/skills/twitter/reply_tweet.py +3 -5
- intentkit/skills/twitter/retweet.py +1 -4
- intentkit/skills/twitter/search_tweets.py +3 -10
- intentkit/skills/unrealspeech/__init__.py +2 -7
- intentkit/skills/unrealspeech/base.py +0 -4
- intentkit/skills/venice_audio/__init__.py +99 -106
- intentkit/skills/venice_audio/base.py +118 -121
- intentkit/skills/venice_audio/venice_audio.py +1 -5
- intentkit/skills/venice_image/__init__.py +147 -154
- intentkit/skills/venice_image/base.py +185 -192
- intentkit/skills/web_scraper/__init__.py +5 -18
- intentkit/skills/web_scraper/base.py +20 -4
- intentkit/skills/web_scraper/document_indexer.py +6 -4
- intentkit/skills/web_scraper/scrape_and_index.py +11 -10
- intentkit/skills/web_scraper/utils.py +38 -38
- intentkit/skills/web_scraper/website_indexer.py +7 -8
- intentkit/skills/weth/__init__.py +1 -5
- intentkit/skills/wow/__init__.py +1 -5
- intentkit/skills/xmtp/__init__.py +4 -15
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/METADATA +1 -1
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/RECORD +183 -183
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/WHEEL +0 -0
- {intentkit-0.8.11.dist-info → intentkit-0.8.12.dist-info}/licenses/LICENSE +0 -0
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.casino.base import CasinoBaseTool
|
|
9
8
|
from intentkit.skills.casino.deck_draw import CasinoDeckDraw
|
|
@@ -31,7 +30,6 @@ class Config(SkillConfig):
|
|
|
31
30
|
async def get_skills(
|
|
32
31
|
config: "Config",
|
|
33
32
|
is_private: bool,
|
|
34
|
-
store: SkillStoreABC,
|
|
35
33
|
**_,
|
|
36
34
|
) -> list[CasinoBaseTool]:
|
|
37
35
|
"""Get all Casino skills.
|
|
@@ -39,7 +37,6 @@ async def get_skills(
|
|
|
39
37
|
Args:
|
|
40
38
|
config: The configuration for Casino skills.
|
|
41
39
|
is_private: Whether to include private skills.
|
|
42
|
-
store: The skill store for persisting data.
|
|
43
40
|
|
|
44
41
|
Returns:
|
|
45
42
|
A list of Casino skills.
|
|
@@ -56,7 +53,7 @@ async def get_skills(
|
|
|
56
53
|
# Get each skill using the cached getter
|
|
57
54
|
result = []
|
|
58
55
|
for name in available_skills:
|
|
59
|
-
skill = get_casino_skill(name
|
|
56
|
+
skill = get_casino_skill(name)
|
|
60
57
|
if skill:
|
|
61
58
|
result.append(skill)
|
|
62
59
|
return result
|
|
@@ -64,34 +61,26 @@ async def get_skills(
|
|
|
64
61
|
|
|
65
62
|
def get_casino_skill(
|
|
66
63
|
name: str,
|
|
67
|
-
store: SkillStoreABC,
|
|
68
64
|
) -> CasinoBaseTool:
|
|
69
65
|
"""Get a Casino skill by name.
|
|
70
66
|
|
|
71
67
|
Args:
|
|
72
68
|
name: The name of the skill to get
|
|
73
|
-
store: The skill store for persisting data
|
|
74
69
|
|
|
75
70
|
Returns:
|
|
76
71
|
The requested Casino skill
|
|
77
72
|
"""
|
|
78
73
|
if name == "deck_shuffle":
|
|
79
74
|
if name not in _cache:
|
|
80
|
-
_cache[name] = CasinoDeckShuffle(
|
|
81
|
-
skill_store=store,
|
|
82
|
-
)
|
|
75
|
+
_cache[name] = CasinoDeckShuffle()
|
|
83
76
|
return _cache[name]
|
|
84
77
|
elif name == "deck_draw":
|
|
85
78
|
if name not in _cache:
|
|
86
|
-
_cache[name] = CasinoDeckDraw(
|
|
87
|
-
skill_store=store,
|
|
88
|
-
)
|
|
79
|
+
_cache[name] = CasinoDeckDraw()
|
|
89
80
|
return _cache[name]
|
|
90
81
|
elif name == "dice_roll":
|
|
91
82
|
if name not in _cache:
|
|
92
|
-
_cache[name] = CasinoDiceRoll(
|
|
93
|
-
skill_store=store,
|
|
94
|
-
)
|
|
83
|
+
_cache[name] = CasinoDiceRoll()
|
|
95
84
|
return _cache[name]
|
|
96
85
|
else:
|
|
97
86
|
raise ValueError(f"Unknown Casino skill: {name}")
|
intentkit/skills/casino/base.py
CHANGED
|
@@ -4,7 +4,6 @@ from typing import Type
|
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
6
6
|
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.base import IntentKitSkill
|
|
9
8
|
|
|
10
9
|
|
|
@@ -14,9 +13,6 @@ class CasinoBaseTool(IntentKitSkill):
|
|
|
14
13
|
name: str = Field(description="The name of the tool")
|
|
15
14
|
description: str = Field(description="A description of what the tool does")
|
|
16
15
|
args_schema: Type[BaseModel]
|
|
17
|
-
skill_store: SkillStoreABC = Field(
|
|
18
|
-
description="The skill store for persisting data"
|
|
19
|
-
)
|
|
20
16
|
|
|
21
17
|
@property
|
|
22
18
|
def category(self) -> str:
|
|
@@ -58,9 +58,8 @@ class CasinoDeckDraw(CasinoBaseTool):
|
|
|
58
58
|
# Apply rate limit using built-in user_rate_limit method
|
|
59
59
|
rate_config = RATE_LIMITS["deck_draw"]
|
|
60
60
|
await self.user_rate_limit(
|
|
61
|
-
context.user_id or context.agent_id,
|
|
62
61
|
rate_config["max_requests"],
|
|
63
|
-
rate_config["interval"]
|
|
62
|
+
rate_config["interval"],
|
|
64
63
|
"deck_draw",
|
|
65
64
|
)
|
|
66
65
|
|
|
@@ -68,8 +67,8 @@ class CasinoDeckDraw(CasinoBaseTool):
|
|
|
68
67
|
count = validate_card_count(count)
|
|
69
68
|
|
|
70
69
|
# Get current deck info
|
|
71
|
-
deck_info = await self.
|
|
72
|
-
|
|
70
|
+
deck_info = await self.get_agent_skill_data_raw(
|
|
71
|
+
DECK_STORAGE_KEY, CURRENT_DECK_KEY
|
|
73
72
|
)
|
|
74
73
|
|
|
75
74
|
deck_id = "new" # Default to new deck
|
|
@@ -99,8 +98,7 @@ class CasinoDeckDraw(CasinoBaseTool):
|
|
|
99
98
|
else:
|
|
100
99
|
deck_info["remaining"] = data["remaining"]
|
|
101
100
|
|
|
102
|
-
await self.
|
|
103
|
-
context.agent_id,
|
|
101
|
+
await self.save_agent_skill_data_raw(
|
|
104
102
|
DECK_STORAGE_KEY,
|
|
105
103
|
CURRENT_DECK_KEY,
|
|
106
104
|
deck_info,
|
|
@@ -64,9 +64,8 @@ class CasinoDeckShuffle(CasinoBaseTool):
|
|
|
64
64
|
# Apply rate limit using built-in user_rate_limit method
|
|
65
65
|
rate_config = RATE_LIMITS["deck_shuffle"]
|
|
66
66
|
await self.user_rate_limit(
|
|
67
|
-
context.user_id or context.agent_id,
|
|
68
67
|
rate_config["max_requests"],
|
|
69
|
-
rate_config["interval"]
|
|
68
|
+
rate_config["interval"],
|
|
70
69
|
"deck_shuffle",
|
|
71
70
|
)
|
|
72
71
|
|
|
@@ -95,8 +94,10 @@ class CasinoDeckShuffle(CasinoBaseTool):
|
|
|
95
94
|
"shuffled": data["shuffled"],
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
await self.
|
|
99
|
-
|
|
97
|
+
await self.save_agent_skill_data_raw(
|
|
98
|
+
DECK_STORAGE_KEY,
|
|
99
|
+
CURRENT_DECK_KEY,
|
|
100
|
+
deck_info,
|
|
100
101
|
)
|
|
101
102
|
|
|
102
103
|
return {
|
|
@@ -57,9 +57,8 @@ class CasinoDiceRoll(CasinoBaseTool):
|
|
|
57
57
|
# Apply rate limit using built-in user_rate_limit method
|
|
58
58
|
rate_config = RATE_LIMITS["dice_roll"]
|
|
59
59
|
await self.user_rate_limit(
|
|
60
|
-
context.user_id or context.agent_id,
|
|
61
60
|
rate_config["max_requests"],
|
|
62
|
-
rate_config["interval"]
|
|
61
|
+
rate_config["interval"],
|
|
63
62
|
"dice_roll",
|
|
64
63
|
)
|
|
65
64
|
|
intentkit/skills/cdp/__init__.py
CHANGED
|
@@ -8,7 +8,6 @@ from coinbase_agentkit import (
|
|
|
8
8
|
wallet_action_provider,
|
|
9
9
|
)
|
|
10
10
|
|
|
11
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
12
11
|
from intentkit.skills.base import (
|
|
13
12
|
SkillConfig,
|
|
14
13
|
SkillState,
|
|
@@ -25,7 +24,6 @@ class SkillStates(TypedDict):
|
|
|
25
24
|
WalletActionProvider_get_balance: SkillState
|
|
26
25
|
WalletActionProvider_get_wallet_details: SkillState
|
|
27
26
|
WalletActionProvider_native_transfer: SkillState
|
|
28
|
-
CdpApiActionProvider_request_faucet_funds: SkillState
|
|
29
27
|
CdpEvmWalletActionProvider_get_swap_price: SkillState
|
|
30
28
|
CdpEvmWalletActionProvider_swap: SkillState
|
|
31
29
|
|
|
@@ -41,7 +39,6 @@ class Config(SkillConfig):
|
|
|
41
39
|
async def get_skills(
|
|
42
40
|
config: "Config",
|
|
43
41
|
is_private: bool,
|
|
44
|
-
store: SkillStoreABC,
|
|
45
42
|
agent_id: str,
|
|
46
43
|
agent: Optional["Agent"] = None,
|
|
47
44
|
**_,
|
|
@@ -51,7 +48,6 @@ async def get_skills(
|
|
|
51
48
|
Args:
|
|
52
49
|
config: The configuration for CDP skills.
|
|
53
50
|
is_private: Whether to include private skills.
|
|
54
|
-
store: The skill store for persisting data.
|
|
55
51
|
agent_id: The ID of the agent using the skills.
|
|
56
52
|
|
|
57
53
|
Returns:
|
|
@@ -69,7 +65,6 @@ async def get_skills(
|
|
|
69
65
|
# Initialize CDP client
|
|
70
66
|
actions = await get_agentkit_actions(
|
|
71
67
|
agent_id,
|
|
72
|
-
store,
|
|
73
68
|
[
|
|
74
69
|
wallet_action_provider,
|
|
75
70
|
cdp_api_action_provider,
|
intentkit/skills/cdp/base.py
CHANGED
|
@@ -2,7 +2,6 @@ from typing import Type
|
|
|
2
2
|
|
|
3
3
|
from pydantic import BaseModel, Field
|
|
4
4
|
|
|
5
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
6
5
|
from intentkit.skills.base import IntentKitSkill
|
|
7
6
|
|
|
8
7
|
|
|
@@ -12,9 +11,6 @@ class CDPBaseTool(IntentKitSkill):
|
|
|
12
11
|
name: str = Field(description="The name of the tool")
|
|
13
12
|
description: str = Field(description="A description of what the tool does")
|
|
14
13
|
args_schema: Type[BaseModel]
|
|
15
|
-
skill_store: SkillStoreABC = Field(
|
|
16
|
-
description="The skill store for persisting data"
|
|
17
|
-
)
|
|
18
14
|
|
|
19
15
|
@property
|
|
20
16
|
def category(self) -> str:
|
intentkit/skills/cdp/schema.json
CHANGED
|
@@ -66,22 +66,6 @@
|
|
|
66
66
|
"description": "Transfer the native asset from the wallet",
|
|
67
67
|
"default": "disabled"
|
|
68
68
|
},
|
|
69
|
-
"CdpApiActionProvider_request_faucet_funds": {
|
|
70
|
-
"type": "string",
|
|
71
|
-
"title": "Request Faucet Funds",
|
|
72
|
-
"enum": [
|
|
73
|
-
"disabled",
|
|
74
|
-
"public",
|
|
75
|
-
"private"
|
|
76
|
-
],
|
|
77
|
-
"x-enum-title": [
|
|
78
|
-
"Disabled",
|
|
79
|
-
"Agent Owner + All Users",
|
|
80
|
-
"Agent Owner Only"
|
|
81
|
-
],
|
|
82
|
-
"description": "State for CdpApiActionProvider_request_faucet_funds",
|
|
83
|
-
"default": "disabled"
|
|
84
|
-
},
|
|
85
69
|
"CdpEvmWalletActionProvider_get_swap_price": {
|
|
86
70
|
"type": "string",
|
|
87
71
|
"title": "Get Swap Price",
|
|
@@ -135,4 +119,4 @@
|
|
|
135
119
|
"enabled"
|
|
136
120
|
],
|
|
137
121
|
"additionalProperties": true
|
|
138
|
-
}
|
|
122
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from typing import TypedDict
|
|
2
2
|
|
|
3
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
4
3
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
5
4
|
from intentkit.skills.chainlist.base import ChainlistBaseTool
|
|
6
5
|
from intentkit.skills.chainlist.chain_lookup import ChainLookup
|
|
@@ -22,7 +21,6 @@ class Config(SkillConfig):
|
|
|
22
21
|
async def get_skills(
|
|
23
22
|
config: "Config",
|
|
24
23
|
is_private: bool,
|
|
25
|
-
store: SkillStoreABC,
|
|
26
24
|
**_,
|
|
27
25
|
) -> list[ChainlistBaseTool]:
|
|
28
26
|
"""Get all chainlist skills."""
|
|
@@ -36,19 +34,16 @@ async def get_skills(
|
|
|
36
34
|
available_skills.append(skill_name)
|
|
37
35
|
|
|
38
36
|
# Get each skill using the cached getter
|
|
39
|
-
return [get_chainlist_skill(name
|
|
37
|
+
return [get_chainlist_skill(name) for name in available_skills]
|
|
40
38
|
|
|
41
39
|
|
|
42
40
|
def get_chainlist_skill(
|
|
43
41
|
name: str,
|
|
44
|
-
store: SkillStoreABC,
|
|
45
42
|
) -> ChainlistBaseTool:
|
|
46
43
|
"""Get a chainlist skill by name."""
|
|
47
44
|
if name == "chain_lookup":
|
|
48
45
|
if name not in _cache:
|
|
49
|
-
_cache[name] = ChainLookup(
|
|
50
|
-
skill_store=store,
|
|
51
|
-
)
|
|
46
|
+
_cache[name] = ChainLookup()
|
|
52
47
|
return _cache[name]
|
|
53
48
|
else:
|
|
54
49
|
raise ValueError(f"Unknown chainlist skill: {name}")
|
|
@@ -2,7 +2,6 @@ from typing import Type
|
|
|
2
2
|
|
|
3
3
|
from pydantic import BaseModel, Field
|
|
4
4
|
|
|
5
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
6
5
|
from intentkit.skills.base import IntentKitSkill
|
|
7
6
|
|
|
8
7
|
|
|
@@ -12,9 +11,6 @@ class ChainlistBaseTool(IntentKitSkill):
|
|
|
12
11
|
name: str = Field(description="The name of the tool")
|
|
13
12
|
description: str = Field(description="A description of what the tool does")
|
|
14
13
|
args_schema: Type[BaseModel]
|
|
15
|
-
skill_store: SkillStoreABC = Field(
|
|
16
|
-
description="The skill store for persisting data"
|
|
17
|
-
)
|
|
18
14
|
|
|
19
15
|
@property
|
|
20
16
|
def category(self) -> str:
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.common.base import CommonBaseTool
|
|
9
8
|
from intentkit.skills.common.current_time import CurrentTime
|
|
@@ -27,7 +26,6 @@ class Config(SkillConfig):
|
|
|
27
26
|
async def get_skills(
|
|
28
27
|
config: "Config",
|
|
29
28
|
is_private: bool,
|
|
30
|
-
store: SkillStoreABC,
|
|
31
29
|
**_,
|
|
32
30
|
) -> list[CommonBaseTool]:
|
|
33
31
|
"""Get all common utility skills.
|
|
@@ -35,7 +33,6 @@ async def get_skills(
|
|
|
35
33
|
Args:
|
|
36
34
|
config: The configuration for common utility skills.
|
|
37
35
|
is_private: Whether to include private skills.
|
|
38
|
-
store: The skill store for persisting data.
|
|
39
36
|
|
|
40
37
|
Returns:
|
|
41
38
|
A list of common utility skills.
|
|
@@ -52,7 +49,7 @@ async def get_skills(
|
|
|
52
49
|
# Get each skill using the cached getter
|
|
53
50
|
result = []
|
|
54
51
|
for name in available_skills:
|
|
55
|
-
skill = get_common_skill(name
|
|
52
|
+
skill = get_common_skill(name)
|
|
56
53
|
if skill:
|
|
57
54
|
result.append(skill)
|
|
58
55
|
return result
|
|
@@ -60,22 +57,18 @@ async def get_skills(
|
|
|
60
57
|
|
|
61
58
|
def get_common_skill(
|
|
62
59
|
name: str,
|
|
63
|
-
store: SkillStoreABC,
|
|
64
60
|
) -> CommonBaseTool:
|
|
65
61
|
"""Get a common utility skill by name.
|
|
66
62
|
|
|
67
63
|
Args:
|
|
68
64
|
name: The name of the skill to get
|
|
69
|
-
store: The skill store for persisting data
|
|
70
65
|
|
|
71
66
|
Returns:
|
|
72
67
|
The requested common utility skill
|
|
73
68
|
"""
|
|
74
69
|
if name == "current_time":
|
|
75
70
|
if name not in _cache:
|
|
76
|
-
_cache[name] = CurrentTime(
|
|
77
|
-
skill_store=store,
|
|
78
|
-
)
|
|
71
|
+
_cache[name] = CurrentTime()
|
|
79
72
|
return _cache[name]
|
|
80
73
|
else:
|
|
81
74
|
logger.warning(f"Unknown common skill: {name}")
|
intentkit/skills/common/base.py
CHANGED
|
@@ -2,7 +2,6 @@ from typing import Type
|
|
|
2
2
|
|
|
3
3
|
from pydantic import BaseModel, Field
|
|
4
4
|
|
|
5
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
6
5
|
from intentkit.skills.base import IntentKitSkill
|
|
7
6
|
|
|
8
7
|
|
|
@@ -12,9 +11,6 @@ class CommonBaseTool(IntentKitSkill):
|
|
|
12
11
|
name: str = Field(description="The name of the tool")
|
|
13
12
|
description: str = Field(description="A description of what the tool does")
|
|
14
13
|
args_schema: Type[BaseModel]
|
|
15
|
-
skill_store: SkillStoreABC = Field(
|
|
16
|
-
description="The skill store for persisting data"
|
|
17
|
-
)
|
|
18
14
|
|
|
19
15
|
@property
|
|
20
16
|
def category(self) -> str:
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
from typing import TypedDict
|
|
2
2
|
|
|
3
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
4
3
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
5
4
|
from intentkit.skills.cookiefun.base import CookieFunBaseTool, logger
|
|
6
5
|
from intentkit.skills.cookiefun.get_account_details import GetAccountDetails
|
|
@@ -35,7 +34,6 @@ class Config(SkillConfig):
|
|
|
35
34
|
async def get_skills(
|
|
36
35
|
config: "Config",
|
|
37
36
|
is_private: bool,
|
|
38
|
-
store: SkillStoreABC,
|
|
39
37
|
**_,
|
|
40
38
|
) -> list[CookieFunBaseTool]:
|
|
41
39
|
"""Get all CookieFun skills."""
|
|
@@ -49,28 +47,27 @@ async def get_skills(
|
|
|
49
47
|
available_skills.append(skill_name)
|
|
50
48
|
|
|
51
49
|
# Get each skill using the cached getter
|
|
52
|
-
skills = [get_cookiefun_skill(name
|
|
50
|
+
skills = [get_cookiefun_skill(name) for name in available_skills]
|
|
53
51
|
logger.info("Returning %d CookieFun skills", len(skills))
|
|
54
52
|
return skills
|
|
55
53
|
|
|
56
54
|
|
|
57
55
|
def get_cookiefun_skill(
|
|
58
56
|
name: str,
|
|
59
|
-
store: SkillStoreABC,
|
|
60
57
|
) -> CookieFunBaseTool:
|
|
61
58
|
"""Get a CookieFun skill by name."""
|
|
62
59
|
|
|
63
60
|
if name not in _cache:
|
|
64
61
|
if name == "get_sectors":
|
|
65
|
-
_cache[name] = GetSectors(
|
|
62
|
+
_cache[name] = GetSectors()
|
|
66
63
|
elif name == "get_account_details":
|
|
67
|
-
_cache[name] = GetAccountDetails(
|
|
64
|
+
_cache[name] = GetAccountDetails()
|
|
68
65
|
elif name == "get_account_smart_followers":
|
|
69
|
-
_cache[name] = GetAccountSmartFollowers(
|
|
66
|
+
_cache[name] = GetAccountSmartFollowers()
|
|
70
67
|
elif name == "search_accounts":
|
|
71
|
-
_cache[name] = SearchAccounts(
|
|
68
|
+
_cache[name] = SearchAccounts()
|
|
72
69
|
elif name == "get_account_feed":
|
|
73
|
-
_cache[name] = GetAccountFeed(
|
|
70
|
+
_cache[name] = GetAccountFeed()
|
|
74
71
|
else:
|
|
75
72
|
logger.error("Unknown CookieFun skill: %s", name)
|
|
76
73
|
raise ValueError(f"Unknown CookieFun skill: {name}")
|
|
@@ -4,7 +4,6 @@ from typing import Type
|
|
|
4
4
|
from langchain_core.tools.base import ToolException
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
6
6
|
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.base import IntentKitSkill
|
|
9
8
|
|
|
10
9
|
logger = logging.getLogger(__name__)
|
|
@@ -16,9 +15,6 @@ class CookieFunBaseTool(IntentKitSkill):
|
|
|
16
15
|
name: str = Field(description="The name of the tool")
|
|
17
16
|
description: str = Field(description="A description of what the tool does")
|
|
18
17
|
args_schema: Type[BaseModel]
|
|
19
|
-
skill_store: SkillStoreABC = Field(
|
|
20
|
-
description="The skill store for persisting data"
|
|
21
|
-
)
|
|
22
18
|
|
|
23
19
|
@property
|
|
24
20
|
def category(self) -> str:
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.cryptocompare.base import CryptoCompareBaseTool
|
|
9
8
|
from intentkit.skills.cryptocompare.fetch_news import CryptoCompareFetchNews
|
|
@@ -44,7 +43,6 @@ class Config(SkillConfig):
|
|
|
44
43
|
async def get_skills(
|
|
45
44
|
config: "Config",
|
|
46
45
|
is_private: bool,
|
|
47
|
-
store: SkillStoreABC,
|
|
48
46
|
**_,
|
|
49
47
|
) -> list[CryptoCompareBaseTool]:
|
|
50
48
|
"""Get all CryptoCompare skills.
|
|
@@ -52,7 +50,6 @@ async def get_skills(
|
|
|
52
50
|
Args:
|
|
53
51
|
config: The configuration for CryptoCompare skills.
|
|
54
52
|
is_private: Whether to include private skills.
|
|
55
|
-
store: The skill store for persisting data.
|
|
56
53
|
|
|
57
54
|
Returns:
|
|
58
55
|
A list of CryptoCompare skills.
|
|
@@ -69,7 +66,7 @@ async def get_skills(
|
|
|
69
66
|
# Get each skill using the cached getter
|
|
70
67
|
result = []
|
|
71
68
|
for name in available_skills:
|
|
72
|
-
skill = get_cryptocompare_skill(name
|
|
69
|
+
skill = get_cryptocompare_skill(name)
|
|
73
70
|
if skill:
|
|
74
71
|
result.append(skill)
|
|
75
72
|
return result
|
|
@@ -77,13 +74,11 @@ async def get_skills(
|
|
|
77
74
|
|
|
78
75
|
def get_cryptocompare_skill(
|
|
79
76
|
name: str,
|
|
80
|
-
store: SkillStoreABC,
|
|
81
77
|
) -> CryptoCompareBaseTool:
|
|
82
78
|
"""Get a CryptoCompare skill by name.
|
|
83
79
|
|
|
84
80
|
Args:
|
|
85
81
|
name: The name of the skill to get
|
|
86
|
-
store: The skill store for persisting data
|
|
87
82
|
|
|
88
83
|
Returns:
|
|
89
84
|
The requested CryptoCompare skill
|
|
@@ -91,39 +86,27 @@ def get_cryptocompare_skill(
|
|
|
91
86
|
|
|
92
87
|
if name == "fetch_news":
|
|
93
88
|
if name not in _cache:
|
|
94
|
-
_cache[name] = CryptoCompareFetchNews(
|
|
95
|
-
skill_store=store,
|
|
96
|
-
)
|
|
89
|
+
_cache[name] = CryptoCompareFetchNews()
|
|
97
90
|
return _cache[name]
|
|
98
91
|
elif name == "fetch_price":
|
|
99
92
|
if name not in _cache:
|
|
100
|
-
_cache[name] = CryptoCompareFetchPrice(
|
|
101
|
-
skill_store=store,
|
|
102
|
-
)
|
|
93
|
+
_cache[name] = CryptoCompareFetchPrice()
|
|
103
94
|
return _cache[name]
|
|
104
95
|
elif name == "fetch_trading_signals":
|
|
105
96
|
if name not in _cache:
|
|
106
|
-
_cache[name] = CryptoCompareFetchTradingSignals(
|
|
107
|
-
skill_store=store,
|
|
108
|
-
)
|
|
97
|
+
_cache[name] = CryptoCompareFetchTradingSignals()
|
|
109
98
|
return _cache[name]
|
|
110
99
|
elif name == "fetch_top_market_cap":
|
|
111
100
|
if name not in _cache:
|
|
112
|
-
_cache[name] = CryptoCompareFetchTopMarketCap(
|
|
113
|
-
skill_store=store,
|
|
114
|
-
)
|
|
101
|
+
_cache[name] = CryptoCompareFetchTopMarketCap()
|
|
115
102
|
return _cache[name]
|
|
116
103
|
elif name == "fetch_top_exchanges":
|
|
117
104
|
if name not in _cache:
|
|
118
|
-
_cache[name] = CryptoCompareFetchTopExchanges(
|
|
119
|
-
skill_store=store,
|
|
120
|
-
)
|
|
105
|
+
_cache[name] = CryptoCompareFetchTopExchanges()
|
|
121
106
|
return _cache[name]
|
|
122
107
|
elif name == "fetch_top_volume":
|
|
123
108
|
if name not in _cache:
|
|
124
|
-
_cache[name] = CryptoCompareFetchTopVolume(
|
|
125
|
-
skill_store=store,
|
|
126
|
-
)
|
|
109
|
+
_cache[name] = CryptoCompareFetchTopVolume()
|
|
127
110
|
return _cache[name]
|
|
128
111
|
else:
|
|
129
112
|
logger.warning(f"Unknown CryptoCompare skill: {name}")
|
|
@@ -7,7 +7,6 @@ from typing import Any, Dict, List, Type
|
|
|
7
7
|
import httpx
|
|
8
8
|
from pydantic import BaseModel, Field
|
|
9
9
|
|
|
10
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
11
10
|
from intentkit.skills.base import IntentKitSkill
|
|
12
11
|
from intentkit.utils.error import RateLimitExceeded
|
|
13
12
|
|
|
@@ -22,36 +21,27 @@ class CryptoCompareBaseTool(IntentKitSkill):
|
|
|
22
21
|
This class provides common functionality for all CryptoCompare API tools:
|
|
23
22
|
- Rate limiting
|
|
24
23
|
- API client handling
|
|
25
|
-
- State management through skill_store
|
|
26
24
|
"""
|
|
27
25
|
|
|
28
26
|
name: str = Field(description="The name of the tool")
|
|
29
27
|
description: str = Field(description="A description of what the tool does")
|
|
30
28
|
args_schema: Type[BaseModel]
|
|
31
|
-
skill_store: SkillStoreABC = Field(
|
|
32
|
-
description="The skill store for persisting data"
|
|
33
|
-
)
|
|
34
29
|
|
|
35
30
|
@property
|
|
36
31
|
def category(self) -> str:
|
|
37
32
|
return "cryptocompare"
|
|
38
33
|
|
|
39
|
-
async def check_rate_limit(
|
|
40
|
-
self, agent_id: str, max_requests: int = 1, interval: int = 15
|
|
41
|
-
) -> None:
|
|
34
|
+
async def check_rate_limit(self, max_requests: int = 1, interval: int = 15) -> None:
|
|
42
35
|
"""Check if the rate limit has been exceeded.
|
|
43
36
|
|
|
44
37
|
Args:
|
|
45
|
-
agent_id: The ID of the agent.
|
|
46
38
|
max_requests: Maximum number of requests allowed within the rate limit window.
|
|
47
39
|
interval: Time interval in minutes for the rate limit window.
|
|
48
40
|
|
|
49
41
|
Raises:
|
|
50
42
|
RateLimitExceeded: If the rate limit has been exceeded.
|
|
51
43
|
"""
|
|
52
|
-
rate_limit = await self.
|
|
53
|
-
agent_id, self.name, "rate_limit"
|
|
54
|
-
)
|
|
44
|
+
rate_limit = await self.get_agent_skill_data("rate_limit")
|
|
55
45
|
|
|
56
46
|
current_time = datetime.now(tz=timezone.utc)
|
|
57
47
|
|
|
@@ -65,9 +55,7 @@ class CryptoCompareBaseTool(IntentKitSkill):
|
|
|
65
55
|
raise RateLimitExceeded("Rate limit exceeded")
|
|
66
56
|
|
|
67
57
|
rate_limit["count"] += 1
|
|
68
|
-
await self.
|
|
69
|
-
agent_id, self.name, "rate_limit", rate_limit
|
|
70
|
-
)
|
|
58
|
+
await self.save_agent_skill_data("rate_limit", rate_limit)
|
|
71
59
|
|
|
72
60
|
return
|
|
73
61
|
|
|
@@ -76,9 +64,7 @@ class CryptoCompareBaseTool(IntentKitSkill):
|
|
|
76
64
|
"count": 1,
|
|
77
65
|
"reset_time": (current_time + timedelta(minutes=interval)).isoformat(),
|
|
78
66
|
}
|
|
79
|
-
await self.
|
|
80
|
-
agent_id, self.name, "rate_limit", new_rate_limit
|
|
81
|
-
)
|
|
67
|
+
await self.save_agent_skill_data("rate_limit", new_rate_limit)
|
|
82
68
|
return
|
|
83
69
|
|
|
84
70
|
async def fetch_price(
|
|
@@ -56,7 +56,7 @@ class CryptoCompareFetchNews(CryptoCompareBaseTool):
|
|
|
56
56
|
skill_config = context.agent.skill_config(self.category)
|
|
57
57
|
|
|
58
58
|
# Check rate limit
|
|
59
|
-
await self.check_rate_limit(
|
|
59
|
+
await self.check_rate_limit(max_requests=5, interval=60)
|
|
60
60
|
|
|
61
61
|
# Get API key from context
|
|
62
62
|
api_key = skill_config.get("api_key")
|
|
@@ -66,7 +66,7 @@ class CryptoCompareFetchPrice(CryptoCompareBaseTool):
|
|
|
66
66
|
skill_config = context.agent.skill_config(self.category)
|
|
67
67
|
|
|
68
68
|
# Check rate limit
|
|
69
|
-
await self.check_rate_limit(
|
|
69
|
+
await self.check_rate_limit(max_requests=10, interval=60)
|
|
70
70
|
|
|
71
71
|
# Get API key from context
|
|
72
72
|
api_key = skill_config.get("api_key")
|
|
@@ -72,7 +72,7 @@ class CryptoCompareFetchTopExchanges(CryptoCompareBaseTool):
|
|
|
72
72
|
skill_config = context.agent.skill_config(self.category)
|
|
73
73
|
|
|
74
74
|
# Check rate limit
|
|
75
|
-
await self.check_rate_limit(
|
|
75
|
+
await self.check_rate_limit(max_requests=5, interval=60)
|
|
76
76
|
|
|
77
77
|
# Get API key from context
|
|
78
78
|
api_key = skill_config.get("api_key")
|
|
@@ -65,7 +65,7 @@ class CryptoCompareFetchTopMarketCap(CryptoCompareBaseTool):
|
|
|
65
65
|
skill_config = context.agent.skill_config(self.category)
|
|
66
66
|
|
|
67
67
|
# Check rate limit
|
|
68
|
-
await self.check_rate_limit(
|
|
68
|
+
await self.check_rate_limit(max_requests=5, interval=60)
|
|
69
69
|
|
|
70
70
|
# Get API key from context
|
|
71
71
|
api_key = skill_config.get("api_key")
|
|
@@ -64,7 +64,7 @@ class CryptoCompareFetchTopVolume(CryptoCompareBaseTool):
|
|
|
64
64
|
skill_config = context.agent.skill_config(self.category)
|
|
65
65
|
|
|
66
66
|
# Check rate limit
|
|
67
|
-
await self.check_rate_limit(
|
|
67
|
+
await self.check_rate_limit(max_requests=5, interval=60)
|
|
68
68
|
|
|
69
69
|
# Get API key from context
|
|
70
70
|
api_key = skill_config.get("api_key")
|
|
@@ -67,7 +67,7 @@ class CryptoCompareFetchTradingSignals(CryptoCompareBaseTool):
|
|
|
67
67
|
skill_config = context.agent.skill_config(self.category)
|
|
68
68
|
|
|
69
69
|
# Check rate limit
|
|
70
|
-
await self.check_rate_limit(
|
|
70
|
+
await self.check_rate_limit(max_requests=5, interval=60)
|
|
71
71
|
|
|
72
72
|
# Get API key from context
|
|
73
73
|
api_key = skill_config.get("api_key")
|