intentkit 0.6.9.dev2__py3-none-any.whl → 0.6.10.dev2__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.

Files changed (168) hide show
  1. intentkit/__init__.py +1 -1
  2. intentkit/abstracts/graph.py +17 -2
  3. intentkit/core/engine.py +49 -30
  4. intentkit/core/node.py +10 -20
  5. intentkit/models/agent.py +3 -0
  6. intentkit/models/chat.py +9 -1
  7. intentkit/skills/acolyt/ask.py +2 -5
  8. intentkit/skills/acolyt/base.py +16 -6
  9. intentkit/skills/aixbt/__init__.py +3 -7
  10. intentkit/skills/aixbt/projects.py +12 -36
  11. intentkit/skills/allora/base.py +16 -6
  12. intentkit/skills/allora/price.py +2 -4
  13. intentkit/skills/base.py +8 -1
  14. intentkit/skills/carv/base.py +12 -10
  15. intentkit/skills/carv/fetch_news.py +90 -92
  16. intentkit/skills/carv/onchain_query.py +162 -164
  17. intentkit/skills/carv/token_info_and_price.py +108 -110
  18. intentkit/skills/chainlist/chain_lookup.py +1 -2
  19. intentkit/skills/common/current_time.py +1 -2
  20. intentkit/skills/cookiefun/base.py +20 -12
  21. intentkit/skills/cookiefun/get_account_details.py +1 -3
  22. intentkit/skills/cookiefun/get_account_feed.py +1 -3
  23. intentkit/skills/cookiefun/get_account_smart_followers.py +1 -3
  24. intentkit/skills/cookiefun/get_sectors.py +2 -3
  25. intentkit/skills/cookiefun/search_accounts.py +1 -3
  26. intentkit/skills/cryptocompare/fetch_news.py +3 -4
  27. intentkit/skills/cryptocompare/fetch_price.py +3 -4
  28. intentkit/skills/cryptocompare/fetch_top_exchanges.py +3 -4
  29. intentkit/skills/cryptocompare/fetch_top_market_cap.py +3 -4
  30. intentkit/skills/cryptocompare/fetch_top_volume.py +3 -4
  31. intentkit/skills/cryptocompare/fetch_trading_signals.py +3 -4
  32. intentkit/skills/cryptopanic/base.py +13 -9
  33. intentkit/skills/cryptopanic/fetch_crypto_news.py +150 -153
  34. intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +133 -136
  35. intentkit/skills/dapplooker/base.py +16 -6
  36. intentkit/skills/dapplooker/dapplooker_token_data.py +2 -4
  37. intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +2 -3
  38. intentkit/skills/defillama/coins/fetch_block.py +2 -3
  39. intentkit/skills/defillama/coins/fetch_current_prices.py +2 -5
  40. intentkit/skills/defillama/coins/fetch_first_price.py +2 -5
  41. intentkit/skills/defillama/coins/fetch_historical_prices.py +2 -3
  42. intentkit/skills/defillama/coins/fetch_price_chart.py +2 -5
  43. intentkit/skills/defillama/coins/fetch_price_percentage.py +2 -5
  44. intentkit/skills/defillama/fees/fetch_fees_overview.py +2 -3
  45. intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +2 -3
  46. intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +2 -3
  47. intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +2 -3
  48. intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +2 -3
  49. intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -5
  50. intentkit/skills/defillama/tvl/fetch_chains.py +2 -3
  51. intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -3
  52. intentkit/skills/defillama/tvl/fetch_protocol.py +2 -5
  53. intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +2 -5
  54. intentkit/skills/defillama/tvl/fetch_protocols.py +2 -3
  55. intentkit/skills/defillama/volumes/fetch_dex_overview.py +2 -3
  56. intentkit/skills/defillama/volumes/fetch_dex_summary.py +2 -5
  57. intentkit/skills/defillama/volumes/fetch_options_overview.py +2 -3
  58. intentkit/skills/defillama/yields/fetch_pool_chart.py +2 -5
  59. intentkit/skills/defillama/yields/fetch_pools.py +2 -3
  60. intentkit/skills/dune_analytics/base.py +15 -9
  61. intentkit/skills/dune_analytics/fetch_kol_buys.py +125 -128
  62. intentkit/skills/dune_analytics/fetch_nation_metrics.py +234 -237
  63. intentkit/skills/elfa/base.py +16 -6
  64. intentkit/skills/elfa/mention.py +2 -7
  65. intentkit/skills/elfa/stats.py +2 -6
  66. intentkit/skills/elfa/tokens.py +1 -4
  67. intentkit/skills/enso/base.py +25 -13
  68. intentkit/skills/enso/best_yield.py +1 -4
  69. intentkit/skills/enso/networks.py +2 -5
  70. intentkit/skills/enso/prices.py +1 -5
  71. intentkit/skills/enso/route.py +2 -5
  72. intentkit/skills/enso/tokens.py +1 -4
  73. intentkit/skills/enso/wallet.py +3 -9
  74. intentkit/skills/firecrawl/base.py +16 -6
  75. intentkit/skills/firecrawl/clear.py +1 -3
  76. intentkit/skills/firecrawl/crawl.py +7 -8
  77. intentkit/skills/firecrawl/query.py +7 -9
  78. intentkit/skills/firecrawl/scrape.py +7 -8
  79. intentkit/skills/github/github_search.py +1 -3
  80. intentkit/skills/heurist/base.py +15 -0
  81. intentkit/skills/heurist/image_generation_animagine_xl.py +3 -4
  82. intentkit/skills/heurist/image_generation_arthemy_comics.py +3 -4
  83. intentkit/skills/heurist/image_generation_arthemy_real.py +3 -4
  84. intentkit/skills/heurist/image_generation_braindance.py +3 -4
  85. intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +3 -4
  86. intentkit/skills/heurist/image_generation_flux_1_dev.py +3 -4
  87. intentkit/skills/heurist/image_generation_sdxl.py +3 -4
  88. intentkit/skills/http/get.py +0 -2
  89. intentkit/skills/http/post.py +0 -2
  90. intentkit/skills/http/put.py +0 -2
  91. intentkit/skills/lifi/token_execute.py +1 -3
  92. intentkit/skills/lifi/token_quote.py +0 -2
  93. intentkit/skills/moralis/base.py +15 -1
  94. intentkit/skills/nation/nft_check.py +2 -5
  95. intentkit/skills/openai/base.py +14 -5
  96. intentkit/skills/openai/dalle_image_generation.py +6 -5
  97. intentkit/skills/openai/gpt_image_generation.py +6 -5
  98. intentkit/skills/openai/gpt_image_to_image.py +6 -5
  99. intentkit/skills/openai/image_to_text.py +6 -6
  100. intentkit/skills/portfolio/base.py +4 -3
  101. intentkit/skills/portfolio/token_balances.py +2 -4
  102. intentkit/skills/portfolio/wallet_approvals.py +2 -4
  103. intentkit/skills/portfolio/wallet_defi_positions.py +3 -4
  104. intentkit/skills/portfolio/wallet_history.py +2 -4
  105. intentkit/skills/portfolio/wallet_net_worth.py +2 -4
  106. intentkit/skills/portfolio/wallet_nfts.py +2 -4
  107. intentkit/skills/portfolio/wallet_profitability.py +2 -4
  108. intentkit/skills/portfolio/wallet_profitability_summary.py +2 -4
  109. intentkit/skills/portfolio/wallet_stats.py +2 -4
  110. intentkit/skills/portfolio/wallet_swaps.py +2 -4
  111. intentkit/skills/slack/base.py +18 -0
  112. intentkit/skills/slack/get_channel.py +3 -4
  113. intentkit/skills/slack/get_message.py +3 -4
  114. intentkit/skills/slack/schedule_message.py +3 -4
  115. intentkit/skills/slack/send_message.py +3 -4
  116. intentkit/skills/supabase/delete_data.py +3 -6
  117. intentkit/skills/supabase/fetch_data.py +3 -6
  118. intentkit/skills/supabase/insert_data.py +3 -6
  119. intentkit/skills/supabase/invoke_function.py +3 -6
  120. intentkit/skills/supabase/update_data.py +3 -6
  121. intentkit/skills/supabase/upsert_data.py +3 -6
  122. intentkit/skills/system/add_autonomous_task.py +1 -3
  123. intentkit/skills/system/delete_autonomous_task.py +1 -3
  124. intentkit/skills/system/edit_autonomous_task.py +1 -3
  125. intentkit/skills/system/list_autonomous_tasks.py +1 -3
  126. intentkit/skills/system/read_agent_api_key.py +2 -3
  127. intentkit/skills/system/regenerate_agent_api_key.py +2 -5
  128. intentkit/skills/tavily/base.py +14 -5
  129. intentkit/skills/tavily/tavily_extract.py +7 -8
  130. intentkit/skills/tavily/tavily_search.py +11 -9
  131. intentkit/skills/token/base.py +4 -6
  132. intentkit/skills/token/erc20_transfers.py +2 -4
  133. intentkit/skills/token/token_analytics.py +2 -4
  134. intentkit/skills/token/token_price.py +2 -4
  135. intentkit/skills/token/token_search.py +2 -4
  136. intentkit/skills/twitter/base.py +41 -0
  137. intentkit/skills/twitter/follow_user.py +4 -4
  138. intentkit/skills/twitter/get_mentions.py +4 -4
  139. intentkit/skills/twitter/get_timeline.py +4 -4
  140. intentkit/skills/twitter/get_user_by_username.py +4 -4
  141. intentkit/skills/twitter/get_user_tweets.py +4 -4
  142. intentkit/skills/twitter/like_tweet.py +4 -4
  143. intentkit/skills/twitter/post_tweet.py +3 -4
  144. intentkit/skills/twitter/reply_tweet.py +3 -4
  145. intentkit/skills/twitter/retweet.py +4 -4
  146. intentkit/skills/twitter/search_tweets.py +4 -4
  147. intentkit/skills/unrealspeech/base.py +16 -0
  148. intentkit/skills/unrealspeech/text_to_speech.py +4 -4
  149. intentkit/skills/venice_audio/base.py +11 -9
  150. intentkit/skills/venice_audio/venice_audio.py +238 -240
  151. intentkit/skills/venice_image/base.py +23 -19
  152. intentkit/skills/venice_image/image_enhance/image_enhance.py +78 -80
  153. intentkit/skills/venice_image/image_generation/image_generation_base.py +115 -117
  154. intentkit/skills/venice_image/image_upscale/image_upscale.py +88 -90
  155. intentkit/skills/venice_image/image_vision/image_vision.py +98 -100
  156. intentkit/skills/web_scraper/document_indexer.py +3 -5
  157. intentkit/skills/web_scraper/scrape_and_index.py +14 -17
  158. intentkit/skills/web_scraper/website_indexer.py +8 -10
  159. intentkit/skills/xmtp/README.md +110 -0
  160. intentkit/skills/xmtp/__init__.py +82 -0
  161. intentkit/skills/xmtp/base.py +15 -0
  162. intentkit/skills/xmtp/schema.json +41 -0
  163. intentkit/skills/xmtp/transfer.py +155 -0
  164. intentkit/skills/xmtp/xmtp.svg +26 -0
  165. {intentkit-0.6.9.dev2.dist-info → intentkit-0.6.10.dev2.dist-info}/METADATA +3 -3
  166. {intentkit-0.6.9.dev2.dist-info → intentkit-0.6.10.dev2.dist-info}/RECORD +168 -162
  167. {intentkit-0.6.9.dev2.dist-info → intentkit-0.6.10.dev2.dist-info}/WHEEL +0 -0
  168. {intentkit-0.6.9.dev2.dist-info → intentkit-0.6.10.dev2.dist-info}/licenses/LICENSE +0 -0
@@ -1,9 +1,10 @@
1
- from typing import Optional, Type
1
+ from typing import Type
2
2
 
3
+ from langchain.tools.base import ToolException
3
4
  from pydantic import BaseModel, Field
4
5
 
5
6
  from intentkit.abstracts.skill import SkillStoreABC
6
- from intentkit.skills.base import IntentKitSkill, SkillContext
7
+ from intentkit.skills.base import IntentKitSkill
7
8
 
8
9
 
9
10
  class DappLookerBaseTool(IntentKitSkill):
@@ -16,10 +17,19 @@ class DappLookerBaseTool(IntentKitSkill):
16
17
  description="The skill store for persisting data"
17
18
  )
18
19
 
19
- def get_api_key(self, context: SkillContext) -> Optional[str]:
20
- if "api_key" in context.config and context.config["api_key"]:
21
- return context.config["api_key"]
22
- return self.skill_store.get_system_config("dapplooker_api_key")
20
+ def get_api_key(self) -> str:
21
+ context = self.get_context()
22
+ skill_config = context.agent.skill_config(self.category)
23
+ api_key_provider = skill_config.get("api_key_provider")
24
+ if api_key_provider == "platform":
25
+ return self.skill_store.get_system_config("dapplooker_api_key")
26
+ # for backward compatibility, may only have api_key in skill_config
27
+ elif skill_config.get("api_key"):
28
+ return skill_config.get("api_key")
29
+ else:
30
+ raise ToolException(
31
+ f"Invalid API key provider: {api_key_provider}, or no api_key in config"
32
+ )
23
33
 
24
34
  @property
25
35
  def category(self) -> str:
@@ -3,7 +3,6 @@ import logging
3
3
  from typing import Any, Dict, List, Optional, Type
4
4
 
5
5
  import httpx
6
- from langchain_core.runnables import RunnableConfig
7
6
  from pydantic import BaseModel, Field
8
7
 
9
8
  from intentkit.skills.dapplooker.base import DappLookerBaseTool
@@ -58,7 +57,6 @@ class DappLookerTokenData(DappLookerBaseTool):
58
57
  token_tickers: Optional[str] = None,
59
58
  token_addresses: Optional[str] = None,
60
59
  chain: str = "base",
61
- config: RunnableConfig = None,
62
60
  **kwargs,
63
61
  ) -> str:
64
62
  """Implementation of the DappLooker token data tool.
@@ -72,13 +70,13 @@ class DappLookerTokenData(DappLookerBaseTool):
72
70
  Returns:
73
71
  str: Formatted token data with market metrics and analytics.
74
72
  """
75
- context = self.context_from_config(config)
73
+ context = self.get_context()
76
74
  logger.debug(
77
75
  f"dapplooker_token_data.py: Fetching token data with context {context}"
78
76
  )
79
77
 
80
78
  # Get the API key from the agent's configuration or environment variable
81
- api_key = self.get_api_key(context)
79
+ api_key = self.get_api_key()
82
80
  if not api_key:
83
81
  return "Error: No DappLooker API key provided in the configuration or environment."
84
82
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_batch_historical_prices
@@ -82,7 +81,7 @@ class DefiLlamaFetchBatchHistoricalPrices(DefiLlamaBaseTool):
82
81
  args_schema: Type[BaseModel] = FetchBatchHistoricalPricesInput
83
82
 
84
83
  async def _arun(
85
- self, config: RunnableConfig, coins_timestamps: Dict[str, List[int]]
84
+ self, coins_timestamps: Dict[str, List[int]]
86
85
  ) -> FetchBatchHistoricalPricesResponse:
87
86
  """Fetch historical prices for the given tokens at specified timestamps.
88
87
 
@@ -95,7 +94,7 @@ class DefiLlamaFetchBatchHistoricalPrices(DefiLlamaBaseTool):
95
94
  """
96
95
  try:
97
96
  # Check rate limiting
98
- context = self.context_from_config(config)
97
+ context = self.get_context()
99
98
  is_rate_limited, error_msg = await self.check_rate_limit(context)
100
99
  if is_rate_limited:
101
100
  return FetchBatchHistoricalPricesResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_block
@@ -58,7 +57,7 @@ class DefiLlamaFetchBlock(DefiLlamaBaseTool):
58
57
  description: str = FETCH_BLOCK_PROMPT
59
58
  args_schema: Type[BaseModel] = FetchBlockInput
60
59
 
61
- async def _arun(self, config: RunnableConfig, chain: str) -> FetchBlockResponse:
60
+ async def _arun(self, chain: str) -> FetchBlockResponse:
62
61
  """Fetch current block data for the given chain.
63
62
 
64
63
  Args:
@@ -75,7 +74,7 @@ class DefiLlamaFetchBlock(DefiLlamaBaseTool):
75
74
  return FetchBlockResponse(chain=chain, error=f"Invalid chain: {chain}")
76
75
 
77
76
  # Check rate limiting
78
- context = self.context_from_config(config)
77
+ context = self.get_context()
79
78
  is_rate_limited, error_msg = await self.check_rate_limit(context)
80
79
  if is_rate_limited:
81
80
  return FetchBlockResponse(chain=normalized_chain, error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_current_prices
@@ -72,9 +71,7 @@ class DefiLlamaFetchCurrentPrices(DefiLlamaBaseTool):
72
71
  description: str = FETCH_PRICES_PROMPT
73
72
  args_schema: Type[BaseModel] = FetchCurrentPricesInput
74
73
 
75
- async def _arun(
76
- self, config: RunnableConfig, coins: List[str]
77
- ) -> FetchCurrentPricesResponse:
74
+ async def _arun(self, coins: List[str]) -> FetchCurrentPricesResponse:
78
75
  """Fetch current prices for the given tokens.
79
76
 
80
77
  Args:
@@ -86,7 +83,7 @@ class DefiLlamaFetchCurrentPrices(DefiLlamaBaseTool):
86
83
  """
87
84
  try:
88
85
  # Check rate limiting
89
- context = self.context_from_config(config)
86
+ context = self.get_context()
90
87
  is_rate_limited, error_msg = await self.check_rate_limit(context)
91
88
  if is_rate_limited:
92
89
  return FetchCurrentPricesResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_first_price
@@ -67,9 +66,7 @@ class DefiLlamaFetchFirstPrice(DefiLlamaBaseTool):
67
66
  description: str = FETCH_FIRST_PRICE_PROMPT
68
67
  args_schema: Type[BaseModel] = FetchFirstPriceInput
69
68
 
70
- async def _arun(
71
- self, config: RunnableConfig, coins: List[str]
72
- ) -> FetchFirstPriceResponse:
69
+ async def _arun(self, coins: List[str]) -> FetchFirstPriceResponse:
73
70
  """Fetch first recorded prices for the given tokens.
74
71
 
75
72
  Args:
@@ -81,7 +78,7 @@ class DefiLlamaFetchFirstPrice(DefiLlamaBaseTool):
81
78
  """
82
79
  try:
83
80
  # Check rate limiting
84
- context = self.context_from_config(config)
81
+ context = self.get_context()
85
82
  is_rate_limited, error_msg = await self.check_rate_limit(context)
86
83
  if is_rate_limited:
87
84
  return FetchFirstPriceResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_historical_prices
@@ -77,7 +76,7 @@ class DefiLlamaFetchHistoricalPrices(DefiLlamaBaseTool):
77
76
  args_schema: Type[BaseModel] = FetchHistoricalPricesInput
78
77
 
79
78
  async def _arun(
80
- self, config: RunnableConfig, timestamp: int, coins: List[str]
79
+ self, timestamp: int, coins: List[str]
81
80
  ) -> FetchHistoricalPricesResponse:
82
81
  """Fetch historical prices for the given tokens at the specified time.
83
82
 
@@ -91,7 +90,7 @@ class DefiLlamaFetchHistoricalPrices(DefiLlamaBaseTool):
91
90
  """
92
91
  try:
93
92
  # Check rate limiting
94
- context = self.context_from_config(config)
93
+ context = self.get_context()
95
94
  is_rate_limited, error_msg = await self.check_rate_limit(context)
96
95
  if is_rate_limited:
97
96
  return FetchHistoricalPricesResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_price_chart
@@ -76,9 +75,7 @@ class DefiLlamaFetchPriceChart(DefiLlamaBaseTool):
76
75
  description: str = FETCH_PRICE_CHART_PROMPT
77
76
  args_schema: Type[BaseModel] = FetchPriceChartInput
78
77
 
79
- async def _arun(
80
- self, config: RunnableConfig, coins: List[str]
81
- ) -> FetchPriceChartResponse:
78
+ async def _arun(self, coins: List[str]) -> FetchPriceChartResponse:
82
79
  """Fetch price charts for the given tokens.
83
80
 
84
81
  Args:
@@ -90,7 +87,7 @@ class DefiLlamaFetchPriceChart(DefiLlamaBaseTool):
90
87
  """
91
88
  try:
92
89
  # Check rate limiting
93
- context = self.context_from_config(config)
90
+ context = self.get_context()
94
91
  is_rate_limited, error_msg = await self.check_rate_limit(context)
95
92
  if is_rate_limited:
96
93
  return FetchPriceChartResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_price_percentage
@@ -60,9 +59,7 @@ class DefiLlamaFetchPricePercentage(DefiLlamaBaseTool):
60
59
  description: str = FETCH_PRICE_PERCENTAGE_PROMPT
61
60
  args_schema: Type[BaseModel] = FetchPricePercentageInput
62
61
 
63
- async def _arun(
64
- self, config: RunnableConfig, coins: List[str]
65
- ) -> FetchPricePercentageResponse:
62
+ async def _arun(self, coins: List[str]) -> FetchPricePercentageResponse:
66
63
  """Fetch price percentage changes for the given tokens.
67
64
 
68
65
  Args:
@@ -74,7 +71,7 @@ class DefiLlamaFetchPricePercentage(DefiLlamaBaseTool):
74
71
  """
75
72
  try:
76
73
  # Check rate limiting
77
- context = self.context_from_config(config)
74
+ context = self.get_context()
78
75
  is_rate_limited, error_msg = await self.check_rate_limit(context)
79
76
  if is_rate_limited:
80
77
  return FetchPricePercentageResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_fees_overview
@@ -103,7 +102,7 @@ class DefiLlamaFetchFeesOverview(DefiLlamaBaseTool):
103
102
 
104
103
  args_schema: Type[BaseModel] = EmptyArgsSchema
105
104
 
106
- async def _arun(self, config: RunnableConfig) -> FetchFeesOverviewResponse:
105
+ async def _arun(self, **kwargs) -> FetchFeesOverviewResponse:
107
106
  """Fetch overview data for protocol fees.
108
107
 
109
108
  Returns:
@@ -111,7 +110,7 @@ class DefiLlamaFetchFeesOverview(DefiLlamaBaseTool):
111
110
  """
112
111
  try:
113
112
  # Check rate limiting
114
- context = self.context_from_config(config)
113
+ context = self.get_context()
115
114
  is_rate_limited, error_msg = await self.check_rate_limit(context)
116
115
  if is_rate_limited:
117
116
  return FetchFeesOverviewResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import List, Optional
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_stablecoin_chains
@@ -73,7 +72,7 @@ class DefiLlamaFetchStablecoinChains(DefiLlamaBaseTool):
73
72
  description: str = FETCH_STABLECOIN_CHAINS_PROMPT
74
73
  args_schema: None = None # No input parameters needed
75
74
 
76
- async def _arun(self, config: RunnableConfig) -> FetchStablecoinChainsResponse:
75
+ async def _arun(self, **kwargs) -> FetchStablecoinChainsResponse:
77
76
  """Fetch stablecoin distribution data across chains.
78
77
 
79
78
  Returns:
@@ -81,7 +80,7 @@ class DefiLlamaFetchStablecoinChains(DefiLlamaBaseTool):
81
80
  """
82
81
  try:
83
82
  # Check rate limiting
84
- context = self.context_from_config(config)
83
+ context = self.get_context()
85
84
  is_rate_limited, error_msg = await self.check_rate_limit(context)
86
85
  if is_rate_limited:
87
86
  return FetchStablecoinChainsResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_stablecoin_charts
@@ -85,7 +84,7 @@ class DefiLlamaFetchStablecoinCharts(DefiLlamaBaseTool):
85
84
  args_schema: Type[BaseModel] = FetchStablecoinChartsInput
86
85
 
87
86
  async def _arun(
88
- self, config: RunnableConfig, stablecoin_id: str, chain: Optional[str] = None
87
+ self, stablecoin_id: str, chain: Optional[str] = None
89
88
  ) -> FetchStablecoinChartsResponse:
90
89
  """Fetch historical chart data for the given stablecoin.
91
90
 
@@ -108,7 +107,7 @@ class DefiLlamaFetchStablecoinCharts(DefiLlamaBaseTool):
108
107
  chain = normalized_chain
109
108
 
110
109
  # Check rate limiting
111
- context = self.context_from_config(config)
110
+ context = self.get_context()
112
111
  is_rate_limited, error_msg = await self.check_rate_limit(context)
113
112
  if is_rate_limited:
114
113
  return FetchStablecoinChartsResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_stablecoin_prices
@@ -54,7 +53,7 @@ class DefiLlamaFetchStablecoinPrices(DefiLlamaBaseTool):
54
53
  description: str = FETCH_STABLECOIN_PRICES_PROMPT
55
54
  args_schema: None = None # No input parameters needed
56
55
 
57
- async def _arun(self, config: RunnableConfig) -> FetchStablecoinPricesResponse:
56
+ async def _arun(self, **kwargs) -> FetchStablecoinPricesResponse:
58
57
  """Fetch stablecoin price data.
59
58
 
60
59
  Returns:
@@ -62,7 +61,7 @@ class DefiLlamaFetchStablecoinPrices(DefiLlamaBaseTool):
62
61
  """
63
62
  try:
64
63
  # Check rate limiting
65
- context = self.context_from_config(config)
64
+ context = self.get_context()
66
65
  is_rate_limited, error_msg = await self.check_rate_limit(context)
67
66
  if is_rate_limited:
68
67
  return FetchStablecoinPricesResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_stablecoins
@@ -99,7 +98,7 @@ class DefiLlamaFetchStablecoins(DefiLlamaBaseTool):
99
98
  description: str = FETCH_STABLECOINS_PROMPT
100
99
  args_schema: None = None # No input parameters needed
101
100
 
102
- async def _arun(self, config: RunnableConfig) -> FetchStablecoinsResponse:
101
+ async def _arun(self, **kwargs) -> FetchStablecoinsResponse:
103
102
  """Fetch stablecoin data.
104
103
 
105
104
  Returns:
@@ -107,7 +106,7 @@ class DefiLlamaFetchStablecoins(DefiLlamaBaseTool):
107
106
  """
108
107
  try:
109
108
  # Check rate limiting
110
- context = self.context_from_config(config)
109
+ context = self.get_context()
111
110
  is_rate_limited, error_msg = await self.check_rate_limit(context)
112
111
  if is_rate_limited:
113
112
  return FetchStablecoinsResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import List, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_chain_historical_tvl
@@ -60,9 +59,7 @@ class DefiLlamaFetchChainHistoricalTvl(DefiLlamaBaseTool):
60
59
  description: str = FETCH_HISTORICAL_TVL_PROMPT
61
60
  args_schema: Type[BaseModel] = FetchChainHistoricalTVLInput
62
61
 
63
- async def _arun(
64
- self, config: RunnableConfig, chain: str
65
- ) -> FetchChainHistoricalTVLResponse:
62
+ async def _arun(self, chain: str) -> FetchChainHistoricalTVLResponse:
66
63
  """Fetch historical TVL data for the given chain.
67
64
 
68
65
  Args:
@@ -74,7 +71,7 @@ class DefiLlamaFetchChainHistoricalTvl(DefiLlamaBaseTool):
74
71
  """
75
72
  try:
76
73
  # Check rate limiting
77
- context = self.context_from_config(config)
74
+ context = self.get_context()
78
75
  is_rate_limited, error_msg = await self.check_rate_limit(context)
79
76
  if is_rate_limited:
80
77
  return FetchChainHistoricalTVLResponse(chain=chain, error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_chains
@@ -75,7 +74,7 @@ class DefiLlamaFetchChains(DefiLlamaBaseTool):
75
74
  description: str = FETCH_CHAINS_PROMPT
76
75
  args_schema: Type[BaseModel] = FetchChainsInput
77
76
 
78
- async def _arun(self, config: RunnableConfig) -> FetchChainsResponse:
77
+ async def _arun(self, **kwargs) -> FetchChainsResponse:
79
78
  """Fetch TVL data for all chains.
80
79
 
81
80
  Returns:
@@ -83,7 +82,7 @@ class DefiLlamaFetchChains(DefiLlamaBaseTool):
83
82
  """
84
83
  try:
85
84
  # Check rate limiting
86
- context = self.context_from_config(config)
85
+ context = self.get_context()
87
86
  is_rate_limited, error_msg = await self.check_rate_limit(context)
88
87
  if is_rate_limited:
89
88
  return FetchChainsResponse(chains=[], total_tvl=0, error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import List, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_historical_tvl
@@ -62,7 +61,7 @@ class DefiLlamaFetchHistoricalTvl(DefiLlamaBaseTool):
62
61
  description: str = FETCH_TOTAL_HISTORICAL_TVL_PROMPT
63
62
  args_schema: Type[BaseModel] = FetchHistoricalTVLInput
64
63
 
65
- async def _arun(self, config: RunnableConfig) -> FetchHistoricalTVLResponse:
64
+ async def _arun(self, **kwargs) -> FetchHistoricalTVLResponse:
66
65
  """Fetch historical TVL data across all chains.
67
66
 
68
67
  Returns:
@@ -70,7 +69,7 @@ class DefiLlamaFetchHistoricalTvl(DefiLlamaBaseTool):
70
69
  """
71
70
  try:
72
71
  # Check rate limiting
73
- context = self.context_from_config(config)
72
+ context = self.get_context()
74
73
  is_rate_limited, error_msg = await self.check_rate_limit(context)
75
74
  if is_rate_limited:
76
75
  return FetchHistoricalTVLResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_protocol
@@ -156,9 +155,7 @@ class DefiLlamaFetchProtocol(DefiLlamaBaseTool):
156
155
  description: str = FETCH_PROTOCOL_PROMPT
157
156
  args_schema: Type[BaseModel] = DefiLlamaProtocolInput
158
157
 
159
- async def _arun(
160
- self, config: RunnableConfig, protocol: str
161
- ) -> DefiLlamaProtocolOutput:
158
+ async def _arun(self, protocol: str) -> DefiLlamaProtocolOutput:
162
159
  """Fetch detailed information about a specific protocol.
163
160
 
164
161
  Args:
@@ -170,7 +167,7 @@ class DefiLlamaFetchProtocol(DefiLlamaBaseTool):
170
167
  """
171
168
  try:
172
169
  # Check rate limiting
173
- context = self.context_from_config(config)
170
+ context = self.get_context()
174
171
  is_rate_limited, error_msg = await self.check_rate_limit(context)
175
172
  if is_rate_limited:
176
173
  return DefiLlamaProtocolOutput(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_protocol_current_tvl
@@ -50,9 +49,7 @@ class DefiLlamaFetchProtocolCurrentTvl(DefiLlamaBaseTool):
50
49
  description: str = FETCH_TVL_PROMPT
51
50
  args_schema: Type[BaseModel] = FetchProtocolCurrentTVLInput
52
51
 
53
- async def _arun(
54
- self, config: RunnableConfig, protocol: str
55
- ) -> FetchProtocolCurrentTVLResponse:
52
+ async def _arun(self, protocol: str) -> FetchProtocolCurrentTVLResponse:
56
53
  """Fetch current TVL for the given protocol.
57
54
 
58
55
  Args:
@@ -64,7 +61,7 @@ class DefiLlamaFetchProtocolCurrentTvl(DefiLlamaBaseTool):
64
61
  """
65
62
  try:
66
63
  # Check rate limiting
67
- context = self.context_from_config(config)
64
+ context = self.get_context()
68
65
  is_rate_limited, error_msg = await self.check_rate_limit(context)
69
66
  if is_rate_limited:
70
67
  return FetchProtocolCurrentTVLResponse(
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type, Union
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_protocols
@@ -146,7 +145,7 @@ class DefiLlamaFetchProtocols(DefiLlamaBaseTool):
146
145
 
147
146
  args_schema: Type[BaseModel] = EmptyArgsSchema
148
147
 
149
- async def _arun(self, config: RunnableConfig) -> DefiLlamaProtocolsOutput:
148
+ async def _arun(self, **kwargs) -> DefiLlamaProtocolsOutput:
150
149
  """Fetch information about all protocols.
151
150
 
152
151
  Returns:
@@ -154,7 +153,7 @@ class DefiLlamaFetchProtocols(DefiLlamaBaseTool):
154
153
  """
155
154
  try:
156
155
  # Check rate limiting
157
- context = self.context_from_config(config)
156
+ context = self.get_context()
158
157
  is_rate_limited, error_msg = await self.check_rate_limit(context)
159
158
  if is_rate_limited:
160
159
  return DefiLlamaProtocolsOutput(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_dex_overview
@@ -130,7 +129,7 @@ class DefiLlamaFetchDexOverview(DefiLlamaBaseTool):
130
129
  description: str = FETCH_DEX_OVERVIEW_PROMPT
131
130
  args_schema: None = None # No input parameters needed
132
131
 
133
- async def _arun(self, config: RunnableConfig) -> FetchDexOverviewResponse:
132
+ async def _arun(self, **kwargs) -> FetchDexOverviewResponse:
134
133
  """Fetch DEX overview data.
135
134
 
136
135
  Returns:
@@ -138,7 +137,7 @@ class DefiLlamaFetchDexOverview(DefiLlamaBaseTool):
138
137
  """
139
138
  try:
140
139
  # Check rate limiting
141
- context = self.context_from_config(config)
140
+ context = self.get_context()
142
141
  is_rate_limited, error_msg = await self.check_rate_limit(context)
143
142
  if is_rate_limited:
144
143
  return FetchDexOverviewResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_dex_summary
@@ -90,9 +89,7 @@ class DefiLlamaFetchDexSummary(DefiLlamaBaseTool):
90
89
  description: str = FETCH_DEX_SUMMARY_PROMPT
91
90
  args_schema: Type[BaseModel] = FetchDexSummaryInput
92
91
 
93
- async def _arun(
94
- self, config: RunnableConfig, protocol: str
95
- ) -> FetchDexSummaryResponse:
92
+ async def _arun(self, protocol: str) -> FetchDexSummaryResponse:
96
93
  """Fetch summary data for the given DEX protocol.
97
94
 
98
95
  Args:
@@ -104,7 +101,7 @@ class DefiLlamaFetchDexSummary(DefiLlamaBaseTool):
104
101
  """
105
102
  try:
106
103
  # Check rate limiting
107
- context = self.context_from_config(config)
104
+ context = self.get_context()
108
105
  is_rate_limited, error_msg = await self.check_rate_limit(context)
109
106
  if is_rate_limited:
110
107
  return FetchDexSummaryResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import Dict, List, Optional, Type
4
4
 
5
- from langchain.schema.runnable import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_options_overview
@@ -104,7 +103,7 @@ class DefiLlamaFetchOptionsOverview(DefiLlamaBaseTool):
104
103
 
105
104
  args_schema: Type[BaseModel] = EmptyArgsSchema
106
105
 
107
- async def _arun(self, config: RunnableConfig) -> FetchOptionsOverviewResponse:
106
+ async def _arun(self, **kwargs) -> FetchOptionsOverviewResponse:
108
107
  """Fetch overview data for all options protocols.
109
108
 
110
109
  Returns:
@@ -112,7 +111,7 @@ class DefiLlamaFetchOptionsOverview(DefiLlamaBaseTool):
112
111
  """
113
112
  try:
114
113
  # Check rate limiting
115
- context = self.context_from_config(config)
114
+ context = self.get_context()
116
115
  is_rate_limited, error_msg = await self.check_rate_limit(context)
117
116
  if is_rate_limited:
118
117
  return FetchOptionsOverviewResponse(error=error_msg)
@@ -2,7 +2,6 @@
2
2
 
3
3
  from typing import List, Optional, Type
4
4
 
5
- from langchain_core.runnables import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
7
  from intentkit.skills.defillama.api import fetch_pool_chart
@@ -68,9 +67,7 @@ class DefiLlamaFetchPoolChart(DefiLlamaBaseTool):
68
67
  description: str = FETCH_POOL_CHART_PROMPT
69
68
  args_schema: Type[BaseModel] = FetchPoolChartInput
70
69
 
71
- async def _arun(
72
- self, config: RunnableConfig, pool_id: str
73
- ) -> FetchPoolChartResponse:
70
+ async def _arun(self, pool_id: str) -> FetchPoolChartResponse:
74
71
  """Fetch historical chart data for the given pool.
75
72
 
76
73
  Args:
@@ -81,7 +78,7 @@ class DefiLlamaFetchPoolChart(DefiLlamaBaseTool):
81
78
  """
82
79
  try:
83
80
  # Check rate limiting
84
- context = self.context_from_config(config)
81
+ context = self.get_context()
85
82
  is_rate_limited, error_msg = await self.check_rate_limit(context)
86
83
  if is_rate_limited:
87
84
  return FetchPoolChartResponse(error=error_msg)