intentkit 0.6.9.dev1__py3-none-any.whl → 0.6.10__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 +17 -2
- intentkit/core/engine.py +49 -30
- intentkit/core/node.py +10 -20
- intentkit/models/agent.py +215 -11
- intentkit/models/agent_schema.json +4 -0
- intentkit/models/chat.py +9 -1
- intentkit/models/llm.py +53 -0
- intentkit/skills/acolyt/ask.py +2 -5
- intentkit/skills/acolyt/base.py +16 -6
- intentkit/skills/aixbt/__init__.py +3 -7
- intentkit/skills/aixbt/projects.py +12 -36
- intentkit/skills/allora/base.py +16 -6
- intentkit/skills/allora/price.py +2 -4
- intentkit/skills/base.py +8 -1
- intentkit/skills/carv/base.py +12 -10
- intentkit/skills/carv/fetch_news.py +90 -92
- intentkit/skills/carv/onchain_query.py +162 -164
- intentkit/skills/carv/token_info_and_price.py +108 -110
- intentkit/skills/chainlist/chain_lookup.py +1 -2
- intentkit/skills/common/current_time.py +1 -2
- intentkit/skills/cookiefun/base.py +20 -12
- intentkit/skills/cookiefun/get_account_details.py +1 -3
- intentkit/skills/cookiefun/get_account_feed.py +1 -3
- intentkit/skills/cookiefun/get_account_smart_followers.py +1 -3
- intentkit/skills/cookiefun/get_sectors.py +2 -3
- intentkit/skills/cookiefun/search_accounts.py +1 -3
- intentkit/skills/cryptocompare/fetch_news.py +3 -4
- intentkit/skills/cryptocompare/fetch_price.py +3 -4
- intentkit/skills/cryptocompare/fetch_top_exchanges.py +3 -4
- intentkit/skills/cryptocompare/fetch_top_market_cap.py +3 -4
- intentkit/skills/cryptocompare/fetch_top_volume.py +3 -4
- intentkit/skills/cryptocompare/fetch_trading_signals.py +3 -4
- intentkit/skills/cryptopanic/base.py +13 -9
- intentkit/skills/cryptopanic/fetch_crypto_news.py +150 -153
- intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +133 -136
- intentkit/skills/dapplooker/base.py +16 -6
- intentkit/skills/dapplooker/dapplooker_token_data.py +2 -4
- intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +2 -3
- intentkit/skills/defillama/coins/fetch_block.py +2 -3
- intentkit/skills/defillama/coins/fetch_current_prices.py +2 -5
- intentkit/skills/defillama/coins/fetch_first_price.py +2 -5
- intentkit/skills/defillama/coins/fetch_historical_prices.py +2 -3
- intentkit/skills/defillama/coins/fetch_price_chart.py +2 -5
- intentkit/skills/defillama/coins/fetch_price_percentage.py +2 -5
- intentkit/skills/defillama/fees/fetch_fees_overview.py +2 -3
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +2 -3
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +2 -3
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +2 -3
- intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +2 -3
- intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -5
- intentkit/skills/defillama/tvl/fetch_chains.py +2 -3
- intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -3
- intentkit/skills/defillama/tvl/fetch_protocol.py +2 -5
- intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +2 -5
- intentkit/skills/defillama/tvl/fetch_protocols.py +2 -3
- intentkit/skills/defillama/volumes/fetch_dex_overview.py +2 -3
- intentkit/skills/defillama/volumes/fetch_dex_summary.py +2 -5
- intentkit/skills/defillama/volumes/fetch_options_overview.py +2 -3
- intentkit/skills/defillama/yields/fetch_pool_chart.py +2 -5
- intentkit/skills/defillama/yields/fetch_pools.py +2 -3
- intentkit/skills/dune_analytics/base.py +15 -9
- intentkit/skills/dune_analytics/fetch_kol_buys.py +125 -128
- intentkit/skills/dune_analytics/fetch_nation_metrics.py +234 -237
- intentkit/skills/elfa/base.py +16 -6
- intentkit/skills/elfa/mention.py +2 -7
- intentkit/skills/elfa/stats.py +2 -6
- intentkit/skills/elfa/tokens.py +1 -4
- intentkit/skills/enso/base.py +25 -13
- intentkit/skills/enso/best_yield.py +1 -4
- intentkit/skills/enso/networks.py +2 -5
- intentkit/skills/enso/prices.py +1 -5
- intentkit/skills/enso/route.py +2 -5
- intentkit/skills/enso/tokens.py +1 -4
- intentkit/skills/enso/wallet.py +3 -9
- intentkit/skills/firecrawl/base.py +16 -6
- intentkit/skills/firecrawl/clear.py +1 -3
- intentkit/skills/firecrawl/crawl.py +7 -8
- intentkit/skills/firecrawl/query.py +7 -9
- intentkit/skills/firecrawl/scrape.py +7 -8
- intentkit/skills/github/github_search.py +1 -3
- intentkit/skills/heurist/base.py +15 -0
- intentkit/skills/heurist/image_generation_animagine_xl.py +3 -4
- intentkit/skills/heurist/image_generation_arthemy_comics.py +3 -4
- intentkit/skills/heurist/image_generation_arthemy_real.py +3 -4
- intentkit/skills/heurist/image_generation_braindance.py +3 -4
- intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +3 -4
- intentkit/skills/heurist/image_generation_flux_1_dev.py +3 -4
- intentkit/skills/heurist/image_generation_sdxl.py +3 -4
- intentkit/skills/http/get.py +0 -2
- intentkit/skills/http/post.py +0 -2
- intentkit/skills/http/put.py +0 -2
- intentkit/skills/lifi/token_execute.py +1 -3
- intentkit/skills/lifi/token_quote.py +0 -2
- intentkit/skills/moralis/base.py +15 -1
- intentkit/skills/nation/nft_check.py +2 -5
- intentkit/skills/openai/base.py +14 -5
- intentkit/skills/openai/dalle_image_generation.py +6 -5
- intentkit/skills/openai/gpt_image_generation.py +6 -5
- intentkit/skills/openai/gpt_image_to_image.py +6 -5
- intentkit/skills/openai/image_to_text.py +6 -6
- intentkit/skills/portfolio/base.py +4 -3
- intentkit/skills/portfolio/token_balances.py +2 -4
- intentkit/skills/portfolio/wallet_approvals.py +2 -4
- intentkit/skills/portfolio/wallet_defi_positions.py +3 -4
- intentkit/skills/portfolio/wallet_history.py +2 -4
- intentkit/skills/portfolio/wallet_net_worth.py +2 -4
- intentkit/skills/portfolio/wallet_nfts.py +2 -4
- intentkit/skills/portfolio/wallet_profitability.py +2 -4
- intentkit/skills/portfolio/wallet_profitability_summary.py +2 -4
- intentkit/skills/portfolio/wallet_stats.py +2 -4
- intentkit/skills/portfolio/wallet_swaps.py +2 -4
- intentkit/skills/slack/base.py +18 -0
- intentkit/skills/slack/get_channel.py +3 -4
- intentkit/skills/slack/get_message.py +3 -4
- intentkit/skills/slack/schedule_message.py +3 -4
- intentkit/skills/slack/send_message.py +3 -4
- intentkit/skills/supabase/delete_data.py +3 -6
- intentkit/skills/supabase/fetch_data.py +3 -6
- intentkit/skills/supabase/insert_data.py +3 -6
- intentkit/skills/supabase/invoke_function.py +3 -6
- intentkit/skills/supabase/update_data.py +3 -6
- intentkit/skills/supabase/upsert_data.py +3 -6
- intentkit/skills/system/add_autonomous_task.py +1 -3
- intentkit/skills/system/delete_autonomous_task.py +1 -3
- intentkit/skills/system/edit_autonomous_task.py +1 -3
- intentkit/skills/system/list_autonomous_tasks.py +1 -3
- intentkit/skills/system/read_agent_api_key.py +2 -3
- intentkit/skills/system/regenerate_agent_api_key.py +2 -5
- intentkit/skills/tavily/base.py +14 -5
- intentkit/skills/tavily/tavily_extract.py +7 -8
- intentkit/skills/tavily/tavily_search.py +11 -9
- intentkit/skills/token/base.py +4 -6
- intentkit/skills/token/erc20_transfers.py +2 -4
- intentkit/skills/token/token_analytics.py +2 -4
- intentkit/skills/token/token_price.py +2 -4
- intentkit/skills/token/token_search.py +2 -4
- intentkit/skills/twitter/base.py +41 -0
- intentkit/skills/twitter/follow_user.py +4 -4
- intentkit/skills/twitter/get_mentions.py +4 -4
- intentkit/skills/twitter/get_timeline.py +4 -4
- intentkit/skills/twitter/get_user_by_username.py +4 -4
- intentkit/skills/twitter/get_user_tweets.py +4 -4
- intentkit/skills/twitter/like_tweet.py +4 -4
- intentkit/skills/twitter/post_tweet.py +3 -4
- intentkit/skills/twitter/reply_tweet.py +3 -4
- intentkit/skills/twitter/retweet.py +4 -4
- intentkit/skills/twitter/search_tweets.py +4 -4
- intentkit/skills/unrealspeech/base.py +16 -0
- intentkit/skills/unrealspeech/text_to_speech.py +4 -4
- intentkit/skills/venice_audio/base.py +11 -9
- intentkit/skills/venice_audio/venice_audio.py +238 -240
- intentkit/skills/venice_image/base.py +23 -19
- intentkit/skills/venice_image/image_enhance/image_enhance.py +78 -80
- intentkit/skills/venice_image/image_generation/image_generation_base.py +115 -117
- intentkit/skills/venice_image/image_upscale/image_upscale.py +88 -90
- intentkit/skills/venice_image/image_vision/image_vision.py +98 -100
- intentkit/skills/web_scraper/document_indexer.py +3 -5
- intentkit/skills/web_scraper/scrape_and_index.py +14 -17
- intentkit/skills/web_scraper/website_indexer.py +8 -10
- intentkit/skills/xmtp/README.md +110 -0
- intentkit/skills/xmtp/__init__.py +82 -0
- intentkit/skills/xmtp/base.py +15 -0
- intentkit/skills/xmtp/schema.json +43 -0
- intentkit/skills/xmtp/transfer.py +155 -0
- intentkit/skills/xmtp/xmtp.png +0 -0
- {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dist-info}/METADATA +4 -3
- {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dist-info}/RECORD +170 -164
- {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dist-info}/WHEEL +0 -0
- {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Any, Dict, Optional, Type, Union
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
|
-
from langchain_core.runnables import RunnableConfig
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
6
5
|
|
|
7
6
|
from intentkit.skills.cookiefun.base import CookieFunBaseTool, logger
|
|
@@ -31,7 +30,6 @@ class GetAccountDetails(CookieFunBaseTool):
|
|
|
31
30
|
|
|
32
31
|
async def _arun(
|
|
33
32
|
self,
|
|
34
|
-
config: RunnableConfig,
|
|
35
33
|
username: Optional[str] = None,
|
|
36
34
|
userId: Optional[str] = None,
|
|
37
35
|
**kwargs,
|
|
@@ -57,7 +55,7 @@ class GetAccountDetails(CookieFunBaseTool):
|
|
|
57
55
|
|
|
58
56
|
try:
|
|
59
57
|
# Get context to retrieve API key
|
|
60
|
-
api_key = self.get_api_key(
|
|
58
|
+
api_key = self.get_api_key()
|
|
61
59
|
|
|
62
60
|
if not api_key:
|
|
63
61
|
logger.error("No API key provided for CookieFun API")
|
|
@@ -2,7 +2,6 @@ from enum import IntEnum
|
|
|
2
2
|
from typing import Any, Dict, List, Optional, Type, Union
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
|
-
from langchain_core.runnables import RunnableConfig
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
8
7
|
from intentkit.skills.cookiefun.base import CookieFunBaseTool, logger
|
|
@@ -84,7 +83,6 @@ class GetAccountFeed(CookieFunBaseTool):
|
|
|
84
83
|
|
|
85
84
|
async def _arun(
|
|
86
85
|
self,
|
|
87
|
-
config: RunnableConfig,
|
|
88
86
|
username: Optional[str] = None,
|
|
89
87
|
userId: Optional[str] = None,
|
|
90
88
|
startDate: Optional[str] = None,
|
|
@@ -130,7 +128,7 @@ class GetAccountFeed(CookieFunBaseTool):
|
|
|
130
128
|
|
|
131
129
|
try:
|
|
132
130
|
# Get context to retrieve API key
|
|
133
|
-
api_key = self.get_api_key(
|
|
131
|
+
api_key = self.get_api_key()
|
|
134
132
|
|
|
135
133
|
if not api_key:
|
|
136
134
|
logger.error("No API key provided for CookieFun API")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Optional, Type, Union
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
|
-
from langchain_core.runnables import RunnableConfig
|
|
5
4
|
from pydantic import BaseModel, Field
|
|
6
5
|
|
|
7
6
|
from intentkit.skills.cookiefun.base import CookieFunBaseTool, logger
|
|
@@ -31,7 +30,6 @@ class GetAccountSmartFollowers(CookieFunBaseTool):
|
|
|
31
30
|
|
|
32
31
|
async def _arun(
|
|
33
32
|
self,
|
|
34
|
-
config: RunnableConfig,
|
|
35
33
|
username: Optional[str] = None,
|
|
36
34
|
userId: Optional[str] = None,
|
|
37
35
|
**kwargs,
|
|
@@ -57,7 +55,7 @@ class GetAccountSmartFollowers(CookieFunBaseTool):
|
|
|
57
55
|
|
|
58
56
|
try:
|
|
59
57
|
# Get context to retrieve API key
|
|
60
|
-
api_key = self.get_api_key(
|
|
58
|
+
api_key = self.get_api_key()
|
|
61
59
|
|
|
62
60
|
if not api_key:
|
|
63
61
|
logger.error("No API key provided for CookieFun API")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from typing import Any, Dict, List, Type
|
|
2
2
|
|
|
3
3
|
import httpx
|
|
4
|
-
from langchain_core.runnables import RunnableConfig
|
|
5
4
|
from pydantic import BaseModel
|
|
6
5
|
|
|
7
6
|
from intentkit.skills.cookiefun.base import CookieFunBaseTool, logger
|
|
@@ -23,7 +22,7 @@ class GetSectors(CookieFunBaseTool):
|
|
|
23
22
|
)
|
|
24
23
|
args_schema: Type[BaseModel] = GetSectorsInput
|
|
25
24
|
|
|
26
|
-
async def _arun(self,
|
|
25
|
+
async def _arun(self, **kwargs) -> List[Dict[str, Any]]:
|
|
27
26
|
"""
|
|
28
27
|
Get all available sectors from the CookieFun API.
|
|
29
28
|
|
|
@@ -33,7 +32,7 @@ class GetSectors(CookieFunBaseTool):
|
|
|
33
32
|
logger.info("Getting sectors from CookieFun API")
|
|
34
33
|
try:
|
|
35
34
|
# Get API key
|
|
36
|
-
api_key = self.get_api_key(
|
|
35
|
+
api_key = self.get_api_key()
|
|
37
36
|
|
|
38
37
|
if not api_key:
|
|
39
38
|
logger.error("No API key provided for CookieFun API")
|
|
@@ -2,7 +2,6 @@ from enum import IntEnum
|
|
|
2
2
|
from typing import Any, Dict, List, Optional, Type, Union
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
|
-
from langchain_core.runnables import RunnableConfig
|
|
6
5
|
from pydantic import BaseModel, Field
|
|
7
6
|
|
|
8
7
|
from intentkit.skills.cookiefun.base import CookieFunBaseTool, logger
|
|
@@ -64,7 +63,6 @@ class SearchAccounts(CookieFunBaseTool):
|
|
|
64
63
|
|
|
65
64
|
async def _arun(
|
|
66
65
|
self,
|
|
67
|
-
config: RunnableConfig,
|
|
68
66
|
searchQuery: str,
|
|
69
67
|
type: Optional[int] = None,
|
|
70
68
|
sortBy: Optional[int] = None,
|
|
@@ -97,7 +95,7 @@ class SearchAccounts(CookieFunBaseTool):
|
|
|
97
95
|
|
|
98
96
|
try:
|
|
99
97
|
# Get context to retrieve API key
|
|
100
|
-
api_key = self.get_api_key(
|
|
98
|
+
api_key = self.get_api_key()
|
|
101
99
|
|
|
102
100
|
if not api_key:
|
|
103
101
|
logger.error("No API key provided for CookieFun API")
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import List, Type
|
|
5
5
|
|
|
6
|
-
from langchain_core.runnables import RunnableConfig
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from intentkit.skills.cryptocompare.base import CryptoCompareBaseTool, CryptoNews
|
|
@@ -38,7 +37,6 @@ class CryptoCompareFetchNews(CryptoCompareBaseTool):
|
|
|
38
37
|
async def _arun(
|
|
39
38
|
self,
|
|
40
39
|
token: str,
|
|
41
|
-
config: RunnableConfig,
|
|
42
40
|
**kwargs,
|
|
43
41
|
) -> List[CryptoNews]:
|
|
44
42
|
"""Async implementation of the tool to fetch cryptocurrency news.
|
|
@@ -54,13 +52,14 @@ class CryptoCompareFetchNews(CryptoCompareBaseTool):
|
|
|
54
52
|
Exception: If there's an error accessing the CryptoCompare API.
|
|
55
53
|
"""
|
|
56
54
|
try:
|
|
57
|
-
context = self.
|
|
55
|
+
context = self.get_context()
|
|
56
|
+
skill_config = context.agent.skill_config(self.category)
|
|
58
57
|
|
|
59
58
|
# Check rate limit
|
|
60
59
|
await self.check_rate_limit(context.agent_id, max_requests=5, interval=60)
|
|
61
60
|
|
|
62
61
|
# Get API key from context
|
|
63
|
-
api_key =
|
|
62
|
+
api_key = skill_config.get("api_key")
|
|
64
63
|
if not api_key:
|
|
65
64
|
raise ValueError("CryptoCompare API key not found in configuration")
|
|
66
65
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import List, Type
|
|
5
5
|
|
|
6
|
-
from langchain_core.runnables import RunnableConfig
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from intentkit.skills.cryptocompare.base import CryptoCompareBaseTool, CryptoPrice
|
|
@@ -47,7 +46,6 @@ class CryptoCompareFetchPrice(CryptoCompareBaseTool):
|
|
|
47
46
|
self,
|
|
48
47
|
from_symbol: str,
|
|
49
48
|
to_symbols: List[str],
|
|
50
|
-
config: RunnableConfig,
|
|
51
49
|
**kwargs,
|
|
52
50
|
) -> List[CryptoPrice]:
|
|
53
51
|
"""Async implementation of the tool to fetch cryptocurrency prices.
|
|
@@ -64,13 +62,14 @@ class CryptoCompareFetchPrice(CryptoCompareBaseTool):
|
|
|
64
62
|
Exception: If there's an error accessing the CryptoCompare API.
|
|
65
63
|
"""
|
|
66
64
|
try:
|
|
67
|
-
context = self.
|
|
65
|
+
context = self.get_context()
|
|
66
|
+
skill_config = context.agent.skill_config(self.category)
|
|
68
67
|
|
|
69
68
|
# Check rate limit
|
|
70
69
|
await self.check_rate_limit(context.agent_id, max_requests=10, interval=60)
|
|
71
70
|
|
|
72
71
|
# Get API key from context
|
|
73
|
-
api_key =
|
|
72
|
+
api_key = skill_config.get("api_key")
|
|
74
73
|
if not api_key:
|
|
75
74
|
raise ValueError("CryptoCompare API key not found in configuration")
|
|
76
75
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import List, Type
|
|
5
5
|
|
|
6
|
-
from langchain_core.runnables import RunnableConfig
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from intentkit.skills.cryptocompare.base import CryptoCompareBaseTool, CryptoExchange
|
|
@@ -52,7 +51,6 @@ class CryptoCompareFetchTopExchanges(CryptoCompareBaseTool):
|
|
|
52
51
|
from_symbol: str,
|
|
53
52
|
to_symbol: str = "USD",
|
|
54
53
|
limit: int = 10,
|
|
55
|
-
config: RunnableConfig = None,
|
|
56
54
|
**kwargs,
|
|
57
55
|
) -> List[CryptoExchange]:
|
|
58
56
|
"""Async implementation of the tool to fetch top exchanges for a cryptocurrency pair.
|
|
@@ -70,13 +68,14 @@ class CryptoCompareFetchTopExchanges(CryptoCompareBaseTool):
|
|
|
70
68
|
Exception: If there's an error accessing the CryptoCompare API.
|
|
71
69
|
"""
|
|
72
70
|
try:
|
|
73
|
-
context = self.
|
|
71
|
+
context = self.get_context()
|
|
72
|
+
skill_config = context.agent.skill_config(self.category)
|
|
74
73
|
|
|
75
74
|
# Check rate limit
|
|
76
75
|
await self.check_rate_limit(context.agent_id, max_requests=5, interval=60)
|
|
77
76
|
|
|
78
77
|
# Get API key from context
|
|
79
|
-
api_key =
|
|
78
|
+
api_key = skill_config.get("api_key")
|
|
80
79
|
if not api_key:
|
|
81
80
|
raise ValueError("CryptoCompare API key not found in configuration")
|
|
82
81
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import List, Type
|
|
5
5
|
|
|
6
|
-
from langchain_core.runnables import RunnableConfig
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from intentkit.skills.cryptocompare.base import CryptoCompareBaseTool, CryptoCurrency
|
|
@@ -46,7 +45,6 @@ class CryptoCompareFetchTopMarketCap(CryptoCompareBaseTool):
|
|
|
46
45
|
self,
|
|
47
46
|
to_symbol: str = "USD",
|
|
48
47
|
limit: int = 10,
|
|
49
|
-
config: RunnableConfig = None,
|
|
50
48
|
**kwargs,
|
|
51
49
|
) -> List[CryptoCurrency]:
|
|
52
50
|
"""Async implementation of the tool to fetch top cryptocurrencies by market cap.
|
|
@@ -63,13 +61,14 @@ class CryptoCompareFetchTopMarketCap(CryptoCompareBaseTool):
|
|
|
63
61
|
Exception: If there's an error accessing the CryptoCompare API.
|
|
64
62
|
"""
|
|
65
63
|
try:
|
|
66
|
-
context = self.
|
|
64
|
+
context = self.get_context()
|
|
65
|
+
skill_config = context.agent.skill_config(self.category)
|
|
67
66
|
|
|
68
67
|
# Check rate limit
|
|
69
68
|
await self.check_rate_limit(context.agent_id, max_requests=5, interval=60)
|
|
70
69
|
|
|
71
70
|
# Get API key from context
|
|
72
|
-
api_key =
|
|
71
|
+
api_key = skill_config.get("api_key")
|
|
73
72
|
if not api_key:
|
|
74
73
|
raise ValueError("CryptoCompare API key not found in configuration")
|
|
75
74
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import List, Type
|
|
5
5
|
|
|
6
|
-
from langchain_core.runnables import RunnableConfig
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from intentkit.skills.cryptocompare.base import CryptoCompareBaseTool, CryptoCurrency
|
|
@@ -45,7 +44,6 @@ class CryptoCompareFetchTopVolume(CryptoCompareBaseTool):
|
|
|
45
44
|
self,
|
|
46
45
|
to_symbol: str = "USD",
|
|
47
46
|
limit: int = 10,
|
|
48
|
-
config: RunnableConfig = None,
|
|
49
47
|
**kwargs,
|
|
50
48
|
) -> List[CryptoCurrency]:
|
|
51
49
|
"""Async implementation of the tool to fetch top cryptocurrencies by trading volume.
|
|
@@ -62,13 +60,14 @@ class CryptoCompareFetchTopVolume(CryptoCompareBaseTool):
|
|
|
62
60
|
Exception: If there's an error accessing the CryptoCompare API.
|
|
63
61
|
"""
|
|
64
62
|
try:
|
|
65
|
-
context = self.
|
|
63
|
+
context = self.get_context()
|
|
64
|
+
skill_config = context.agent.skill_config(self.category)
|
|
66
65
|
|
|
67
66
|
# Check rate limit
|
|
68
67
|
await self.check_rate_limit(context.agent_id, max_requests=5, interval=60)
|
|
69
68
|
|
|
70
69
|
# Get API key from context
|
|
71
|
-
api_key =
|
|
70
|
+
api_key = skill_config.get("api_key")
|
|
72
71
|
if not api_key:
|
|
73
72
|
raise ValueError("CryptoCompare API key not found in configuration")
|
|
74
73
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import Dict, List, Type
|
|
5
5
|
|
|
6
|
-
from langchain_core.runnables import RunnableConfig
|
|
7
6
|
from pydantic import BaseModel, Field
|
|
8
7
|
|
|
9
8
|
from intentkit.skills.cryptocompare.base import CryptoCompareBaseTool
|
|
@@ -49,7 +48,6 @@ class CryptoCompareFetchTradingSignals(CryptoCompareBaseTool):
|
|
|
49
48
|
async def _arun(
|
|
50
49
|
self,
|
|
51
50
|
from_symbol: str,
|
|
52
|
-
config: RunnableConfig,
|
|
53
51
|
**kwargs,
|
|
54
52
|
) -> List[TradingSignal]:
|
|
55
53
|
"""Async implementation of the tool to fetch cryptocurrency trading signals.
|
|
@@ -65,13 +63,14 @@ class CryptoCompareFetchTradingSignals(CryptoCompareBaseTool):
|
|
|
65
63
|
Exception: If there's an error accessing the CryptoCompare API.
|
|
66
64
|
"""
|
|
67
65
|
try:
|
|
68
|
-
context = self.
|
|
66
|
+
context = self.get_context()
|
|
67
|
+
skill_config = context.agent.skill_config(self.category)
|
|
69
68
|
|
|
70
69
|
# Check rate limit
|
|
71
70
|
await self.check_rate_limit(context.agent_id, max_requests=5, interval=60)
|
|
72
71
|
|
|
73
72
|
# Get API key from context
|
|
74
|
-
api_key =
|
|
73
|
+
api_key = skill_config.get("api_key")
|
|
75
74
|
if not api_key:
|
|
76
75
|
raise ValueError("CryptoCompare API key not found in configuration")
|
|
77
76
|
|
|
@@ -9,7 +9,7 @@ from langchain.tools.base import ToolException
|
|
|
9
9
|
from pydantic import BaseModel, Field
|
|
10
10
|
|
|
11
11
|
from intentkit.abstracts.skill import SkillStoreABC
|
|
12
|
-
from intentkit.skills.base import IntentKitSkill
|
|
12
|
+
from intentkit.skills.base import IntentKitSkill
|
|
13
13
|
|
|
14
14
|
base_url = "https://cryptopanic.com/api/v1/posts/"
|
|
15
15
|
|
|
@@ -26,24 +26,28 @@ class CryptopanicBaseTool(IntentKitSkill):
|
|
|
26
26
|
args_schema: Type[BaseModel]
|
|
27
27
|
skill_store: SkillStoreABC = Field(description="Skill store for data persistence")
|
|
28
28
|
|
|
29
|
-
def get_api_key(self
|
|
29
|
+
def get_api_key(self) -> str:
|
|
30
30
|
"""Retrieve the CryptoPanic API key from context.
|
|
31
31
|
|
|
32
|
-
Args:
|
|
33
|
-
context: Skill context containing configuration.
|
|
34
|
-
|
|
35
32
|
Returns:
|
|
36
33
|
API key string.
|
|
37
34
|
|
|
38
35
|
Raises:
|
|
39
36
|
ToolException: If the API key is not found.
|
|
40
37
|
"""
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
context = self.get_context()
|
|
39
|
+
skill_config = context.agent.skill_config(self.category)
|
|
40
|
+
api_key_provider = skill_config.get("api_key_provider")
|
|
41
|
+
if api_key_provider == "agent_owner":
|
|
42
|
+
api_key = skill_config.get("api_key")
|
|
43
|
+
if api_key:
|
|
44
|
+
return api_key
|
|
45
|
+
else:
|
|
46
|
+
raise ToolException("No api_key found in agent_owner configuration")
|
|
47
|
+
else:
|
|
43
48
|
raise ToolException(
|
|
44
|
-
"
|
|
49
|
+
f"Invalid API key provider: {api_key_provider}. Only 'agent_owner' is supported for CryptoPanic."
|
|
45
50
|
)
|
|
46
|
-
return api_key
|
|
47
51
|
|
|
48
52
|
@property
|
|
49
53
|
def category(self) -> str:
|