intentkit 0.8.17.dev1__py3-none-any.whl → 0.8.17.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 (272) hide show
  1. intentkit/__init__.py +1 -1
  2. intentkit/abstracts/agent.py +4 -5
  3. intentkit/abstracts/engine.py +5 -5
  4. intentkit/abstracts/graph.py +6 -5
  5. intentkit/abstracts/skill.py +5 -5
  6. intentkit/abstracts/twitter.py +4 -5
  7. intentkit/clients/cdp.py +19 -77
  8. intentkit/clients/twitter.py +26 -34
  9. intentkit/clients/web3.py +1 -3
  10. intentkit/config/config.py +4 -0
  11. intentkit/core/agent.py +15 -15
  12. intentkit/core/asset.py +1 -2
  13. intentkit/core/client.py +1 -1
  14. intentkit/core/credit.py +19 -20
  15. intentkit/core/engine.py +2 -4
  16. intentkit/core/node.py +2 -1
  17. intentkit/core/prompt.py +3 -4
  18. intentkit/core/scheduler.py +1 -1
  19. intentkit/core/statistics.py +6 -7
  20. intentkit/models/agent.py +125 -92
  21. intentkit/models/agent_data.py +62 -36
  22. intentkit/models/app_setting.py +6 -6
  23. intentkit/models/chat.py +27 -24
  24. intentkit/models/conversation.py +8 -8
  25. intentkit/models/credit.py +62 -64
  26. intentkit/models/db.py +8 -7
  27. intentkit/models/db_mig.py +2 -2
  28. intentkit/models/llm.py +12 -14
  29. intentkit/models/redis.py +2 -3
  30. intentkit/models/skill.py +25 -27
  31. intentkit/models/user.py +21 -22
  32. intentkit/skills/acolyt/ask.py +3 -4
  33. intentkit/skills/acolyt/base.py +1 -3
  34. intentkit/skills/aixbt/base.py +1 -3
  35. intentkit/skills/aixbt/projects.py +13 -13
  36. intentkit/skills/allora/base.py +1 -3
  37. intentkit/skills/allora/price.py +2 -3
  38. intentkit/skills/base.py +15 -22
  39. intentkit/skills/basename/__init__.py +3 -5
  40. intentkit/skills/carv/__init__.py +7 -8
  41. intentkit/skills/carv/base.py +6 -6
  42. intentkit/skills/carv/fetch_news.py +3 -3
  43. intentkit/skills/carv/onchain_query.py +4 -4
  44. intentkit/skills/carv/token_info_and_price.py +5 -5
  45. intentkit/skills/casino/base.py +1 -3
  46. intentkit/skills/casino/deck_draw.py +1 -2
  47. intentkit/skills/casino/deck_shuffle.py +1 -2
  48. intentkit/skills/casino/dice_roll.py +1 -2
  49. intentkit/skills/cdp/__init__.py +3 -5
  50. intentkit/skills/cdp/base.py +1 -3
  51. intentkit/skills/chainlist/base.py +1 -3
  52. intentkit/skills/chainlist/chain_lookup.py +18 -18
  53. intentkit/skills/common/base.py +1 -3
  54. intentkit/skills/common/current_time.py +1 -2
  55. intentkit/skills/cookiefun/base.py +1 -2
  56. intentkit/skills/cookiefun/get_account_details.py +7 -7
  57. intentkit/skills/cookiefun/get_account_feed.py +19 -19
  58. intentkit/skills/cookiefun/get_account_smart_followers.py +7 -7
  59. intentkit/skills/cookiefun/get_sectors.py +3 -3
  60. intentkit/skills/cookiefun/search_accounts.py +9 -9
  61. intentkit/skills/cryptocompare/api.py +2 -3
  62. intentkit/skills/cryptocompare/base.py +6 -6
  63. intentkit/skills/cryptocompare/fetch_news.py +3 -4
  64. intentkit/skills/cryptocompare/fetch_price.py +5 -6
  65. intentkit/skills/cryptocompare/fetch_top_exchanges.py +3 -4
  66. intentkit/skills/cryptocompare/fetch_top_market_cap.py +3 -4
  67. intentkit/skills/cryptocompare/fetch_top_volume.py +3 -4
  68. intentkit/skills/cryptocompare/fetch_trading_signals.py +4 -5
  69. intentkit/skills/cryptopanic/__init__.py +4 -4
  70. intentkit/skills/cryptopanic/base.py +1 -3
  71. intentkit/skills/cryptopanic/fetch_crypto_news.py +3 -5
  72. intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +3 -3
  73. intentkit/skills/dapplooker/base.py +1 -3
  74. intentkit/skills/dapplooker/dapplooker_token_data.py +7 -7
  75. intentkit/skills/defillama/api.py +6 -9
  76. intentkit/skills/defillama/base.py +5 -6
  77. intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +6 -8
  78. intentkit/skills/defillama/coins/fetch_block.py +4 -6
  79. intentkit/skills/defillama/coins/fetch_current_prices.py +6 -8
  80. intentkit/skills/defillama/coins/fetch_first_price.py +5 -7
  81. intentkit/skills/defillama/coins/fetch_historical_prices.py +7 -9
  82. intentkit/skills/defillama/coins/fetch_price_chart.py +7 -9
  83. intentkit/skills/defillama/coins/fetch_price_percentage.py +5 -7
  84. intentkit/skills/defillama/config/chains.py +1 -3
  85. intentkit/skills/defillama/fees/fetch_fees_overview.py +22 -24
  86. intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +14 -16
  87. intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +6 -8
  88. intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +3 -5
  89. intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +5 -7
  90. intentkit/skills/defillama/tests/api_integration.test.py +1 -1
  91. intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -4
  92. intentkit/skills/defillama/tvl/fetch_chains.py +7 -9
  93. intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -4
  94. intentkit/skills/defillama/tvl/fetch_protocol.py +30 -36
  95. intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +1 -3
  96. intentkit/skills/defillama/tvl/fetch_protocols.py +35 -43
  97. intentkit/skills/defillama/volumes/fetch_dex_overview.py +40 -46
  98. intentkit/skills/defillama/volumes/fetch_dex_summary.py +33 -35
  99. intentkit/skills/defillama/volumes/fetch_options_overview.py +22 -26
  100. intentkit/skills/defillama/yields/fetch_pool_chart.py +8 -10
  101. intentkit/skills/defillama/yields/fetch_pools.py +24 -28
  102. intentkit/skills/dexscreener/__init__.py +2 -2
  103. intentkit/skills/dexscreener/base.py +3 -3
  104. intentkit/skills/dexscreener/get_pair_info.py +2 -2
  105. intentkit/skills/dexscreener/get_token_pairs.py +2 -2
  106. intentkit/skills/dexscreener/get_tokens_info.py +5 -5
  107. intentkit/skills/dexscreener/model/search_token_response.py +80 -82
  108. intentkit/skills/dexscreener/search_token.py +182 -182
  109. intentkit/skills/dexscreener/utils.py +15 -14
  110. intentkit/skills/dune_analytics/__init__.py +4 -4
  111. intentkit/skills/dune_analytics/base.py +1 -3
  112. intentkit/skills/dune_analytics/fetch_kol_buys.py +4 -4
  113. intentkit/skills/dune_analytics/fetch_nation_metrics.py +5 -5
  114. intentkit/skills/elfa/base.py +1 -3
  115. intentkit/skills/elfa/mention.py +19 -21
  116. intentkit/skills/elfa/stats.py +4 -4
  117. intentkit/skills/elfa/tokens.py +12 -12
  118. intentkit/skills/elfa/utils.py +25 -27
  119. intentkit/skills/enso/__init__.py +2 -2
  120. intentkit/skills/enso/base.py +5 -8
  121. intentkit/skills/enso/best_yield.py +4 -6
  122. intentkit/skills/enso/networks.py +1 -2
  123. intentkit/skills/enso/prices.py +1 -3
  124. intentkit/skills/enso/route.py +1 -3
  125. intentkit/skills/enso/tokens.py +1 -3
  126. intentkit/skills/enso/wallet.py +5 -5
  127. intentkit/skills/erc20/__init__.py +4 -6
  128. intentkit/skills/erc721/__init__.py +4 -6
  129. intentkit/skills/firecrawl/base.py +1 -3
  130. intentkit/skills/firecrawl/clear.py +1 -2
  131. intentkit/skills/firecrawl/crawl.py +9 -10
  132. intentkit/skills/firecrawl/query.py +1 -2
  133. intentkit/skills/firecrawl/scrape.py +7 -8
  134. intentkit/skills/firecrawl/utils.py +13 -13
  135. intentkit/skills/github/base.py +1 -3
  136. intentkit/skills/github/github_search.py +1 -2
  137. intentkit/skills/heurist/base.py +1 -3
  138. intentkit/skills/heurist/image_generation_animagine_xl.py +7 -8
  139. intentkit/skills/heurist/image_generation_arthemy_comics.py +7 -8
  140. intentkit/skills/heurist/image_generation_arthemy_real.py +7 -8
  141. intentkit/skills/heurist/image_generation_braindance.py +7 -8
  142. intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +7 -8
  143. intentkit/skills/heurist/image_generation_flux_1_dev.py +7 -8
  144. intentkit/skills/heurist/image_generation_sdxl.py +7 -8
  145. intentkit/skills/http/base.py +1 -3
  146. intentkit/skills/http/get.py +7 -7
  147. intentkit/skills/http/post.py +9 -9
  148. intentkit/skills/http/put.py +9 -9
  149. intentkit/skills/lifi/__init__.py +4 -4
  150. intentkit/skills/lifi/base.py +1 -3
  151. intentkit/skills/lifi/token_execute.py +13 -13
  152. intentkit/skills/lifi/token_quote.py +6 -6
  153. intentkit/skills/lifi/utils.py +16 -16
  154. intentkit/skills/moralis/__init__.py +3 -3
  155. intentkit/skills/moralis/api.py +6 -7
  156. intentkit/skills/moralis/base.py +2 -4
  157. intentkit/skills/moralis/fetch_chain_portfolio.py +10 -11
  158. intentkit/skills/moralis/fetch_nft_portfolio.py +22 -22
  159. intentkit/skills/moralis/fetch_solana_portfolio.py +11 -12
  160. intentkit/skills/moralis/fetch_wallet_portfolio.py +8 -9
  161. intentkit/skills/morpho/__init__.py +4 -6
  162. intentkit/skills/nation/__init__.py +2 -2
  163. intentkit/skills/nation/base.py +1 -3
  164. intentkit/skills/nation/nft_check.py +3 -4
  165. intentkit/skills/onchain.py +2 -6
  166. intentkit/skills/openai/base.py +1 -3
  167. intentkit/skills/openai/dalle_image_generation.py +1 -3
  168. intentkit/skills/openai/gpt_image_generation.py +2 -3
  169. intentkit/skills/openai/gpt_image_to_image.py +2 -3
  170. intentkit/skills/openai/image_to_text.py +1 -2
  171. intentkit/skills/portfolio/base.py +6 -6
  172. intentkit/skills/portfolio/token_balances.py +21 -21
  173. intentkit/skills/portfolio/wallet_approvals.py +7 -7
  174. intentkit/skills/portfolio/wallet_defi_positions.py +3 -3
  175. intentkit/skills/portfolio/wallet_history.py +21 -21
  176. intentkit/skills/portfolio/wallet_net_worth.py +13 -13
  177. intentkit/skills/portfolio/wallet_nfts.py +19 -19
  178. intentkit/skills/portfolio/wallet_profitability.py +7 -7
  179. intentkit/skills/portfolio/wallet_profitability_summary.py +5 -5
  180. intentkit/skills/portfolio/wallet_stats.py +3 -3
  181. intentkit/skills/portfolio/wallet_swaps.py +19 -19
  182. intentkit/skills/pyth/__init__.py +3 -5
  183. intentkit/skills/slack/base.py +2 -4
  184. intentkit/skills/slack/get_channel.py +8 -8
  185. intentkit/skills/slack/get_message.py +9 -9
  186. intentkit/skills/slack/schedule_message.py +5 -5
  187. intentkit/skills/slack/send_message.py +3 -5
  188. intentkit/skills/supabase/base.py +1 -3
  189. intentkit/skills/supabase/delete_data.py +4 -4
  190. intentkit/skills/supabase/fetch_data.py +12 -12
  191. intentkit/skills/supabase/insert_data.py +4 -4
  192. intentkit/skills/supabase/invoke_function.py +6 -6
  193. intentkit/skills/supabase/update_data.py +6 -6
  194. intentkit/skills/supabase/upsert_data.py +4 -4
  195. intentkit/skills/superfluid/__init__.py +4 -6
  196. intentkit/skills/system/add_autonomous_task.py +8 -10
  197. intentkit/skills/system/edit_autonomous_task.py +12 -14
  198. intentkit/skills/system/list_autonomous_tasks.py +1 -3
  199. intentkit/skills/tavily/base.py +1 -3
  200. intentkit/skills/tavily/tavily_extract.py +1 -2
  201. intentkit/skills/tavily/tavily_search.py +1 -3
  202. intentkit/skills/token/base.py +5 -5
  203. intentkit/skills/token/erc20_transfers.py +19 -19
  204. intentkit/skills/token/token_analytics.py +3 -3
  205. intentkit/skills/token/token_price.py +13 -13
  206. intentkit/skills/token/token_search.py +9 -9
  207. intentkit/skills/twitter/base.py +3 -4
  208. intentkit/skills/twitter/follow_user.py +1 -2
  209. intentkit/skills/twitter/get_mentions.py +3 -4
  210. intentkit/skills/twitter/get_timeline.py +1 -2
  211. intentkit/skills/twitter/get_user_by_username.py +1 -2
  212. intentkit/skills/twitter/get_user_tweets.py +2 -3
  213. intentkit/skills/twitter/like_tweet.py +1 -2
  214. intentkit/skills/twitter/post_tweet.py +3 -4
  215. intentkit/skills/twitter/reply_tweet.py +3 -4
  216. intentkit/skills/twitter/retweet.py +1 -2
  217. intentkit/skills/twitter/search_tweets.py +1 -2
  218. intentkit/skills/unrealspeech/base.py +1 -3
  219. intentkit/skills/unrealspeech/text_to_speech.py +8 -8
  220. intentkit/skills/venice_audio/__init__.py +8 -9
  221. intentkit/skills/venice_audio/base.py +3 -4
  222. intentkit/skills/venice_audio/input.py +41 -41
  223. intentkit/skills/venice_audio/venice_audio.py +6 -6
  224. intentkit/skills/venice_image/__init__.py +5 -5
  225. intentkit/skills/venice_image/api.py +138 -138
  226. intentkit/skills/venice_image/base.py +3 -3
  227. intentkit/skills/venice_image/config.py +33 -35
  228. intentkit/skills/venice_image/image_enhance/image_enhance.py +2 -3
  229. intentkit/skills/venice_image/image_enhance/image_enhance_base.py +21 -23
  230. intentkit/skills/venice_image/image_enhance/image_enhance_input.py +38 -40
  231. intentkit/skills/venice_image/image_generation/image_generation_base.py +9 -9
  232. intentkit/skills/venice_image/image_generation/image_generation_fluently_xl.py +26 -26
  233. intentkit/skills/venice_image/image_generation/image_generation_flux_dev.py +27 -27
  234. intentkit/skills/venice_image/image_generation/image_generation_flux_dev_uncensored.py +26 -26
  235. intentkit/skills/venice_image/image_generation/image_generation_input.py +158 -158
  236. intentkit/skills/venice_image/image_generation/image_generation_lustify_sdxl.py +26 -26
  237. intentkit/skills/venice_image/image_generation/image_generation_pony_realism.py +26 -26
  238. intentkit/skills/venice_image/image_generation/image_generation_stable_diffusion_3_5.py +28 -28
  239. intentkit/skills/venice_image/image_generation/image_generation_venice_sd35.py +28 -28
  240. intentkit/skills/venice_image/image_upscale/image_upscale.py +3 -3
  241. intentkit/skills/venice_image/image_upscale/image_upscale_base.py +21 -23
  242. intentkit/skills/venice_image/image_upscale/image_upscale_input.py +22 -22
  243. intentkit/skills/venice_image/image_vision/image_vision.py +2 -2
  244. intentkit/skills/venice_image/image_vision/image_vision_base.py +17 -17
  245. intentkit/skills/venice_image/image_vision/image_vision_input.py +9 -9
  246. intentkit/skills/venice_image/utils.py +77 -78
  247. intentkit/skills/web_scraper/base.py +1 -3
  248. intentkit/skills/web_scraper/document_indexer.py +1 -2
  249. intentkit/skills/web_scraper/scrape_and_index.py +4 -5
  250. intentkit/skills/web_scraper/utils.py +25 -26
  251. intentkit/skills/web_scraper/website_indexer.py +10 -11
  252. intentkit/skills/weth/__init__.py +4 -6
  253. intentkit/skills/wow/__init__.py +4 -6
  254. intentkit/skills/x402/__init__.py +2 -2
  255. intentkit/skills/x402/ask_agent.py +7 -7
  256. intentkit/skills/x402/base.py +2 -1
  257. intentkit/skills/x402/http_request.py +10 -10
  258. intentkit/skills/xmtp/base.py +3 -3
  259. intentkit/skills/xmtp/price.py +2 -2
  260. intentkit/skills/xmtp/swap.py +2 -4
  261. intentkit/skills/xmtp/transfer.py +4 -6
  262. intentkit/utils/error.py +2 -2
  263. intentkit/utils/logging.py +2 -4
  264. intentkit/utils/s3.py +8 -9
  265. intentkit/utils/schema.py +5 -5
  266. intentkit/utils/slack_alert.py +7 -8
  267. {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/METADATA +3 -4
  268. intentkit-0.8.17.dev2.dist-info/RECORD +464 -0
  269. intentkit/models/generator.py +0 -347
  270. intentkit-0.8.17.dev1.dist-info/RECORD +0 -465
  271. {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/WHEEL +0 -0
  272. {intentkit-0.8.17.dev1.dist-info → intentkit-0.8.17.dev2.dist-info}/licenses/LICENSE +0 -0
@@ -1,7 +1,6 @@
1
1
  """fetching Solana wallet portfolio."""
2
2
 
3
3
  import logging
4
- from typing import Dict, List, Optional, Type
5
4
 
6
5
  from pydantic import BaseModel, Field
7
6
 
@@ -48,17 +47,17 @@ class SolanaTokenBalance(BaseModel):
48
47
  token_info: SolanaTokenInfo
49
48
  amount: float
50
49
  amount_raw: str
51
- usd_value: Optional[float] = 0.0
50
+ usd_value: float | None = 0.0
52
51
 
53
52
 
54
53
  class SolanaNftInfo(BaseModel):
55
54
  """Model for Solana NFT information."""
56
55
 
57
56
  mint: str
58
- name: Optional[str] = None
59
- symbol: Optional[str] = None
57
+ name: str | None = None
58
+ symbol: str | None = None
60
59
  associated_token_address: str
61
- metadata: Optional[Dict] = None
60
+ metadata: dict | None = None
62
61
 
63
62
 
64
63
  class SolanaPortfolioOutput(BaseModel):
@@ -67,12 +66,12 @@ class SolanaPortfolioOutput(BaseModel):
67
66
  address: str
68
67
  sol_balance: float
69
68
  sol_balance_lamports: int
70
- sol_price_usd: Optional[float] = None
71
- sol_value_usd: Optional[float] = None
72
- tokens: List[SolanaTokenBalance] = []
73
- nfts: List[SolanaNftInfo] = []
69
+ sol_price_usd: float | None = None
70
+ sol_value_usd: float | None = None
71
+ tokens: list[SolanaTokenBalance] = []
72
+ nfts: list[SolanaNftInfo] = []
74
73
  total_value_usd: float = 0.0
75
- error: Optional[str] = None
74
+ error: str | None = None
76
75
 
77
76
 
78
77
  class FetchSolanaPortfolio(WalletBaseTool):
@@ -91,7 +90,7 @@ class FetchSolanaPortfolio(WalletBaseTool):
91
90
  "- USD values of assets\n"
92
91
  "Use this tool whenever the user asks specifically about Solana holdings."
93
92
  )
94
- args_schema: Type[BaseModel] = SolanaPortfolioInput
93
+ args_schema: type[BaseModel] = SolanaPortfolioInput
95
94
 
96
95
  async def _arun(
97
96
  self,
@@ -136,7 +135,7 @@ class FetchSolanaPortfolio(WalletBaseTool):
136
135
  self,
137
136
  address: str,
138
137
  network: str,
139
- sol_portfolio: Dict,
138
+ sol_portfolio: dict,
140
139
  include_nfts: bool,
141
140
  include_price_data: bool,
142
141
  ) -> SolanaPortfolioOutput:
@@ -1,7 +1,6 @@
1
1
  """fetching a complete wallet portfolio (EVM + Solana)."""
2
2
 
3
3
  import logging
4
- from typing import Dict, List, Optional, Type
5
4
 
6
5
  from pydantic import BaseModel, Field
7
6
 
@@ -24,7 +23,7 @@ class FetchWalletPortfolioInput(BaseModel):
24
23
  address: str = Field(
25
24
  ..., description="Wallet address to analyze (Ethereum or Solana)"
26
25
  )
27
- chains: Optional[List[int]] = Field(
26
+ chains: list[int] | None = Field(
28
27
  default=None,
29
28
  description="List of EVM chain IDs to check (default: all supported)",
30
29
  )
@@ -51,9 +50,9 @@ class PortfolioOutput(BaseModel):
51
50
 
52
51
  address: str
53
52
  total_net_worth: float
54
- chains: Dict[str, float]
55
- tokens: List[TokenBalance]
56
- error: Optional[str] = None
53
+ chains: dict[str, float]
54
+ tokens: list[TokenBalance]
55
+ error: str | None = None
57
56
 
58
57
 
59
58
  class FetchWalletPortfolio(WalletBaseTool):
@@ -73,12 +72,12 @@ class FetchWalletPortfolio(WalletBaseTool):
73
72
  "Use this tool whenever the user asks about their crypto holdings, portfolio value, "
74
73
  "or wallet contents across multiple blockchains."
75
74
  )
76
- args_schema: Type[BaseModel] = FetchWalletPortfolioInput
75
+ args_schema: type[BaseModel] = FetchWalletPortfolioInput
77
76
 
78
77
  async def _arun(
79
78
  self,
80
79
  address: str,
81
- chains: Optional[List[int]] = None,
80
+ chains: list[int] | None = None,
82
81
  include_solana: bool = True,
83
82
  solana_network: str = "mainnet",
84
83
  **kwargs,
@@ -119,7 +118,7 @@ class FetchWalletPortfolio(WalletBaseTool):
119
118
  )
120
119
 
121
120
  async def _fetch_evm_portfolio(
122
- self, address: str, chains: Optional[List[int]], portfolio: Dict
121
+ self, address: str, chains: list[int] | None, portfolio: dict
123
122
  ) -> None:
124
123
  """Fetch portfolio data for EVM chains.
125
124
 
@@ -165,7 +164,7 @@ class FetchWalletPortfolio(WalletBaseTool):
165
164
  )
166
165
 
167
166
  async def _fetch_solana_portfolio(
168
- self, address: str, network: str, portfolio: Dict
167
+ self, address: str, network: str, portfolio: dict
169
168
  ) -> None:
170
169
  """Fetch portfolio data for Solana.
171
170
 
@@ -1,9 +1,10 @@
1
1
  """Morpho AgentKit skills."""
2
2
 
3
- from typing import TYPE_CHECKING, Optional, TypedDict
3
+ from typing import TypedDict
4
4
 
5
5
  from coinbase_agentkit import morpho_action_provider
6
6
 
7
+ from intentkit.models.agent import Agent
7
8
  from intentkit.skills.base import (
8
9
  SkillConfig,
9
10
  SkillState,
@@ -12,9 +13,6 @@ from intentkit.skills.base import (
12
13
  )
13
14
  from intentkit.skills.morpho.base import MorphoBaseTool
14
15
 
15
- if TYPE_CHECKING:
16
- from intentkit.models.agent import Agent
17
-
18
16
 
19
17
  class SkillStates(TypedDict):
20
18
  MorphoActionProvider_deposit: SkillState
@@ -28,10 +26,10 @@ class Config(SkillConfig):
28
26
 
29
27
 
30
28
  async def get_skills(
31
- config: "Config",
29
+ config: Config,
32
30
  is_private: bool,
33
31
  agent_id: str,
34
- agent: Optional["Agent"] = None,
32
+ agent: Agent | None = None,
35
33
  **_,
36
34
  ) -> list[MorphoBaseTool]:
37
35
  """Get all Morpho skills."""
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Optional, TypedDict
2
+ from typing import TypedDict
3
3
 
4
4
  from intentkit.skills.base import SkillConfig, SkillState
5
5
  from intentkit.skills.nation.base import NationBaseTool
@@ -46,7 +46,7 @@ async def get_skills(
46
46
 
47
47
  def get_nation_skill(
48
48
  name: str,
49
- ) -> Optional[NationBaseTool]:
49
+ ) -> NationBaseTool | None:
50
50
  """Get a nation skill by name."""
51
51
  if name == "nft_check":
52
52
  if name not in _cache:
@@ -1,5 +1,3 @@
1
- from typing import Type
2
-
3
1
  from pydantic import BaseModel, Field
4
2
 
5
3
  from intentkit.config.config import config
@@ -13,7 +11,7 @@ class NationBaseTool(IntentKitSkill):
13
11
 
14
12
  name: str = Field(description="The name of the tool")
15
13
  description: str = Field(description="A description of what the tool does")
16
- args_schema: Type[BaseModel]
14
+ args_schema: type[BaseModel]
17
15
 
18
16
  def get_api_key(self) -> str:
19
17
  return config.nation_api_key
@@ -1,5 +1,4 @@
1
1
  import logging
2
- from typing import Optional, Type
3
2
 
4
3
  import httpx
5
4
  from eth_utils import is_address
@@ -11,7 +10,7 @@ logger = logging.getLogger(__name__)
11
10
 
12
11
 
13
12
  class NftCheckInput(BaseModel):
14
- nation_wallet_address: Optional[str] = Field(
13
+ nation_wallet_address: str | None = Field(
15
14
  default=None, description="Nation wallet address"
16
15
  )
17
16
 
@@ -19,9 +18,9 @@ class NftCheckInput(BaseModel):
19
18
  class NftCheck(NationBaseTool):
20
19
  name: str = "nft_check"
21
20
  description: str = "Check user nation pass NFTs stats in nation, including usage status and linked agents.By default, it will use the user_id as the wallet address. If you want to check other wallet address, please pass the nation_wallet_address parameter."
22
- args_schema: Type[BaseModel] = NftCheckInput
21
+ args_schema: type[BaseModel] = NftCheckInput
23
22
 
24
- async def _arun(self, nation_wallet_address: Optional[str] = None) -> str:
23
+ async def _arun(self, nation_wallet_address: str | None = None) -> str:
25
24
  """Implementation of the NFT Check tool.
26
25
 
27
26
  Args:
@@ -1,14 +1,10 @@
1
- from typing import TYPE_CHECKING
2
-
1
+ from cdp import EvmServerAccount
3
2
  from web3 import Web3
4
3
 
5
4
  from intentkit.clients import get_evm_account as fetch_evm_account
6
5
  from intentkit.clients.web3 import get_web3_client
7
6
  from intentkit.skills.base import IntentKitSkill
8
7
 
9
- if TYPE_CHECKING:
10
- from cdp import EvmServerAccount
11
-
12
8
 
13
9
  class IntentKitOnChainSkill(IntentKitSkill):
14
10
  """Shared helpers for on-chain enabled skills."""
@@ -20,7 +16,7 @@ class IntentKitOnChainSkill(IntentKitSkill):
20
16
  network_id = agent.network_id
21
17
  return get_web3_client(network_id)
22
18
 
23
- async def get_evm_account(self) -> "EvmServerAccount":
19
+ async def get_evm_account(self) -> EvmServerAccount:
24
20
  """Fetch the EVM account associated with the active agent."""
25
21
  context = self.get_context()
26
22
  agent = context.agent
@@ -1,7 +1,5 @@
1
1
  """Base class for OpenAI skills."""
2
2
 
3
- from typing import Type
4
-
5
3
  from langchain_core.tools.base import ToolException
6
4
  from pydantic import BaseModel, Field
7
5
 
@@ -17,7 +15,7 @@ class OpenAIBaseTool(IntentKitSkill):
17
15
 
18
16
  name: str = Field(description="The name of the tool")
19
17
  description: str = Field(description="A description of what the tool does")
20
- args_schema: Type[BaseModel]
18
+ args_schema: type[BaseModel]
21
19
 
22
20
  def get_api_key(self) -> str:
23
21
  context = self.get_context()
@@ -1,7 +1,6 @@
1
1
  """DALL-E image generation skill for OpenAI."""
2
2
 
3
3
  import logging
4
- from typing import Type
5
4
 
6
5
  import openai
7
6
  from epyxid import XID
@@ -53,7 +52,7 @@ class DALLEImageGeneration(OpenAIBaseTool):
53
52
  "high-quality images from text descriptions.\n"
54
53
  "You can specify size, quality, and style parameters for more control.\n"
55
54
  )
56
- args_schema: Type[BaseModel] = DALLEImageGenerationInput
55
+ args_schema: type[BaseModel] = DALLEImageGenerationInput
57
56
 
58
57
  async def _arun(
59
58
  self,
@@ -71,7 +70,6 @@ class DALLEImageGeneration(OpenAIBaseTool):
71
70
  quality: Quality of the generated image. Options: standard, hd
72
71
  style: Style of the generated image. Options: vivid, natural
73
72
 
74
-
75
73
  Returns:
76
74
  str: URL of the generated image.
77
75
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  import base64
4
4
  import logging
5
- from typing import Literal, Type
5
+ from typing import Literal
6
6
 
7
7
  import openai
8
8
  from epyxid import XID
@@ -54,7 +54,7 @@ class GPTImageGeneration(OpenAIBaseTool):
54
54
  "high-quality images from text descriptions.\n"
55
55
  "You can specify size, quality, and background parameters for more control.\n"
56
56
  )
57
- args_schema: Type[BaseModel] = GPTImageGenerationInput
57
+ args_schema: type[BaseModel] = GPTImageGenerationInput
58
58
 
59
59
  async def _arun(
60
60
  self,
@@ -72,7 +72,6 @@ class GPTImageGeneration(OpenAIBaseTool):
72
72
  quality: Quality of the generated image. Options: high, medium, low, auto
73
73
  background: Background transparency. Options: transparent, opaque, auto
74
74
 
75
-
76
75
  Returns:
77
76
  str: URL of the generated image.
78
77
 
@@ -3,7 +3,7 @@
3
3
  import base64
4
4
  import logging
5
5
  from io import BytesIO
6
- from typing import Literal, Type
6
+ from typing import Literal
7
7
 
8
8
  import httpx
9
9
  import openai
@@ -55,7 +55,7 @@ class GPTImageToImage(OpenAIBaseTool):
55
55
  "based on text descriptions.\n"
56
56
  "You can specify size and quality parameters for more control.\n"
57
57
  )
58
- args_schema: Type[BaseModel] = GPTImageToImageInput
58
+ args_schema: type[BaseModel] = GPTImageToImageInput
59
59
 
60
60
  async def _arun(
61
61
  self,
@@ -73,7 +73,6 @@ class GPTImageToImage(OpenAIBaseTool):
73
73
  size: Size of the generated image. Options: 1024x1024, 1536x1024, 1024x1536, auto
74
74
  quality: Quality of the generated image. Options: high, medium, low, auto
75
75
 
76
-
77
76
  Returns:
78
77
  str: URL of the edited image.
79
78
 
@@ -1,6 +1,5 @@
1
1
  import io
2
2
  import logging
3
- from typing import Type
4
3
 
5
4
  import aiohttp
6
5
  import openai
@@ -46,7 +45,7 @@ class ImageToText(OpenAIBaseTool):
46
45
  "Provide a URL to the image to analyze and get a comprehensive textual description.\n"
47
46
  "Optimized for DALL-E generated images and preserves as many details as possible."
48
47
  )
49
- args_schema: Type[BaseModel] = ImageToTextInput
48
+ args_schema: type[BaseModel] = ImageToTextInput
50
49
 
51
50
  async def _arun(self, image: str, **kwargs) -> ImageToTextOutput:
52
51
  """Implementation of the tool to convert images to text.
@@ -3,7 +3,7 @@
3
3
  import asyncio
4
4
  import logging
5
5
  from abc import ABC
6
- from typing import Any, Dict, Type
6
+ from typing import Any
7
7
 
8
8
  import aiohttp
9
9
  from langchain_core.tools import ToolException
@@ -21,7 +21,7 @@ class PortfolioBaseTool(IntentKitSkill, ABC):
21
21
 
22
22
  name: str = Field(description="The name of the tool")
23
23
  description: str = Field(description="A description of what the tool does")
24
- args_schema: Type[BaseModel]
24
+ args_schema: type[BaseModel]
25
25
 
26
26
  def get_api_key(self) -> str:
27
27
  context = self.get_context()
@@ -40,7 +40,7 @@ class PortfolioBaseTool(IntentKitSkill, ABC):
40
40
  def category(self) -> str:
41
41
  return "portfolio"
42
42
 
43
- def _prepare_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
43
+ def _prepare_params(self, params: dict[str, Any]) -> dict[str, Any]:
44
44
  """Convert boolean values to lowercase strings for API compatibility.
45
45
 
46
46
  Args:
@@ -65,9 +65,9 @@ class PortfolioBaseTool(IntentKitSkill, ABC):
65
65
  method: str,
66
66
  endpoint: str,
67
67
  api_key: str,
68
- params: Dict[str, Any] = None,
69
- data: Dict[str, Any] = None,
70
- ) -> Dict[str, Any]:
68
+ params: dict[str, Any] = None,
69
+ data: dict[str, Any] = None,
70
+ ) -> dict[str, Any]:
71
71
  """Make a request to the Moralis API.
72
72
 
73
73
  Args:
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Any, Dict, List, Optional, Type
2
+ from typing import Any
3
3
 
4
4
  from pydantic import BaseModel, Field
5
5
 
@@ -20,39 +20,39 @@ class TokenBalancesInput(BaseModel):
20
20
  description="The chain to query (e.g., 'eth', 'bsc', 'polygon').",
21
21
  default=DEFAULT_CHAIN,
22
22
  )
23
- to_block: Optional[int] = Field(
23
+ to_block: int | None = Field(
24
24
  description="The block number up to which the balances will be checked.",
25
25
  default=None,
26
26
  )
27
- token_addresses: Optional[List[str]] = Field(
27
+ token_addresses: list[str] | None = Field(
28
28
  description="The specific token addresses to get balances for.",
29
29
  default=None,
30
30
  )
31
- exclude_spam: Optional[bool] = Field(
31
+ exclude_spam: bool | None = Field(
32
32
  description="Exclude spam tokens from the result.",
33
33
  default=True,
34
34
  )
35
- exclude_unverified_contracts: Optional[bool] = Field(
35
+ exclude_unverified_contracts: bool | None = Field(
36
36
  description="Exclude unverified contracts from the result.",
37
37
  default=True,
38
38
  )
39
- cursor: Optional[str] = Field(
39
+ cursor: str | None = Field(
40
40
  description="The cursor for pagination.",
41
41
  default=None,
42
42
  )
43
- limit: Optional[int] = Field(
43
+ limit: int | None = Field(
44
44
  description="The number of results per page.",
45
45
  default=DEFAULT_LIMIT,
46
46
  )
47
- exclude_native: Optional[bool] = Field(
47
+ exclude_native: bool | None = Field(
48
48
  description="Exclude native balance from the result.",
49
49
  default=None,
50
50
  )
51
- max_token_inactivity: Optional[int] = Field(
51
+ max_token_inactivity: int | None = Field(
52
52
  description="Exclude tokens inactive for more than the given amount of days.",
53
53
  default=None,
54
54
  )
55
- min_pair_side_liquidity_usd: Optional[float] = Field(
55
+ min_pair_side_liquidity_usd: float | None = Field(
56
56
  description="Exclude tokens with liquidity less than the specified amount in USD.",
57
57
  default=None,
58
58
  )
@@ -70,23 +70,23 @@ class TokenBalances(PortfolioBaseTool):
70
70
  "Get token balances for a specific wallet address and their token prices in USD. "
71
71
  "Includes options to exclude spam and unverified contracts."
72
72
  )
73
- args_schema: Type[BaseModel] = TokenBalancesInput
73
+ args_schema: type[BaseModel] = TokenBalancesInput
74
74
 
75
75
  async def _arun(
76
76
  self,
77
77
  address: str,
78
78
  chain: str = DEFAULT_CHAIN,
79
- to_block: Optional[int] = None,
80
- token_addresses: Optional[List[str]] = None,
81
- exclude_spam: Optional[bool] = True,
82
- exclude_unverified_contracts: Optional[bool] = True,
83
- cursor: Optional[str] = None,
84
- limit: Optional[int] = DEFAULT_LIMIT,
85
- exclude_native: Optional[bool] = None,
86
- max_token_inactivity: Optional[int] = None,
87
- min_pair_side_liquidity_usd: Optional[float] = None,
79
+ to_block: int | None = None,
80
+ token_addresses: list[str] | None = None,
81
+ exclude_spam: bool | None = True,
82
+ exclude_unverified_contracts: bool | None = True,
83
+ cursor: str | None = None,
84
+ limit: int | None = DEFAULT_LIMIT,
85
+ exclude_native: bool | None = None,
86
+ max_token_inactivity: int | None = None,
87
+ min_pair_side_liquidity_usd: float | None = None,
88
88
  **kwargs,
89
- ) -> Dict[str, Any]:
89
+ ) -> dict[str, Any]:
90
90
  """Fetch token balances from Moralis.
91
91
 
92
92
  Args:
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Any, Dict, Optional, Type
2
+ from typing import Any
3
3
 
4
4
  from langchain_core.tools import ToolException
5
5
  from pydantic import BaseModel, Field
@@ -21,11 +21,11 @@ class WalletApprovalsInput(BaseModel):
21
21
  description="The chain to query (e.g., 'eth', 'bsc', 'polygon').",
22
22
  default=DEFAULT_CHAIN,
23
23
  )
24
- cursor: Optional[str] = Field(
24
+ cursor: str | None = Field(
25
25
  description="The cursor for pagination.",
26
26
  default=None,
27
27
  )
28
- limit: Optional[int] = Field(
28
+ limit: int | None = Field(
29
29
  description="The number of results per page.",
30
30
  default=DEFAULT_LIMIT,
31
31
  )
@@ -43,16 +43,16 @@ class WalletApprovals(PortfolioBaseTool):
43
43
  "Retrieve active ERC20 token approvals for the specified wallet address. "
44
44
  "This helps identify which contracts have permission to spend tokens."
45
45
  )
46
- args_schema: Type[BaseModel] = WalletApprovalsInput
46
+ args_schema: type[BaseModel] = WalletApprovalsInput
47
47
 
48
48
  async def _arun(
49
49
  self,
50
50
  address: str,
51
51
  chain: str = DEFAULT_CHAIN,
52
- cursor: Optional[str] = None,
53
- limit: Optional[int] = DEFAULT_LIMIT,
52
+ cursor: str | None = None,
53
+ limit: int | None = DEFAULT_LIMIT,
54
54
  **kwargs,
55
- ) -> Dict[str, Any]:
55
+ ) -> dict[str, Any]:
56
56
  """Fetch wallet token approvals from Moralis.
57
57
 
58
58
  Args:
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Any, Dict, Type
2
+ from typing import Any
3
3
 
4
4
  from pydantic import BaseModel, Field
5
5
 
@@ -31,14 +31,14 @@ class WalletDefiPositions(PortfolioBaseTool):
31
31
  "Get the DeFi positions summary of a wallet address. "
32
32
  "Returns information about liquidity positions, staking, lending, and other DeFi activities."
33
33
  )
34
- args_schema: Type[BaseModel] = WalletDefiPositionsInput
34
+ args_schema: type[BaseModel] = WalletDefiPositionsInput
35
35
 
36
36
  async def _arun(
37
37
  self,
38
38
  address: str,
39
39
  chain: str = DEFAULT_CHAIN,
40
40
  **kwargs,
41
- ) -> Dict[str, Any]:
41
+ ) -> dict[str, Any]:
42
42
  """Fetch wallet DeFi positions from Moralis.
43
43
 
44
44
  Args:
@@ -1,5 +1,5 @@
1
1
  import logging
2
- from typing import Any, Dict, Optional, Type
2
+ from typing import Any
3
3
 
4
4
  from langchain_core.tools import ToolException
5
5
  from pydantic import BaseModel, Field
@@ -24,39 +24,39 @@ class WalletHistoryInput(BaseModel):
24
24
  description="The chain to query (e.g., 'eth', 'bsc', 'polygon').",
25
25
  default=DEFAULT_CHAIN,
26
26
  )
27
- limit: Optional[int] = Field(
27
+ limit: int | None = Field(
28
28
  description="The desired page size of the result.",
29
29
  default=DEFAULT_LIMIT,
30
30
  )
31
- cursor: Optional[str] = Field(
31
+ cursor: str | None = Field(
32
32
  description="The cursor returned in the previous response (for pagination).",
33
33
  default=None,
34
34
  )
35
- from_block: Optional[int] = Field(
35
+ from_block: int | None = Field(
36
36
  description="The minimum block number to get transactions from.",
37
37
  default=None,
38
38
  )
39
- to_block: Optional[int] = Field(
39
+ to_block: int | None = Field(
40
40
  description="The maximum block number to get transactions from.",
41
41
  default=None,
42
42
  )
43
- from_date: Optional[str] = Field(
43
+ from_date: str | None = Field(
44
44
  description="The start date to get transactions from (format in seconds or datestring).",
45
45
  default=None,
46
46
  )
47
- to_date: Optional[str] = Field(
47
+ to_date: str | None = Field(
48
48
  description="The end date to get transactions from (format in seconds or datestring).",
49
49
  default=None,
50
50
  )
51
- include_internal_transactions: Optional[bool] = Field(
51
+ include_internal_transactions: bool | None = Field(
52
52
  description="If the result should contain the internal transactions.",
53
53
  default=None,
54
54
  )
55
- nft_metadata: Optional[bool] = Field(
55
+ nft_metadata: bool | None = Field(
56
56
  description="If the result should contain the NFT metadata.",
57
57
  default=None,
58
58
  )
59
- order: Optional[str] = Field(
59
+ order: str | None = Field(
60
60
  description="The order of the result, in ascending (ASC) or descending (DESC).",
61
61
  default=DEFAULT_ORDER,
62
62
  )
@@ -74,23 +74,23 @@ class WalletHistory(PortfolioBaseTool):
74
74
  "Retrieve the full transaction history of a specified wallet address, including sends, "
75
75
  "receives, token and NFT transfers, and contract interactions."
76
76
  )
77
- args_schema: Type[BaseModel] = WalletHistoryInput
77
+ args_schema: type[BaseModel] = WalletHistoryInput
78
78
 
79
79
  async def _arun(
80
80
  self,
81
81
  address: str,
82
82
  chain: str = DEFAULT_CHAIN,
83
- limit: Optional[int] = DEFAULT_LIMIT,
84
- cursor: Optional[str] = None,
85
- from_block: Optional[int] = None,
86
- to_block: Optional[int] = None,
87
- from_date: Optional[str] = None,
88
- to_date: Optional[str] = None,
89
- include_internal_transactions: Optional[bool] = None,
90
- nft_metadata: Optional[bool] = None,
91
- order: Optional[str] = DEFAULT_ORDER,
83
+ limit: int | None = DEFAULT_LIMIT,
84
+ cursor: str | None = None,
85
+ from_block: int | None = None,
86
+ to_block: int | None = None,
87
+ from_date: str | None = None,
88
+ to_date: str | None = None,
89
+ include_internal_transactions: bool | None = None,
90
+ nft_metadata: bool | None = None,
91
+ order: str | None = DEFAULT_ORDER,
92
92
  **kwargs,
93
- ) -> Dict[str, Any]:
93
+ ) -> dict[str, Any]:
94
94
  """Fetch wallet transaction history from Moralis.
95
95
 
96
96
  Args: