intentkit 0.8.12.dev1__py3-none-any.whl → 0.8.12.dev3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of intentkit might be problematic. Click here for more details.

Files changed (168) hide show
  1. intentkit/__init__.py +1 -1
  2. intentkit/abstracts/skill.py +2 -59
  3. intentkit/clients/twitter.py +35 -28
  4. intentkit/core/agent.py +2 -279
  5. intentkit/core/engine.py +3 -4
  6. intentkit/models/agent.py +109 -89
  7. intentkit/models/agent_schema.json +4 -2
  8. intentkit/skills/acolyt/__init__.py +2 -9
  9. intentkit/skills/acolyt/base.py +2 -5
  10. intentkit/skills/aixbt/__init__.py +2 -13
  11. intentkit/skills/aixbt/base.py +0 -4
  12. intentkit/skills/aixbt/projects.py +1 -2
  13. intentkit/skills/allora/__init__.py +2 -9
  14. intentkit/skills/allora/base.py +2 -5
  15. intentkit/skills/base.py +101 -27
  16. intentkit/skills/basename/__init__.py +1 -3
  17. intentkit/skills/carv/__init__.py +116 -121
  18. intentkit/skills/carv/base.py +184 -185
  19. intentkit/skills/casino/__init__.py +4 -15
  20. intentkit/skills/casino/base.py +0 -4
  21. intentkit/skills/casino/deck_draw.py +1 -2
  22. intentkit/skills/casino/deck_shuffle.py +1 -2
  23. intentkit/skills/casino/dice_roll.py +1 -2
  24. intentkit/skills/cdp/__init__.py +0 -4
  25. intentkit/skills/cdp/base.py +0 -4
  26. intentkit/skills/chainlist/__init__.py +2 -7
  27. intentkit/skills/chainlist/base.py +0 -4
  28. intentkit/skills/common/__init__.py +2 -9
  29. intentkit/skills/common/base.py +0 -4
  30. intentkit/skills/cookiefun/__init__.py +6 -9
  31. intentkit/skills/cookiefun/base.py +0 -4
  32. intentkit/skills/cryptocompare/__init__.py +7 -24
  33. intentkit/skills/cryptocompare/base.py +0 -5
  34. intentkit/skills/cryptopanic/__init__.py +3 -6
  35. intentkit/skills/cryptopanic/base.py +53 -55
  36. intentkit/skills/cryptopanic/fetch_crypto_news.py +0 -2
  37. intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +1 -3
  38. intentkit/skills/dapplooker/__init__.py +2 -9
  39. intentkit/skills/dapplooker/base.py +2 -5
  40. intentkit/skills/defillama/__init__.py +24 -74
  41. intentkit/skills/defillama/base.py +0 -4
  42. intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +2 -2
  43. intentkit/skills/defillama/coins/fetch_block.py +2 -2
  44. intentkit/skills/defillama/coins/fetch_current_prices.py +2 -2
  45. intentkit/skills/defillama/coins/fetch_first_price.py +2 -2
  46. intentkit/skills/defillama/coins/fetch_historical_prices.py +2 -2
  47. intentkit/skills/defillama/coins/fetch_price_chart.py +2 -2
  48. intentkit/skills/defillama/coins/fetch_price_percentage.py +2 -2
  49. intentkit/skills/defillama/fees/fetch_fees_overview.py +2 -2
  50. intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +2 -2
  51. intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +2 -2
  52. intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +2 -2
  53. intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +2 -2
  54. intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -2
  55. intentkit/skills/defillama/tvl/fetch_chains.py +2 -2
  56. intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -2
  57. intentkit/skills/defillama/tvl/fetch_protocol.py +2 -2
  58. intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +2 -2
  59. intentkit/skills/defillama/tvl/fetch_protocols.py +2 -2
  60. intentkit/skills/defillama/volumes/fetch_dex_overview.py +2 -2
  61. intentkit/skills/defillama/volumes/fetch_dex_summary.py +2 -2
  62. intentkit/skills/defillama/volumes/fetch_options_overview.py +2 -2
  63. intentkit/skills/defillama/yields/fetch_pool_chart.py +2 -2
  64. intentkit/skills/defillama/yields/fetch_pools.py +2 -2
  65. intentkit/skills/dexscreener/__init__.py +97 -102
  66. intentkit/skills/dexscreener/base.py +125 -130
  67. intentkit/skills/dexscreener/get_pair_info.py +2 -3
  68. intentkit/skills/dexscreener/get_token_pairs.py +2 -3
  69. intentkit/skills/dexscreener/get_tokens_info.py +2 -3
  70. intentkit/skills/dexscreener/search_token.py +2 -4
  71. intentkit/skills/dune_analytics/__init__.py +4 -6
  72. intentkit/skills/dune_analytics/base.py +50 -52
  73. intentkit/skills/dune_analytics/fetch_kol_buys.py +0 -2
  74. intentkit/skills/dune_analytics/fetch_nation_metrics.py +0 -2
  75. intentkit/skills/elfa/__init__.py +5 -18
  76. intentkit/skills/elfa/base.py +8 -10
  77. intentkit/skills/enso/__init__.py +9 -29
  78. intentkit/skills/enso/base.py +3 -6
  79. intentkit/skills/enso/route.py +1 -3
  80. intentkit/skills/erc20/__init__.py +1 -5
  81. intentkit/skills/erc721/__init__.py +1 -3
  82. intentkit/skills/firecrawl/__init__.py +5 -18
  83. intentkit/skills/firecrawl/base.py +2 -5
  84. intentkit/skills/firecrawl/crawl.py +10 -9
  85. intentkit/skills/firecrawl/query.py +3 -1
  86. intentkit/skills/firecrawl/scrape.py +8 -10
  87. intentkit/skills/firecrawl/utils.py +25 -26
  88. intentkit/skills/github/__init__.py +2 -7
  89. intentkit/skills/github/base.py +0 -4
  90. intentkit/skills/heurist/__init__.py +8 -27
  91. intentkit/skills/heurist/base.py +2 -5
  92. intentkit/skills/heurist/image_generation_animagine_xl.py +5 -5
  93. intentkit/skills/heurist/image_generation_arthemy_comics.py +5 -5
  94. intentkit/skills/heurist/image_generation_arthemy_real.py +5 -5
  95. intentkit/skills/heurist/image_generation_braindance.py +5 -5
  96. intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +5 -5
  97. intentkit/skills/heurist/image_generation_flux_1_dev.py +5 -5
  98. intentkit/skills/heurist/image_generation_sdxl.py +5 -5
  99. intentkit/skills/http/__init__.py +4 -15
  100. intentkit/skills/http/base.py +0 -4
  101. intentkit/skills/lifi/__init__.py +1 -6
  102. intentkit/skills/lifi/base.py +0 -4
  103. intentkit/skills/lifi/token_execute.py +1 -4
  104. intentkit/skills/lifi/token_quote.py +1 -3
  105. intentkit/skills/moralis/__init__.py +3 -7
  106. intentkit/skills/moralis/base.py +2 -5
  107. intentkit/skills/morpho/__init__.py +1 -3
  108. intentkit/skills/nation/__init__.py +2 -7
  109. intentkit/skills/nation/base.py +4 -7
  110. intentkit/skills/openai/__init__.py +5 -18
  111. intentkit/skills/openai/base.py +8 -10
  112. intentkit/skills/openai/dalle_image_generation.py +2 -5
  113. intentkit/skills/openai/gpt_image_generation.py +2 -5
  114. intentkit/skills/openai/gpt_image_to_image.py +2 -5
  115. intentkit/skills/openai/image_to_text.py +2 -5
  116. intentkit/skills/portfolio/__init__.py +11 -35
  117. intentkit/skills/portfolio/base.py +2 -5
  118. intentkit/skills/pyth/__init__.py +1 -5
  119. intentkit/skills/slack/__init__.py +5 -17
  120. intentkit/skills/slack/base.py +0 -4
  121. intentkit/skills/supabase/__init__.py +7 -23
  122. intentkit/skills/supabase/base.py +0 -4
  123. intentkit/skills/superfluid/__init__.py +1 -3
  124. intentkit/skills/system/__init__.py +7 -24
  125. intentkit/skills/system/add_autonomous_task.py +2 -2
  126. intentkit/skills/system/delete_autonomous_task.py +2 -2
  127. intentkit/skills/system/edit_autonomous_task.py +2 -4
  128. intentkit/skills/system/list_autonomous_tasks.py +2 -2
  129. intentkit/skills/system/read_agent_api_key.py +6 -4
  130. intentkit/skills/system/regenerate_agent_api_key.py +6 -4
  131. intentkit/skills/tavily/__init__.py +3 -12
  132. intentkit/skills/tavily/base.py +2 -5
  133. intentkit/skills/tavily/tavily_extract.py +1 -2
  134. intentkit/skills/tavily/tavily_search.py +3 -3
  135. intentkit/skills/token/__init__.py +5 -10
  136. intentkit/skills/token/base.py +2 -6
  137. intentkit/skills/twitter/__init__.py +11 -35
  138. intentkit/skills/twitter/base.py +14 -16
  139. intentkit/skills/twitter/follow_user.py +0 -1
  140. intentkit/skills/twitter/get_mentions.py +0 -1
  141. intentkit/skills/twitter/get_timeline.py +0 -1
  142. intentkit/skills/twitter/get_user_by_username.py +0 -1
  143. intentkit/skills/twitter/get_user_tweets.py +0 -1
  144. intentkit/skills/twitter/like_tweet.py +0 -1
  145. intentkit/skills/twitter/post_tweet.py +2 -2
  146. intentkit/skills/twitter/reply_tweet.py +2 -2
  147. intentkit/skills/twitter/retweet.py +0 -1
  148. intentkit/skills/twitter/search_tweets.py +0 -1
  149. intentkit/skills/unrealspeech/__init__.py +2 -7
  150. intentkit/skills/unrealspeech/base.py +0 -4
  151. intentkit/skills/venice_audio/__init__.py +99 -106
  152. intentkit/skills/venice_audio/base.py +118 -121
  153. intentkit/skills/venice_audio/venice_audio.py +1 -5
  154. intentkit/skills/venice_image/__init__.py +147 -154
  155. intentkit/skills/venice_image/base.py +185 -192
  156. intentkit/skills/web_scraper/__init__.py +5 -18
  157. intentkit/skills/web_scraper/base.py +20 -4
  158. intentkit/skills/web_scraper/document_indexer.py +6 -4
  159. intentkit/skills/web_scraper/scrape_and_index.py +11 -8
  160. intentkit/skills/web_scraper/utils.py +31 -27
  161. intentkit/skills/web_scraper/website_indexer.py +7 -8
  162. intentkit/skills/weth/__init__.py +1 -5
  163. intentkit/skills/wow/__init__.py +1 -5
  164. intentkit/skills/xmtp/__init__.py +4 -15
  165. {intentkit-0.8.12.dev1.dist-info → intentkit-0.8.12.dev3.dist-info}/METADATA +1 -1
  166. {intentkit-0.8.12.dev1.dist-info → intentkit-0.8.12.dev3.dist-info}/RECORD +168 -168
  167. {intentkit-0.8.12.dev1.dist-info → intentkit-0.8.12.dev3.dist-info}/WHEEL +0 -0
  168. {intentkit-0.8.12.dev1.dist-info → intentkit-0.8.12.dev3.dist-info}/licenses/LICENSE +0 -0
@@ -3,7 +3,6 @@
3
3
  import logging
4
4
  from typing import TypedDict
5
5
 
6
- from intentkit.abstracts.skill import SkillStoreABC
7
6
  from intentkit.clients import TwitterClientConfig
8
7
  from intentkit.skills.base import SkillConfig, SkillState
9
8
  from intentkit.skills.twitter.base import TwitterBaseTool
@@ -46,7 +45,6 @@ class Config(SkillConfig, TwitterClientConfig):
46
45
  async def get_skills(
47
46
  config: "Config",
48
47
  is_private: bool,
49
- store: SkillStoreABC,
50
48
  **_,
51
49
  ) -> list[TwitterBaseTool]:
52
50
  """Get all Twitter skills."""
@@ -62,7 +60,7 @@ async def get_skills(
62
60
  # Get each skill using the cached getter
63
61
  result = []
64
62
  for name in available_skills:
65
- skill = get_twitter_skill(name, store)
63
+ skill = get_twitter_skill(name)
66
64
  if skill:
67
65
  result.append(skill)
68
66
  return result
@@ -70,76 +68,54 @@ async def get_skills(
70
68
 
71
69
  def get_twitter_skill(
72
70
  name: str,
73
- store: SkillStoreABC,
74
71
  ) -> TwitterBaseTool:
75
72
  """Get a Twitter skill by name.
76
73
 
77
74
  Args:
78
75
  name: The name of the skill to get
79
- store: The skill store for persisting data
80
76
 
81
77
  Returns:
82
78
  The requested Twitter skill
83
79
  """
84
80
  if name == "get_mentions":
85
81
  if name not in _cache:
86
- _cache[name] = TwitterGetMentions(
87
- skill_store=store,
88
- )
82
+ _cache[name] = TwitterGetMentions()
89
83
  return _cache[name]
90
84
  elif name == "post_tweet":
91
85
  if name not in _cache:
92
- _cache[name] = TwitterPostTweet(
93
- skill_store=store,
94
- )
86
+ _cache[name] = TwitterPostTweet()
95
87
  return _cache[name]
96
88
  elif name == "reply_tweet":
97
89
  if name not in _cache:
98
- _cache[name] = TwitterReplyTweet(
99
- skill_store=store,
100
- )
90
+ _cache[name] = TwitterReplyTweet()
101
91
  return _cache[name]
102
92
  elif name == "get_timeline":
103
93
  if name not in _cache:
104
- _cache[name] = TwitterGetTimeline(
105
- skill_store=store,
106
- )
94
+ _cache[name] = TwitterGetTimeline()
107
95
  return _cache[name]
108
96
  elif name == "follow_user":
109
97
  if name not in _cache:
110
- _cache[name] = TwitterFollowUser(
111
- skill_store=store,
112
- )
98
+ _cache[name] = TwitterFollowUser()
113
99
  return _cache[name]
114
100
  elif name == "like_tweet":
115
101
  if name not in _cache:
116
- _cache[name] = TwitterLikeTweet(
117
- skill_store=store,
118
- )
102
+ _cache[name] = TwitterLikeTweet()
119
103
  return _cache[name]
120
104
  elif name == "retweet":
121
105
  if name not in _cache:
122
- _cache[name] = TwitterRetweet(
123
- skill_store=store,
124
- )
106
+ _cache[name] = TwitterRetweet()
125
107
  return _cache[name]
126
108
  elif name == "search_tweets":
127
109
  if name not in _cache:
128
- _cache[name] = TwitterSearchTweets(
129
- skill_store=store,
130
- )
110
+ _cache[name] = TwitterSearchTweets()
131
111
  return _cache[name]
132
112
  elif name == "get_user_by_username":
133
113
  if name not in _cache:
134
- _cache[name] = TwitterGetUserByUsername(
135
- skill_store=store,
136
- )
114
+ _cache[name] = TwitterGetUserByUsername()
137
115
  return _cache[name]
138
116
  elif name == "get_user_tweets":
139
117
  if name not in _cache:
140
- _cache[name] = TwitterGetUserTweets(
141
- skill_store=store,
142
- )
118
+ _cache[name] = TwitterGetUserTweets()
143
119
  return _cache[name]
144
120
  else:
145
121
  logger.warning(f"Unknown Twitter skill: {name}")
@@ -4,7 +4,7 @@ from typing import Type
4
4
  from langchain_core.tools.base import ToolException
5
5
  from pydantic import BaseModel, Field
6
6
 
7
- from intentkit.abstracts.skill import SkillStoreABC
7
+ from intentkit.config.config import config
8
8
  from intentkit.skills.base import IntentKitSkill
9
9
  from intentkit.utils.error import RateLimitExceeded
10
10
 
@@ -15,9 +15,6 @@ class TwitterBaseTool(IntentKitSkill):
15
15
  name: str = Field(description="The name of the tool")
16
16
  description: str = Field(description="A description of what the tool does")
17
17
  args_schema: Type[BaseModel]
18
- skill_store: SkillStoreABC = Field(
19
- description="The skill store for persisting data"
20
- )
21
18
 
22
19
  def get_api_key(self) -> dict:
23
20
  context = self.get_context()
@@ -25,20 +22,21 @@ class TwitterBaseTool(IntentKitSkill):
25
22
  api_key_provider = skill_config.get("api_key_provider")
26
23
  if api_key_provider == "platform":
27
24
  # Return platform keys (these need to be added to config.py)
28
- return {
29
- "consumer_key": self.skill_store.get_system_config(
30
- "twitter_consumer_key"
31
- ),
32
- "consumer_secret": self.skill_store.get_system_config(
33
- "twitter_consumer_secret"
34
- ),
35
- "access_token": self.skill_store.get_system_config(
36
- "twitter_access_token"
37
- ),
38
- "access_token_secret": self.skill_store.get_system_config(
39
- "twitter_access_token_secret"
25
+ platform_keys = {
26
+ "consumer_key": getattr(config, "twitter_consumer_key", None),
27
+ "consumer_secret": getattr(config, "twitter_consumer_secret", None),
28
+ "access_token": getattr(config, "twitter_access_token", None),
29
+ "access_token_secret": getattr(
30
+ config, "twitter_access_token_secret", None
40
31
  ),
41
32
  }
33
+ missing = [key for key, value in platform_keys.items() if not value]
34
+ if missing:
35
+ raise ToolException(
36
+ "Twitter platform API keys are not configured: "
37
+ + ", ".join(missing)
38
+ )
39
+ return platform_keys
42
40
  # for backward compatibility or agent_owner provider
43
41
  elif api_key_provider == "agent_owner":
44
42
  required_keys = [
@@ -42,7 +42,6 @@ class TwitterFollowUser(TwitterBaseTool):
42
42
  skill_config = context.agent.skill_config(self.category)
43
43
  twitter = get_twitter_client(
44
44
  agent_id=context.agent_id,
45
- skill_store=self.skill_store,
46
45
  config=skill_config,
47
46
  )
48
47
  client = await twitter.get_client()
@@ -46,7 +46,6 @@ class TwitterGetMentions(TwitterBaseTool):
46
46
  skill_config = context.agent.skill_config(self.category)
47
47
  twitter = get_twitter_client(
48
48
  agent_id=context.agent_id,
49
- skill_store=self.skill_store,
50
49
  config=skill_config,
51
50
  )
52
51
  client = await twitter.get_client()
@@ -45,7 +45,6 @@ class TwitterGetTimeline(TwitterBaseTool):
45
45
  skill_config = context.agent.skill_config(self.category)
46
46
  twitter = get_twitter_client(
47
47
  agent_id=context.agent_id,
48
- skill_store=self.skill_store,
49
48
  config=skill_config,
50
49
  )
51
50
  client = await twitter.get_client()
@@ -43,7 +43,6 @@ class TwitterGetUserByUsername(TwitterBaseTool):
43
43
  skill_config = context.agent.skill_config(self.category)
44
44
  twitter = get_twitter_client(
45
45
  agent_id=context.agent_id,
46
- skill_store=self.skill_store,
47
46
  config=skill_config,
48
47
  )
49
48
  client = await twitter.get_client()
@@ -59,7 +59,6 @@ class TwitterGetUserTweets(TwitterBaseTool):
59
59
  skill_config = context.agent.skill_config(self.category)
60
60
  twitter = get_twitter_client(
61
61
  agent_id=context.agent_id,
62
- skill_store=self.skill_store,
63
62
  config=skill_config,
64
63
  )
65
64
  client = await twitter.get_client()
@@ -40,7 +40,6 @@ class TwitterLikeTweet(TwitterBaseTool):
40
40
  skill_config = context.agent.skill_config(self.category)
41
41
  twitter = get_twitter_client(
42
42
  agent_id=context.agent_id,
43
- skill_store=self.skill_store,
44
43
  config=skill_config,
45
44
  )
46
45
  client = await twitter.get_client()
@@ -5,6 +5,7 @@ from langchain_core.tools import ToolException
5
5
  from pydantic import BaseModel, Field
6
6
 
7
7
  from intentkit.clients import get_twitter_client
8
+ from intentkit.config.config import config
8
9
  from intentkit.skills.twitter.base import TwitterBaseTool
9
10
 
10
11
  NAME = "twitter_post_tweet"
@@ -54,7 +55,6 @@ class TwitterPostTweet(TwitterBaseTool):
54
55
  skill_config = context.agent.skill_config(self.category)
55
56
  twitter = get_twitter_client(
56
57
  agent_id=context.agent_id,
57
- skill_store=self.skill_store,
58
58
  config=skill_config,
59
59
  )
60
60
  client = await twitter.get_client()
@@ -69,7 +69,7 @@ class TwitterPostTweet(TwitterBaseTool):
69
69
  # Handle image upload if provided
70
70
  if image:
71
71
  # Validate image URL - must be from system's S3 CDN
72
- aws_s3_cdn_url = self.skill_store.get_system_config("aws_s3_cdn_url")
72
+ aws_s3_cdn_url = config.aws_s3_cdn_url
73
73
  if aws_s3_cdn_url and image.startswith(aws_s3_cdn_url):
74
74
  # Use the TwitterClient method to upload the image
75
75
  media_ids = await twitter.upload_media(context.agent_id, image)
@@ -5,6 +5,7 @@ from langchain_core.tools import ToolException
5
5
  from pydantic import BaseModel, Field
6
6
 
7
7
  from intentkit.clients import get_twitter_client
8
+ from intentkit.config.config import config
8
9
  from intentkit.skills.twitter.base import TwitterBaseTool
9
10
 
10
11
  NAME = "twitter_reply_tweet"
@@ -56,7 +57,6 @@ class TwitterReplyTweet(TwitterBaseTool):
56
57
  skill_config = context.agent.skill_config(self.category)
57
58
  twitter = get_twitter_client(
58
59
  agent_id=context.agent_id,
59
- skill_store=self.skill_store,
60
60
  config=skill_config,
61
61
  )
62
62
  client = await twitter.get_client()
@@ -71,7 +71,7 @@ class TwitterReplyTweet(TwitterBaseTool):
71
71
  # Handle image upload if provided
72
72
  if image:
73
73
  # Validate image URL - must be from system's S3 CDN
74
- aws_s3_cdn_url = self.skill_store.get_system_config("aws_s3_cdn_url")
74
+ aws_s3_cdn_url = config.aws_s3_cdn_url
75
75
  if aws_s3_cdn_url and image.startswith(aws_s3_cdn_url):
76
76
  # Use the TwitterClient method to upload the image
77
77
  media_ids = await twitter.upload_media(context.agent_id, image)
@@ -40,7 +40,6 @@ class TwitterRetweet(TwitterBaseTool):
40
40
  skill_config = context.agent.skill_config(self.category)
41
41
  twitter = get_twitter_client(
42
42
  agent_id=context.agent_id,
43
- skill_store=self.skill_store,
44
43
  config=skill_config,
45
44
  )
46
45
  client = await twitter.get_client()
@@ -42,7 +42,6 @@ class TwitterSearchTweets(TwitterBaseTool):
42
42
  skill_config = context.agent.skill_config(self.category)
43
43
  twitter = get_twitter_client(
44
44
  agent_id=context.agent_id,
45
- skill_store=self.skill_store,
46
45
  config=skill_config,
47
46
  )
48
47
  client = await twitter.get_client()
@@ -1,6 +1,5 @@
1
1
  from typing import TypedDict
2
2
 
3
- from intentkit.abstracts.skill import SkillStoreABC
4
3
  from intentkit.skills.base import SkillConfig, SkillState
5
4
  from intentkit.skills.unrealspeech.base import UnrealSpeechBaseTool
6
5
  from intentkit.skills.unrealspeech.text_to_speech import TextToSpeech
@@ -23,7 +22,6 @@ class Config(SkillConfig):
23
22
  async def get_skills(
24
23
  config: "Config",
25
24
  is_private: bool,
26
- store: SkillStoreABC,
27
25
  **_,
28
26
  ) -> list[UnrealSpeechBaseTool]:
29
27
  """Get all UnrealSpeech tools."""
@@ -37,19 +35,16 @@ async def get_skills(
37
35
  available_skills.append(skill_name)
38
36
 
39
37
  # Get each skill using the cached getter
40
- return [get_unrealspeech_skill(name, store) for name in available_skills]
38
+ return [get_unrealspeech_skill(name) for name in available_skills]
41
39
 
42
40
 
43
41
  def get_unrealspeech_skill(
44
42
  name: str,
45
- store: SkillStoreABC,
46
43
  ) -> UnrealSpeechBaseTool:
47
44
  """Get an UnrealSpeech skill by name."""
48
45
  if name == "text_to_speech":
49
46
  if name not in _cache:
50
- _cache[name] = TextToSpeech(
51
- skill_store=store,
52
- )
47
+ _cache[name] = TextToSpeech()
53
48
  return _cache[name]
54
49
  else:
55
50
  raise ValueError(f"Unknown UnrealSpeech skill: {name}")
@@ -3,7 +3,6 @@ from typing import Type
3
3
  from langchain_core.tools.base import ToolException
4
4
  from pydantic import BaseModel, Field
5
5
 
6
- from intentkit.abstracts.skill import SkillStoreABC
7
6
  from intentkit.skills.base import IntentKitSkill
8
7
 
9
8
 
@@ -13,9 +12,6 @@ class UnrealSpeechBaseTool(IntentKitSkill):
13
12
  name: str = Field(description="The name of the tool")
14
13
  description: str = Field(description="A description of what the tool does")
15
14
  args_schema: Type[BaseModel]
16
- skill_store: SkillStoreABC = Field(
17
- description="The skill store for persisting data"
18
- )
19
15
 
20
16
  def get_api_key(self) -> str:
21
17
  context = self.get_context()
@@ -1,106 +1,99 @@
1
- import logging
2
- from typing import List, Literal, Optional, TypedDict
3
-
4
- from intentkit.abstracts.skill import SkillStoreABC
5
- from intentkit.skills.base import SkillConfig, SkillState
6
- from intentkit.skills.venice_audio.base import VeniceAudioBaseTool
7
- from intentkit.skills.venice_audio.venice_audio import VeniceAudioTool
8
-
9
- logger = logging.getLogger(__name__)
10
-
11
-
12
- _cache: dict[str, VeniceAudioBaseTool] = {}
13
-
14
- _SKILL_NAME_TO_CLASS_MAP = {
15
- "text_to_speech": VeniceAudioTool,
16
- # Add new mappings here: "skill_name": SkillClassName
17
- }
18
-
19
-
20
- class SkillStates(TypedDict):
21
- text_to_speech: SkillState
22
-
23
-
24
- class Config(SkillConfig):
25
- enabled: bool
26
- voice_model: Literal["af_heart", "bm_lewis", "custom"]
27
- states: SkillStates # type: ignore
28
- api_key_provider: Optional[Literal["agent_owner"]]
29
-
30
- # conditionally required
31
- api_key: Optional[str]
32
- voice_model_custom: Optional[list[str]]
33
-
34
- # optional
35
- rate_limit_number: Optional[int]
36
- rate_limit_minutes: Optional[int]
37
-
38
-
39
- async def get_skills(
40
- config: "Config",
41
- is_private: bool,
42
- store: SkillStoreABC,
43
- **_, # Allow for extra arguments if the loader passes them
44
- ) -> list[VeniceAudioBaseTool]:
45
- """
46
- Factory function to create and return Venice Audio skill tools.
47
-
48
- Args:
49
- config: The configuration dictionary for the Venice Audio skill.
50
- skill_store: The skill store instance.
51
- agent_id: The ID of the agent requesting the skills.
52
-
53
- Returns:
54
- A list of VeniceAudioBaseTool instances for the Venice Audio skill.
55
- """
56
- # Check if the entire category is disabled first
57
- if not config.get("enabled", False):
58
- return []
59
-
60
- available_skills: List[VeniceAudioBaseTool] = []
61
- skill_states = config.get("states", {})
62
-
63
- # Iterate through all known skills defined in the map
64
- for skill_name in _SKILL_NAME_TO_CLASS_MAP:
65
- state = skill_states.get(
66
- skill_name, "disabled"
67
- ) # Default to disabled if not in config
68
-
69
- if state == "disabled":
70
- continue
71
- elif state == "public" or (state == "private" and is_private):
72
- # If enabled, get the skill instance using the factory function
73
- skill_instance = get_venice_audio_skill(skill_name, store)
74
- if skill_instance:
75
- available_skills.append(skill_instance)
76
- else:
77
- # This case should ideally not happen if the map is correct
78
- logger.warning(f"Could not instantiate known skill: {skill_name}")
79
-
80
- return available_skills
81
-
82
-
83
- def get_venice_audio_skill(
84
- name: str,
85
- store: SkillStoreABC,
86
- ) -> Optional[VeniceAudioBaseTool]:
87
- """
88
- Factory function to get a cached Venice Audio skill instance by name.
89
-
90
- Args:
91
- name: The name of voice model.
92
- store: The skill store, passed to the skill constructor.
93
-
94
- Returns:
95
- The requested Venice Audio skill instance, or None if the name is unknown.
96
- """
97
-
98
- # Return from cache immediately if already exists
99
- if name in _cache:
100
- return _cache[name]
101
-
102
- # Cache and return the newly created instance
103
- _cache[name] = VeniceAudioTool(
104
- skill_store=store,
105
- )
106
- return _cache[name]
1
+ import logging
2
+ from typing import List, Literal, Optional, TypedDict
3
+
4
+ from intentkit.skills.base import SkillConfig, SkillState
5
+ from intentkit.skills.venice_audio.base import VeniceAudioBaseTool
6
+ from intentkit.skills.venice_audio.venice_audio import VeniceAudioTool
7
+
8
+ logger = logging.getLogger(__name__)
9
+
10
+
11
+ _cache: dict[str, VeniceAudioBaseTool] = {}
12
+
13
+ _SKILL_NAME_TO_CLASS_MAP = {
14
+ "text_to_speech": VeniceAudioTool,
15
+ # Add new mappings here: "skill_name": SkillClassName
16
+ }
17
+
18
+
19
+ class SkillStates(TypedDict):
20
+ text_to_speech: SkillState
21
+
22
+
23
+ class Config(SkillConfig):
24
+ enabled: bool
25
+ voice_model: Literal["af_heart", "bm_lewis", "custom"]
26
+ states: SkillStates # type: ignore
27
+ api_key_provider: Optional[Literal["agent_owner"]]
28
+
29
+ # conditionally required
30
+ api_key: Optional[str]
31
+ voice_model_custom: Optional[list[str]]
32
+
33
+ # optional
34
+ rate_limit_number: Optional[int]
35
+ rate_limit_minutes: Optional[int]
36
+
37
+
38
+ async def get_skills(
39
+ config: "Config",
40
+ is_private: bool,
41
+ **_, # Allow for extra arguments if the loader passes them
42
+ ) -> list[VeniceAudioBaseTool]:
43
+ """
44
+ Factory function to create and return Venice Audio skill tools.
45
+
46
+ Args:
47
+ config: The configuration dictionary for the Venice Audio skill.
48
+ agent_id: The ID of the agent requesting the skills.
49
+
50
+ Returns:
51
+ A list of VeniceAudioBaseTool instances for the Venice Audio skill.
52
+ """
53
+ # Check if the entire category is disabled first
54
+ if not config.get("enabled", False):
55
+ return []
56
+
57
+ available_skills: List[VeniceAudioBaseTool] = []
58
+ skill_states = config.get("states", {})
59
+
60
+ # Iterate through all known skills defined in the map
61
+ for skill_name in _SKILL_NAME_TO_CLASS_MAP:
62
+ state = skill_states.get(
63
+ skill_name, "disabled"
64
+ ) # Default to disabled if not in config
65
+
66
+ if state == "disabled":
67
+ continue
68
+ elif state == "public" or (state == "private" and is_private):
69
+ # If enabled, get the skill instance using the factory function
70
+ skill_instance = get_venice_audio_skill(skill_name)
71
+ if skill_instance:
72
+ available_skills.append(skill_instance)
73
+ else:
74
+ # This case should ideally not happen if the map is correct
75
+ logger.warning(f"Could not instantiate known skill: {skill_name}")
76
+
77
+ return available_skills
78
+
79
+
80
+ def get_venice_audio_skill(
81
+ name: str,
82
+ ) -> Optional[VeniceAudioBaseTool]:
83
+ """
84
+ Factory function to get a cached Venice Audio skill instance by name.
85
+
86
+ Args:
87
+ name: The name of voice model.
88
+
89
+ Returns:
90
+ The requested Venice Audio skill instance, or None if the name is unknown.
91
+ """
92
+
93
+ # Return from cache immediately if already exists
94
+ if name in _cache:
95
+ return _cache[name]
96
+
97
+ # Cache and return the newly created instance
98
+ _cache[name] = VeniceAudioTool()
99
+ return _cache[name]