intentkit 0.6.9.dev1__py3-none-any.whl → 0.6.10.dev1__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 +29 -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 +13 -0
  162. intentkit/skills/xmtp/schema.json +41 -0
  163. intentkit/skills/xmtp/transfer.py +170 -0
  164. intentkit/skills/xmtp/xmtp.svg +26 -0
  165. {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dev1.dist-info}/METADATA +3 -3
  166. {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dev1.dist-info}/RECORD +168 -162
  167. {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dev1.dist-info}/WHEEL +0 -0
  168. {intentkit-0.6.9.dev1.dist-info → intentkit-0.6.10.dev1.dist-info}/licenses/LICENSE +0 -0
@@ -2,11 +2,13 @@ from typing import Optional, Type
2
2
 
3
3
  from cdp import EvmServerAccount
4
4
  from coinbase_agentkit import CdpEvmServerWalletProvider
5
+ from langchain.tools.base import ToolException
5
6
  from pydantic import BaseModel, Field
6
7
 
8
+ from intentkit.abstracts.graph import AgentContext
7
9
  from intentkit.abstracts.skill import SkillStoreABC
8
10
  from intentkit.clients import CdpClient, get_cdp_client
9
- from intentkit.skills.base import IntentKitSkill, SkillContext
11
+ from intentkit.skills.base import IntentKitSkill
10
12
  from intentkit.utils.chain import ChainProvider, NetworkId
11
13
 
12
14
  base_url = "https://api.enso.finance"
@@ -23,7 +25,7 @@ class EnsoBaseTool(IntentKitSkill):
23
25
  description="The skill store for persisting data"
24
26
  )
25
27
 
26
- async def get_account(self, context: SkillContext) -> Optional[EvmServerAccount]:
28
+ async def get_account(self, context: AgentContext) -> Optional[EvmServerAccount]:
27
29
  """Get the account object from the CDP client.
28
30
 
29
31
  Args:
@@ -32,11 +34,11 @@ class EnsoBaseTool(IntentKitSkill):
32
34
  Returns:
33
35
  Optional[EvmServerAccount]: The account object if available.
34
36
  """
35
- client: CdpClient = await get_cdp_client(context.agent_id, self.skill_store)
37
+ client: CdpClient = await get_cdp_client(context.agent.id, self.skill_store)
36
38
  return await client.get_account()
37
39
 
38
40
  async def get_wallet_provider(
39
- self, context: SkillContext
41
+ self, context: AgentContext
40
42
  ) -> Optional[CdpEvmServerWalletProvider]:
41
43
  """Get the wallet provider from the CDP client.
42
44
 
@@ -46,21 +48,31 @@ class EnsoBaseTool(IntentKitSkill):
46
48
  Returns:
47
49
  Optional[CdpEvmServerWalletProvider]: The wallet provider if available.
48
50
  """
49
- client: CdpClient = await get_cdp_client(context.agent_id, self.skill_store)
51
+ client: CdpClient = await get_cdp_client(context.agent.id, self.skill_store)
50
52
  return await client.get_wallet_provider()
51
53
 
52
- def get_chain_provider(self, context: SkillContext) -> Optional[ChainProvider]:
54
+ def get_chain_provider(self, context: AgentContext) -> Optional[ChainProvider]:
53
55
  return self.skill_store.get_system_config("chain_provider")
54
56
 
55
- def get_main_tokens(self, context: SkillContext) -> list[str]:
56
- if "main_tokens" in context.config and context.config["main_tokens"]:
57
- return context.config["main_tokens"]
57
+ def get_main_tokens(self, context: AgentContext) -> list[str]:
58
+ skill_config = context.agent.skill_config(self.category)
59
+ if "main_tokens" in skill_config and skill_config["main_tokens"]:
60
+ return skill_config["main_tokens"]
58
61
  return []
59
62
 
60
- def get_api_token(self, context: SkillContext) -> Optional[str]:
61
- if "api_token" in context.config and context.config["api_token"]:
62
- return context.config["api_token"]
63
- return self.skill_store.get_system_config("enso_api_token")
63
+ def get_api_key(self) -> str:
64
+ context = self.get_context()
65
+ skill_config = context.agent.skill_config(self.category)
66
+ api_key_provider = skill_config.get("api_key_provider")
67
+ if api_key_provider == "platform":
68
+ return self.skill_store.get_system_config("enso_api_token")
69
+ # for backward compatibility, may only have api_token in skill_config
70
+ elif skill_config.get("api_token"):
71
+ return skill_config.get("api_token")
72
+ else:
73
+ raise ToolException(
74
+ f"Invalid API key provider: {api_key_provider}, or no api_token in config"
75
+ )
64
76
 
65
77
  @property
66
78
  def category(self) -> str:
@@ -2,10 +2,8 @@ from typing import List, Optional, Type
2
2
 
3
3
  import httpx
4
4
  from langchain.tools.base import ToolException
5
- from langchain_core.runnables import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
- from intentkit.skills.base import SkillContext
9
7
  from intentkit.skills.enso.base import (
10
8
  EnsoBaseTool,
11
9
  base_url,
@@ -81,7 +79,6 @@ class EnsoGetBestYield(EnsoBaseTool):
81
79
 
82
80
  async def _arun(
83
81
  self,
84
- config: RunnableConfig,
85
82
  token_symbol: str = "USDC",
86
83
  chain_id: int = BASE_CHAIN_ID,
87
84
  top_n: int = 5,
@@ -101,7 +98,7 @@ class EnsoGetBestYield(EnsoBaseTool):
101
98
  Raises:
102
99
  ToolException: If there's an error accessing the Enso API.
103
100
  """
104
- context: SkillContext = self.context_from_config(config)
101
+ context = self.get_context()
105
102
  api_token = self.get_api_token(context)
106
103
 
107
104
  if not api_token:
@@ -3,11 +3,8 @@ from typing import Type
3
3
 
4
4
  import httpx
5
5
  from langchain.tools.base import ToolException
6
- from langchain_core.runnables import RunnableConfig
7
6
  from pydantic import BaseModel, Field
8
7
 
9
- from intentkit.skills.base import SkillContext
10
-
11
8
  from .base import EnsoBaseTool, base_url
12
9
 
13
10
  logger = logging.getLogger(__name__)
@@ -50,7 +47,7 @@ class EnsoGetNetworks(EnsoBaseTool):
50
47
  description: str = "Retrieve networks supported by the Enso API"
51
48
  args_schema: Type[BaseModel] = EnsoGetNetworksInput
52
49
 
53
- async def _arun(self, config: RunnableConfig, **kwargs) -> EnsoGetNetworksOutput:
50
+ async def _arun(self, **kwargs) -> EnsoGetNetworksOutput:
54
51
  """
55
52
  Function to request the list of supported networks and their chain id and name.
56
53
 
@@ -59,7 +56,7 @@ class EnsoGetNetworks(EnsoBaseTool):
59
56
  """
60
57
  url = f"{base_url}/api/v1/networks"
61
58
 
62
- context: SkillContext = self.context_from_config(config)
59
+ context = self.get_context()
63
60
  api_token = self.get_api_token(context)
64
61
  logger.debug(f"api_token: {api_token}")
65
62
  headers = {
@@ -2,11 +2,8 @@ from typing import Type
2
2
 
3
3
  import httpx
4
4
  from langchain.tools.base import ToolException
5
- from langchain_core.runnables import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
- from intentkit.skills.base import SkillContext
9
-
10
7
  from .base import EnsoBaseTool, base_url, default_chain_id
11
8
 
12
9
 
@@ -46,7 +43,6 @@ class EnsoGetPrices(EnsoBaseTool):
46
43
  async def _arun(
47
44
  self,
48
45
  address: str,
49
- config: RunnableConfig,
50
46
  chainId: int = default_chain_id,
51
47
  **kwargs,
52
48
  ) -> EnsoGetPricesOutput:
@@ -62,7 +58,7 @@ class EnsoGetPrices(EnsoBaseTool):
62
58
  """
63
59
  url = f"{base_url}/api/v1/prices/{str(chainId)}/{address}"
64
60
 
65
- context: SkillContext = self.context_from_config(config)
61
+ context = self.get_context()
66
62
  api_token = self.get_api_token(context)
67
63
 
68
64
  headers = {
@@ -2,10 +2,8 @@ from typing import Type
2
2
 
3
3
  import httpx
4
4
  from langchain.tools.base import ToolException
5
- from langchain_core.runnables import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
- from intentkit.skills.base import SkillContext
9
7
  from intentkit.skills.enso.networks import EnsoGetNetworks
10
8
 
11
9
  from .base import EnsoBaseTool, base_url, default_chain_id
@@ -164,7 +162,6 @@ class EnsoRouteShortcut(EnsoBaseTool):
164
162
  amountIn: list[int],
165
163
  tokenIn: list[str],
166
164
  tokenOut: list[str],
167
- config: RunnableConfig,
168
165
  chainId: int = default_chain_id,
169
166
  broadcast_requested: bool = False,
170
167
  **kwargs,
@@ -183,7 +180,7 @@ class EnsoRouteShortcut(EnsoBaseTool):
183
180
  EnsoRouteShortcutOutput: The response containing route shortcut information.
184
181
  """
185
182
 
186
- context: SkillContext = self.context_from_config(config)
183
+ context = self.get_context()
187
184
  agent_id = context.agent_id
188
185
  api_token = self.get_api_token(context)
189
186
  account = await self.get_account(context)
@@ -204,7 +201,7 @@ class EnsoRouteShortcut(EnsoBaseTool):
204
201
  if network_name is None:
205
202
  networks = await EnsoGetNetworks(
206
203
  skill_store=self.skill_store,
207
- ).arun(config)
204
+ ).arun()
208
205
 
209
206
  for network in networks.res:
210
207
  if network.id == chainId:
@@ -2,10 +2,8 @@ from typing import Type
2
2
 
3
3
  import httpx
4
4
  from langchain.tools.base import ToolException
5
- from langchain_core.runnables import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
- from intentkit.skills.base import SkillContext
9
7
  from intentkit.skills.enso.base import (
10
8
  EnsoBaseTool,
11
9
  base_url,
@@ -140,7 +138,6 @@ class EnsoGetTokens(EnsoBaseTool):
140
138
 
141
139
  async def _arun(
142
140
  self,
143
- config: RunnableConfig,
144
141
  chainId: int = default_chain_id,
145
142
  protocolSlug: str | None = None,
146
143
  **kwargs,
@@ -157,7 +154,7 @@ class EnsoGetTokens(EnsoBaseTool):
157
154
  """
158
155
  url = f"{base_url}/api/v1/tokens"
159
156
 
160
- context: SkillContext = self.context_from_config(config)
157
+ context = self.get_context()
161
158
  agent_id = context.agent_id
162
159
  api_token = self.get_api_token(context)
163
160
  main_tokens = self.get_main_tokens(context)
@@ -2,11 +2,8 @@ from typing import Literal, Tuple, Type
2
2
 
3
3
  import httpx
4
4
  from langchain.tools.base import ToolException
5
- from langchain_core.runnables import RunnableConfig
6
5
  from pydantic import BaseModel, Field
7
6
 
8
- from intentkit.skills.base import SkillContext
9
-
10
7
  from .base import EnsoBaseTool, base_url, default_chain_id
11
8
 
12
9
 
@@ -62,7 +59,6 @@ class EnsoGetWalletBalances(EnsoBaseTool):
62
59
 
63
60
  async def _arun(
64
61
  self,
65
- config: RunnableConfig,
66
62
  chainId: int = default_chain_id,
67
63
  **kwargs,
68
64
  ) -> EnsoGetBalancesOutput:
@@ -77,7 +73,7 @@ class EnsoGetWalletBalances(EnsoBaseTool):
77
73
  """
78
74
  url = f"{base_url}/api/v1/wallet/balances"
79
75
 
80
- context: SkillContext = self.context_from_config(config)
76
+ context = self.get_context()
81
77
  api_token = self.get_api_token(context)
82
78
  account = await self.get_account(context)
83
79
  headers = {
@@ -158,7 +154,6 @@ class EnsoGetWalletApprovals(EnsoBaseTool):
158
154
 
159
155
  async def _arun(
160
156
  self,
161
- config: RunnableConfig,
162
157
  chainId: int = default_chain_id,
163
158
  **kwargs,
164
159
  ) -> EnsoGetApprovalsOutput:
@@ -174,7 +169,7 @@ class EnsoGetWalletApprovals(EnsoBaseTool):
174
169
  """
175
170
  url = f"{base_url}/api/v1/wallet/approvals"
176
171
 
177
- context: SkillContext = self.context_from_config(config)
172
+ context = self.get_context()
178
173
  api_token = self.get_api_token(context)
179
174
  account = await self.get_account(context)
180
175
 
@@ -297,7 +292,6 @@ class EnsoWalletApprove(EnsoBaseTool):
297
292
  self,
298
293
  tokenAddress: str,
299
294
  amount: int,
300
- config: RunnableConfig,
301
295
  chainId: int = default_chain_id,
302
296
  **kwargs,
303
297
  ) -> Tuple[EnsoWalletApproveOutput, EnsoWalletApproveArtifact]:
@@ -314,7 +308,7 @@ class EnsoWalletApprove(EnsoBaseTool):
314
308
  Tuple[EnsoBroadcastWalletApproveOutput, EnsoBroadcastWalletApproveArtifact]: The list of approve transaction output or an error message.
315
309
  """
316
310
  url = f"{base_url}/api/v1/wallet/approve"
317
- context: SkillContext = self.context_from_config(config)
311
+ context = self.get_context()
318
312
  api_token = self.get_api_token(context)
319
313
  account = await self.get_account(context)
320
314
 
@@ -1,9 +1,10 @@
1
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 FirecrawlBaseTool(IntentKitSkill):
@@ -16,12 +17,21 @@ class FirecrawlBaseTool(IntentKitSkill):
16
17
  description="The skill store for persisting data"
17
18
  )
18
19
 
19
- def get_api_key(self, context: SkillContext) -> str:
20
+ def get_api_key(self) -> str:
20
21
  """Get the Firecrawl API key from configuration."""
21
- skill_config = context.config
22
- if skill_config.get("api_key_provider") == "agent_owner":
23
- return skill_config.get("api_key")
24
- return self.skill_store.get_system_config("firecrawl_api_key")
22
+ context = self.get_context()
23
+ skill_config = context.agent.skill_config(self.category)
24
+ api_key_provider = skill_config.get("api_key_provider")
25
+ if api_key_provider == "agent_owner":
26
+ api_key = skill_config.get("api_key")
27
+ if api_key:
28
+ return api_key
29
+ else:
30
+ raise ToolException("No api_key found in agent_owner configuration")
31
+ else:
32
+ raise ToolException(
33
+ f"Invalid API key provider: {api_key_provider}. Only 'agent_owner' is supported for Firecrawl."
34
+ )
25
35
 
26
36
  @property
27
37
  def category(self) -> str:
@@ -1,7 +1,6 @@
1
1
  import logging
2
2
  from typing import Type
3
3
 
4
- from langchain_core.runnables import RunnableConfig
5
4
  from pydantic import BaseModel, Field
6
5
 
7
6
  from intentkit.skills.firecrawl.base import FirecrawlBaseTool
@@ -36,7 +35,6 @@ class FirecrawlClearIndexedContent(FirecrawlBaseTool):
36
35
  async def _arun(
37
36
  self,
38
37
  confirm: bool = False,
39
- config: RunnableConfig = None,
40
38
  **kwargs,
41
39
  ) -> str:
42
40
  """Clear all indexed Firecrawl content for the agent.
@@ -48,7 +46,7 @@ class FirecrawlClearIndexedContent(FirecrawlBaseTool):
48
46
  Returns:
49
47
  str: Confirmation message
50
48
  """
51
- context = self.context_from_config(config)
49
+ context = self.get_context()
52
50
  agent_id = context.agent_id
53
51
 
54
52
  if not agent_id:
@@ -4,7 +4,6 @@ from typing import List, Optional, Type
4
4
 
5
5
  import httpx
6
6
  from langchain_core.documents import Document
7
- from langchain_core.runnables import RunnableConfig
8
7
  from pydantic import BaseModel, Field
9
8
 
10
9
  from intentkit.skills.firecrawl.base import FirecrawlBaseTool
@@ -109,7 +108,6 @@ class FirecrawlCrawl(FirecrawlBaseTool):
109
108
  index_content: bool = True,
110
109
  chunk_size: int = 1000,
111
110
  chunk_overlap: int = 200,
112
- config: RunnableConfig = None,
113
111
  **kwargs,
114
112
  ) -> str:
115
113
  """Implementation of the Firecrawl crawl tool.
@@ -130,21 +128,22 @@ class FirecrawlCrawl(FirecrawlBaseTool):
130
128
  Returns:
131
129
  str: Formatted crawled content from all pages.
132
130
  """
133
- context = self.context_from_config(config)
131
+ context = self.get_context()
132
+ skill_config = context.agent.skill_config(self.category)
134
133
  logger.debug(f"firecrawl_crawl: Running crawl with context {context}")
135
134
 
136
- if context.config.get("api_key_provider") == "agent_owner":
137
- if context.config.get("rate_limit_number") and context.config.get(
135
+ if skill_config.get("api_key_provider") == "agent_owner":
136
+ if skill_config.get("rate_limit_number") and skill_config.get(
138
137
  "rate_limit_minutes"
139
138
  ):
140
139
  await self.user_rate_limit_by_category(
141
140
  context.user_id,
142
- context.config["rate_limit_number"],
143
- context.config["rate_limit_minutes"],
141
+ skill_config["rate_limit_number"],
142
+ skill_config["rate_limit_minutes"],
144
143
  )
145
144
 
146
145
  # Get the API key from the agent's configuration
147
- api_key = self.get_api_key(context)
146
+ api_key = self.get_api_key()
148
147
  if not api_key:
149
148
  return "Error: No Firecrawl API key provided in the configuration."
150
149
 
@@ -1,7 +1,6 @@
1
1
  import logging
2
2
  from typing import Type
3
3
 
4
- from langchain_core.runnables import RunnableConfig
5
4
  from pydantic import BaseModel, Field
6
5
 
7
6
  from intentkit.skills.firecrawl.base import FirecrawlBaseTool
@@ -44,16 +43,15 @@ class FirecrawlQueryIndexedContent(FirecrawlBaseTool):
44
43
  self,
45
44
  query: str,
46
45
  max_results: int = 4,
47
- config: RunnableConfig = None,
48
46
  **kwargs,
49
47
  ) -> str:
50
48
  """Query the indexed Firecrawl content."""
51
49
  try:
52
50
  # Get agent context - throw error if not available
53
- if not config:
54
- raise ValueError("Configuration is required but not provided")
51
+ # Configuration is always available in new runtime
52
+ pass
55
53
 
56
- context = self.context_from_config(config)
54
+ context = self.get_context()
57
55
  if not context or not context.agent_id:
58
56
  raise ValueError("Agent ID is required but not found in configuration")
59
57
 
@@ -109,10 +107,10 @@ class FirecrawlQueryIndexedContent(FirecrawlBaseTool):
109
107
  # Extract agent_id for error logging if possible
110
108
  agent_id = "UNKNOWN"
111
109
  try:
112
- if config:
113
- context = self.context_from_config(config)
114
- if context and context.agent_id:
115
- agent_id = context.agent_id
110
+ # TODO: Fix config reference
111
+ context = self.get_context()
112
+ if context and context.agent_id:
113
+ agent_id = context.agent_id
116
114
  except Exception:
117
115
  pass
118
116
 
@@ -3,7 +3,6 @@ from typing import List, Optional, Type
3
3
 
4
4
  import httpx
5
5
  from langchain_core.documents import Document
6
- from langchain_core.runnables import RunnableConfig
7
6
  from pydantic import BaseModel, Field
8
7
 
9
8
  from intentkit.skills.firecrawl.base import FirecrawlBaseTool
@@ -95,7 +94,6 @@ class FirecrawlScrape(FirecrawlBaseTool):
95
94
  index_content: bool = True,
96
95
  chunk_size: int = 1000,
97
96
  chunk_overlap: int = 200,
98
- config: RunnableConfig = None,
99
97
  **kwargs,
100
98
  ) -> str:
101
99
  """Implementation of the Firecrawl scrape tool.
@@ -116,21 +114,22 @@ class FirecrawlScrape(FirecrawlBaseTool):
116
114
  Returns:
117
115
  str: Formatted scraped content based on the requested formats.
118
116
  """
119
- context = self.context_from_config(config)
117
+ context = self.get_context()
118
+ skill_config = context.agent.skill_config(self.category)
120
119
  logger.debug(f"firecrawl_scrape: Running scrape with context {context}")
121
120
 
122
- if context.config.get("api_key_provider") == "agent_owner":
123
- if context.config.get("rate_limit_number") and context.config.get(
121
+ if skill_config.get("api_key_provider") == "agent_owner":
122
+ if skill_config.get("rate_limit_number") and skill_config.get(
124
123
  "rate_limit_minutes"
125
124
  ):
126
125
  await self.user_rate_limit_by_category(
127
126
  context.user_id,
128
- context.config["rate_limit_number"],
129
- context.config["rate_limit_minutes"],
127
+ skill_config["rate_limit_number"],
128
+ skill_config["rate_limit_minutes"],
130
129
  )
131
130
 
132
131
  # Get the API key from the agent's configuration
133
- api_key = self.get_api_key(context)
132
+ api_key = self.get_api_key()
134
133
  if not api_key:
135
134
  return "Error: No Firecrawl API key provided in the configuration."
136
135
 
@@ -3,7 +3,6 @@ from enum import Enum
3
3
  from typing import 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.github.base import GitHubBaseTool
@@ -62,7 +61,6 @@ class GitHubSearch(GitHubBaseTool):
62
61
  query: str,
63
62
  search_type: SearchType = SearchType.REPOSITORIES,
64
63
  max_results: int = 5,
65
- config: RunnableConfig = None,
66
64
  **kwargs,
67
65
  ) -> str:
68
66
  """Implementation of the GitHub search tool.
@@ -76,7 +74,7 @@ class GitHubSearch(GitHubBaseTool):
76
74
  Returns:
77
75
  str: Formatted search results based on the search type.
78
76
  """
79
- context = self.context_from_config(config)
77
+ context = self.get_context()
80
78
  logger.debug(f"github_search.py: Running GitHub search with context {context}")
81
79
 
82
80
  # Limit max_results to a reasonable range
@@ -2,6 +2,7 @@
2
2
 
3
3
  from typing import Type
4
4
 
5
+ from langchain.tools.base import ToolException
5
6
  from pydantic import BaseModel, Field
6
7
 
7
8
  from intentkit.abstracts.skill import SkillStoreABC
@@ -21,6 +22,20 @@ class HeuristBaseTool(IntentKitSkill):
21
22
  description="The skill store for persisting data"
22
23
  )
23
24
 
25
+ def get_api_key(self) -> str:
26
+ context = self.get_context()
27
+ skill_config = context.agent.skill_config(self.category)
28
+ api_key_provider = skill_config.get("api_key_provider")
29
+ if api_key_provider == "platform":
30
+ return self.skill_store.get_system_config("heurist_api_key")
31
+ # for backward compatibility, may only have api_key in skill_config
32
+ elif skill_config.get("api_key"):
33
+ return skill_config.get("api_key")
34
+ else:
35
+ raise ToolException(
36
+ f"Invalid API key provider: {api_key_provider}, or no api_key in config"
37
+ )
38
+
24
39
  @property
25
40
  def category(self) -> str:
26
41
  return "heurist"
@@ -3,7 +3,6 @@ from typing import Optional, Type
3
3
 
4
4
  import httpx
5
5
  from epyxid import XID
6
- from langchain_core.runnables import RunnableConfig
7
6
  from pydantic import BaseModel, Field
8
7
 
9
8
  from intentkit.skills.heurist.base import HeuristBaseTool
@@ -61,7 +60,6 @@ class ImageGenerationAnimagineXL(HeuristBaseTool):
61
60
  neg_prompt: Optional[str] = "(worst quality: 1.4), bad quality, nsfw",
62
61
  width: Optional[int] = 1024,
63
62
  height: Optional[int] = 680,
64
- config: RunnableConfig = None,
65
63
  **kwargs,
66
64
  ) -> str:
67
65
  """Implementation of the tool to generate Japanese anime-style images using Heurist AI's AnimagineXL model.
@@ -77,8 +75,9 @@ class ImageGenerationAnimagineXL(HeuristBaseTool):
77
75
  Returns:
78
76
  str: URL of the generated image.
79
77
  """
80
- context = self.context_from_config(config)
81
- skill_config = context.config
78
+ context = self.get_context()
79
+ skill_config = context.agent.skill_config(self.category)
80
+ skill_config = skill_config
82
81
 
83
82
  # Get the Heurist API key from the skill store
84
83
  if "api_key" in skill_config and skill_config["api_key"]:
@@ -3,7 +3,6 @@ from typing import Optional, Type
3
3
 
4
4
  import httpx
5
5
  from epyxid import XID
6
- from langchain_core.runnables import RunnableConfig
7
6
  from pydantic import BaseModel, Field
8
7
 
9
8
  from intentkit.skills.heurist.base import HeuristBaseTool
@@ -61,7 +60,6 @@ class ImageGenerationArthemyComics(HeuristBaseTool):
61
60
  neg_prompt: Optional[str] = "(worst quality: 1.4), bad quality, nsfw",
62
61
  width: Optional[int] = 1024,
63
62
  height: Optional[int] = 680,
64
- config: RunnableConfig = None,
65
63
  **kwargs,
66
64
  ) -> str:
67
65
  """Implementation of the tool to generate comic-style images using Heurist AI's ArthemyComics model.
@@ -76,8 +74,9 @@ class ImageGenerationArthemyComics(HeuristBaseTool):
76
74
  Returns:
77
75
  str: URL of the generated image.
78
76
  """
79
- context = self.context_from_config(config)
80
- skill_config = context.config
77
+ context = self.get_context()
78
+ skill_config = context.agent.skill_config(self.category)
79
+ skill_config = skill_config
81
80
 
82
81
  # Get the Heurist API key from the skill store
83
82
  if "api_key" in skill_config and skill_config["api_key"]:
@@ -3,7 +3,6 @@ from typing import Optional, Type
3
3
 
4
4
  import httpx
5
5
  from epyxid import XID
6
- from langchain_core.runnables import RunnableConfig
7
6
  from pydantic import BaseModel, Field
8
7
 
9
8
  from intentkit.skills.heurist.base import HeuristBaseTool
@@ -61,7 +60,6 @@ class ImageGenerationArthemyReal(HeuristBaseTool):
61
60
  neg_prompt: Optional[str] = "(worst quality: 1.4), bad quality, nsfw",
62
61
  width: Optional[int] = 1024,
63
62
  height: Optional[int] = 680,
64
- config: RunnableConfig = None,
65
63
  **kwargs,
66
64
  ) -> str:
67
65
  """Implementation of the tool to generate realistic images using Heurist AI's ArthemyReal model.
@@ -76,8 +74,9 @@ class ImageGenerationArthemyReal(HeuristBaseTool):
76
74
  Returns:
77
75
  str: URL of the generated image.
78
76
  """
79
- context = self.context_from_config(config)
80
- skill_config = context.config
77
+ context = self.get_context()
78
+ skill_config = context.agent.skill_config(self.category)
79
+ skill_config = skill_config
81
80
 
82
81
  # Get the Heurist API key from the skill store
83
82
  if "api_key" in skill_config and skill_config["api_key"]:
@@ -3,7 +3,6 @@ from typing import Optional, Type
3
3
 
4
4
  import httpx
5
5
  from epyxid import XID
6
- from langchain_core.runnables import RunnableConfig
7
6
  from pydantic import BaseModel, Field
8
7
 
9
8
  from intentkit.skills.heurist.base import HeuristBaseTool
@@ -61,7 +60,6 @@ class ImageGenerationBrainDance(HeuristBaseTool):
61
60
  neg_prompt: Optional[str] = "(worst quality: 1.4), bad quality, nsfw",
62
61
  width: Optional[int] = 1024,
63
62
  height: Optional[int] = 680,
64
- config: RunnableConfig = None,
65
63
  **kwargs,
66
64
  ) -> str:
67
65
  """Implementation of the tool to generate artistic images using Heurist AI's BrainDance model.
@@ -76,8 +74,9 @@ class ImageGenerationBrainDance(HeuristBaseTool):
76
74
  Returns:
77
75
  str: URL of the generated image.
78
76
  """
79
- context = self.context_from_config(config)
80
- skill_config = context.config
77
+ context = self.get_context()
78
+ skill_config = context.agent.skill_config(self.category)
79
+ skill_config = skill_config
81
80
 
82
81
  # Get the Heurist API key from the skill store
83
82
  if "api_key" in skill_config and skill_config["api_key"]: