intentkit 0.8.12.dev2__py3-none-any.whl → 0.8.12.dev3__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/skill.py +2 -59
- intentkit/clients/twitter.py +35 -28
- intentkit/core/agent.py +2 -279
- intentkit/core/engine.py +2 -3
- intentkit/models/agent.py +109 -89
- intentkit/models/agent_schema.json +4 -2
- 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 +101 -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 +1 -2
- intentkit/skills/casino/deck_shuffle.py +1 -2
- intentkit/skills/casino/dice_roll.py +1 -2
- intentkit/skills/cdp/__init__.py +0 -4
- intentkit/skills/cdp/base.py +0 -4
- 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 +0 -5
- 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 +0 -4
- 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/route.py +1 -3
- 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/crawl.py +10 -9
- intentkit/skills/firecrawl/query.py +3 -1
- intentkit/skills/firecrawl/scrape.py +8 -10
- intentkit/skills/firecrawl/utils.py +25 -26
- 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 +14 -16
- intentkit/skills/twitter/follow_user.py +0 -1
- intentkit/skills/twitter/get_mentions.py +0 -1
- intentkit/skills/twitter/get_timeline.py +0 -1
- intentkit/skills/twitter/get_user_by_username.py +0 -1
- intentkit/skills/twitter/get_user_tweets.py +0 -1
- intentkit/skills/twitter/like_tweet.py +0 -1
- intentkit/skills/twitter/post_tweet.py +2 -2
- intentkit/skills/twitter/reply_tweet.py +2 -2
- intentkit/skills/twitter/retweet.py +0 -1
- intentkit/skills/twitter/search_tweets.py +0 -1
- 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 -8
- intentkit/skills/web_scraper/utils.py +31 -27
- 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.12.dev2.dist-info → intentkit-0.8.12.dev3.dist-info}/METADATA +1 -1
- {intentkit-0.8.12.dev2.dist-info → intentkit-0.8.12.dev3.dist-info}/RECORD +168 -168
- {intentkit-0.8.12.dev2.dist-info → intentkit-0.8.12.dev3.dist-info}/WHEEL +0 -0
- {intentkit-0.8.12.dev2.dist-info → intentkit-0.8.12.dev3.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.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,15 +21,11 @@ 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:
|
|
@@ -6,7 +6,6 @@ Loads and initializes skills for fetching crypto news and providing market insig
|
|
|
6
6
|
import logging
|
|
7
7
|
from typing import Dict, List, Optional, TypedDict
|
|
8
8
|
|
|
9
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
10
9
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
11
10
|
|
|
12
11
|
from .base import CryptopanicBaseTool
|
|
@@ -34,7 +33,6 @@ class Config(SkillConfig):
|
|
|
34
33
|
async def get_skills(
|
|
35
34
|
config: Config,
|
|
36
35
|
is_private: bool,
|
|
37
|
-
store: SkillStoreABC,
|
|
38
36
|
**kwargs,
|
|
39
37
|
) -> List[CryptopanicBaseTool]:
|
|
40
38
|
"""Load CryptoPanic skills based on configuration.
|
|
@@ -60,7 +58,7 @@ async def get_skills(
|
|
|
60
58
|
|
|
61
59
|
loaded_skills = []
|
|
62
60
|
for name in available_skills:
|
|
63
|
-
skill = get_cryptopanic_skill(name
|
|
61
|
+
skill = get_cryptopanic_skill(name)
|
|
64
62
|
if skill:
|
|
65
63
|
logger.info("Successfully loaded skill: %s", name)
|
|
66
64
|
loaded_skills.append(skill)
|
|
@@ -72,7 +70,6 @@ async def get_skills(
|
|
|
72
70
|
|
|
73
71
|
def get_cryptopanic_skill(
|
|
74
72
|
name: str,
|
|
75
|
-
store: SkillStoreABC,
|
|
76
73
|
) -> Optional[CryptopanicBaseTool]:
|
|
77
74
|
"""Retrieve a CryptoPanic skill instance by name.
|
|
78
75
|
|
|
@@ -91,11 +88,11 @@ def get_cryptopanic_skill(
|
|
|
91
88
|
if name == "fetch_crypto_news":
|
|
92
89
|
from .fetch_crypto_news import FetchCryptoNews
|
|
93
90
|
|
|
94
|
-
_skill_cache[name] = FetchCryptoNews(
|
|
91
|
+
_skill_cache[name] = FetchCryptoNews()
|
|
95
92
|
elif name == "fetch_crypto_sentiment":
|
|
96
93
|
from .fetch_crypto_sentiment import FetchCryptoSentiment
|
|
97
94
|
|
|
98
|
-
_skill_cache[name] = FetchCryptoSentiment(
|
|
95
|
+
_skill_cache[name] = FetchCryptoSentiment()
|
|
99
96
|
else:
|
|
100
97
|
logger.warning("Unknown CryptoPanic skill: %s", name)
|
|
101
98
|
return None
|
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
"""Base module for CryptoPanic skills.
|
|
2
|
-
|
|
3
|
-
Defines the base class and shared utilities for CryptoPanic skills.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from typing import Type
|
|
7
|
-
|
|
8
|
-
from langchain_core.tools.base import ToolException
|
|
9
|
-
from pydantic import BaseModel, Field
|
|
10
|
-
|
|
11
|
-
from intentkit.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"""Category of the skill."""
|
|
55
|
-
return "cryptopanic"
|
|
1
|
+
"""Base module for CryptoPanic skills.
|
|
2
|
+
|
|
3
|
+
Defines the base class and shared utilities for CryptoPanic skills.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from typing import Type
|
|
7
|
+
|
|
8
|
+
from langchain_core.tools.base import ToolException
|
|
9
|
+
from pydantic import BaseModel, Field
|
|
10
|
+
|
|
11
|
+
from intentkit.skills.base import IntentKitSkill
|
|
12
|
+
|
|
13
|
+
base_url = "https://cryptopanic.com/api/v1/posts/"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class CryptopanicBaseTool(IntentKitSkill):
|
|
17
|
+
"""Base class for CryptoPanic skills.
|
|
18
|
+
|
|
19
|
+
Provides common functionality for interacting with the CryptoPanic API,
|
|
20
|
+
including API key retrieval and shared helpers.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
name: str = Field(description="Tool name")
|
|
24
|
+
description: str = Field(description="Tool description")
|
|
25
|
+
args_schema: Type[BaseModel]
|
|
26
|
+
|
|
27
|
+
def get_api_key(self) -> str:
|
|
28
|
+
"""Retrieve the CryptoPanic API key from context.
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
API key string.
|
|
32
|
+
|
|
33
|
+
Raises:
|
|
34
|
+
ToolException: If the API key is not found.
|
|
35
|
+
"""
|
|
36
|
+
context = self.get_context()
|
|
37
|
+
skill_config = context.agent.skill_config(self.category)
|
|
38
|
+
api_key_provider = skill_config.get("api_key_provider")
|
|
39
|
+
if api_key_provider == "agent_owner":
|
|
40
|
+
api_key = skill_config.get("api_key")
|
|
41
|
+
if api_key:
|
|
42
|
+
return api_key
|
|
43
|
+
else:
|
|
44
|
+
raise ToolException("No api_key found in agent_owner configuration")
|
|
45
|
+
else:
|
|
46
|
+
raise ToolException(
|
|
47
|
+
f"Invalid API key provider: {api_key_provider}. Only 'agent_owner' is supported for CryptoPanic."
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def category(self) -> str:
|
|
52
|
+
"""Category of the skill."""
|
|
53
|
+
return "cryptopanic"
|
|
@@ -8,7 +8,6 @@ from typing import List, Type
|
|
|
8
8
|
import httpx
|
|
9
9
|
from pydantic import BaseModel, Field
|
|
10
10
|
|
|
11
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
12
11
|
from intentkit.skills.cryptopanic.base import CryptopanicBaseTool
|
|
13
12
|
|
|
14
13
|
SUPPORTED_CURRENCIES = ["BTC", "ETH"]
|
|
@@ -49,7 +48,6 @@ class FetchCryptoNews(CryptopanicBaseTool):
|
|
|
49
48
|
"sorted by publication date (newest first). Defaults to BTC."
|
|
50
49
|
)
|
|
51
50
|
args_schema: Type[BaseModel] = CryptopanicNewsInput
|
|
52
|
-
skill_store: SkillStoreABC = Field(description="Skill store for data persistence")
|
|
53
51
|
|
|
54
52
|
async def fetch_news(
|
|
55
53
|
self,
|
|
@@ -4,7 +4,6 @@ from typing import ClassVar, List, Type
|
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
6
6
|
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.cryptopanic.base import CryptopanicBaseTool
|
|
9
8
|
|
|
10
9
|
SUPPORTED_CURRENCIES = ["BTC", "ETH"]
|
|
@@ -45,7 +44,6 @@ class FetchCryptoSentiment(CryptopanicBaseTool):
|
|
|
45
44
|
"Defaults to BTC."
|
|
46
45
|
)
|
|
47
46
|
args_schema: Type[BaseModel] = CryptopanicSentimentInput
|
|
48
|
-
skill_store: SkillStoreABC = Field(description="Skill store for data persistence")
|
|
49
47
|
|
|
50
48
|
INSIGHTS_PROMPT: ClassVar[str] = """
|
|
51
49
|
CryptoPanic Headlines for {currency}:
|
|
@@ -90,7 +88,7 @@ Conclude with a short-term outlook for {currency}. Provide a concise, profession
|
|
|
90
88
|
currency = "BTC"
|
|
91
89
|
|
|
92
90
|
# Instantiate FetchCryptoNews
|
|
93
|
-
news_skill = FetchCryptoNews(
|
|
91
|
+
news_skill = FetchCryptoNews()
|
|
94
92
|
|
|
95
93
|
try:
|
|
96
94
|
news_output: CryptopanicNewsOutput = await news_skill._arun(
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import NotRequired, TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.dapplooker.base import DappLookerBaseTool
|
|
9
8
|
from intentkit.skills.dapplooker.dapplooker_token_data import DappLookerTokenData
|
|
@@ -28,7 +27,6 @@ class Config(SkillConfig):
|
|
|
28
27
|
async def get_skills(
|
|
29
28
|
config: "Config",
|
|
30
29
|
is_private: bool,
|
|
31
|
-
store: SkillStoreABC,
|
|
32
30
|
**_,
|
|
33
31
|
) -> list[DappLookerBaseTool]:
|
|
34
32
|
"""Get all DappLooker skills.
|
|
@@ -36,7 +34,6 @@ async def get_skills(
|
|
|
36
34
|
Args:
|
|
37
35
|
config: The configuration for DappLooker skills.
|
|
38
36
|
is_private: Whether to include private skills.
|
|
39
|
-
store: The skill store for persisting data.
|
|
40
37
|
|
|
41
38
|
Returns:
|
|
42
39
|
A list of DappLooker skills.
|
|
@@ -53,7 +50,7 @@ async def get_skills(
|
|
|
53
50
|
# Get each skill using the cached getter
|
|
54
51
|
result = []
|
|
55
52
|
for name in available_skills:
|
|
56
|
-
skill = get_dapplooker_skill(name
|
|
53
|
+
skill = get_dapplooker_skill(name)
|
|
57
54
|
if skill:
|
|
58
55
|
result.append(skill)
|
|
59
56
|
return result
|
|
@@ -61,22 +58,18 @@ async def get_skills(
|
|
|
61
58
|
|
|
62
59
|
def get_dapplooker_skill(
|
|
63
60
|
name: str,
|
|
64
|
-
store: SkillStoreABC,
|
|
65
61
|
) -> DappLookerBaseTool:
|
|
66
62
|
"""Get a DappLooker skill by name.
|
|
67
63
|
|
|
68
64
|
Args:
|
|
69
65
|
name: The name of the skill to get
|
|
70
|
-
store: The skill store for persisting data
|
|
71
66
|
|
|
72
67
|
Returns:
|
|
73
68
|
The requested DappLooker skill
|
|
74
69
|
"""
|
|
75
70
|
if name == "dapplooker_token_data":
|
|
76
71
|
if name not in _cache:
|
|
77
|
-
_cache[name] = DappLookerTokenData(
|
|
78
|
-
skill_store=store,
|
|
79
|
-
)
|
|
72
|
+
_cache[name] = DappLookerTokenData()
|
|
80
73
|
return _cache[name]
|
|
81
74
|
else:
|
|
82
75
|
logger.warning(f"Unknown DappLooker skill: {name}")
|
|
@@ -3,7 +3,7 @@ from typing import Type
|
|
|
3
3
|
from langchain_core.tools.base import ToolException
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
6
|
-
from intentkit.
|
|
6
|
+
from intentkit.config.config import config
|
|
7
7
|
from intentkit.skills.base import IntentKitSkill
|
|
8
8
|
|
|
9
9
|
|
|
@@ -13,16 +13,13 @@ class DappLookerBaseTool(IntentKitSkill):
|
|
|
13
13
|
name: str = Field(description="The name of the tool")
|
|
14
14
|
description: str = Field(description="A description of what the tool does")
|
|
15
15
|
args_schema: Type[BaseModel]
|
|
16
|
-
skill_store: SkillStoreABC = Field(
|
|
17
|
-
description="The skill store for persisting data"
|
|
18
|
-
)
|
|
19
16
|
|
|
20
17
|
def get_api_key(self) -> str:
|
|
21
18
|
context = self.get_context()
|
|
22
19
|
skill_config = context.agent.skill_config(self.category)
|
|
23
20
|
api_key_provider = skill_config.get("api_key_provider")
|
|
24
21
|
if api_key_provider == "platform":
|
|
25
|
-
return
|
|
22
|
+
return config.dapplooker_api_key
|
|
26
23
|
# for backward compatibility, may only have api_key in skill_config
|
|
27
24
|
elif skill_config.get("api_key"):
|
|
28
25
|
return skill_config.get("api_key")
|