intentkit 0.8.12rc0__py3-none-any.whl → 0.8.13.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.
- intentkit/__init__.py +1 -1
- intentkit/abstracts/skill.py +2 -59
- intentkit/clients/twitter.py +35 -28
- intentkit/config/config.py +1 -0
- intentkit/core/agent.py +2 -279
- intentkit/core/asset.py +63 -16
- intentkit/core/engine.py +9 -5
- intentkit/core/scheduler.py +8 -8
- intentkit/models/agent.py +138 -94
- intentkit/models/agent_schema.json +6 -9
- intentkit/models/chat.py +1 -0
- intentkit/models/llm.csv +15 -12
- intentkit/skills/acolyt/__init__.py +2 -9
- intentkit/skills/acolyt/base.py +2 -5
- intentkit/skills/aixbt/__init__.py +2 -13
- intentkit/skills/aixbt/base.py +0 -4
- intentkit/skills/aixbt/projects.py +1 -2
- intentkit/skills/allora/__init__.py +2 -9
- intentkit/skills/allora/base.py +2 -5
- intentkit/skills/base.py +101 -27
- intentkit/skills/basename/__init__.py +1 -3
- intentkit/skills/carv/__init__.py +116 -121
- intentkit/skills/carv/base.py +184 -185
- intentkit/skills/casino/__init__.py +4 -15
- intentkit/skills/casino/base.py +0 -4
- intentkit/skills/casino/deck_draw.py +1 -2
- intentkit/skills/casino/deck_shuffle.py +1 -2
- intentkit/skills/casino/dice_roll.py +1 -2
- intentkit/skills/cdp/__init__.py +0 -5
- intentkit/skills/cdp/base.py +0 -4
- intentkit/skills/cdp/schema.json +1 -17
- intentkit/skills/chainlist/__init__.py +2 -7
- intentkit/skills/chainlist/base.py +0 -4
- intentkit/skills/common/__init__.py +2 -9
- intentkit/skills/common/base.py +0 -4
- intentkit/skills/cookiefun/__init__.py +6 -9
- intentkit/skills/cookiefun/base.py +0 -4
- intentkit/skills/cryptocompare/__init__.py +7 -24
- intentkit/skills/cryptocompare/base.py +0 -5
- intentkit/skills/cryptopanic/__init__.py +3 -6
- intentkit/skills/cryptopanic/base.py +53 -55
- intentkit/skills/cryptopanic/fetch_crypto_news.py +0 -2
- intentkit/skills/cryptopanic/fetch_crypto_sentiment.py +1 -3
- intentkit/skills/dapplooker/__init__.py +2 -9
- intentkit/skills/dapplooker/base.py +2 -5
- intentkit/skills/defillama/__init__.py +24 -74
- intentkit/skills/defillama/base.py +0 -4
- intentkit/skills/defillama/coins/fetch_batch_historical_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_block.py +2 -2
- intentkit/skills/defillama/coins/fetch_current_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_first_price.py +2 -2
- intentkit/skills/defillama/coins/fetch_historical_prices.py +2 -2
- intentkit/skills/defillama/coins/fetch_price_chart.py +2 -2
- intentkit/skills/defillama/coins/fetch_price_percentage.py +2 -2
- intentkit/skills/defillama/fees/fetch_fees_overview.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_chains.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_charts.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoin_prices.py +2 -2
- intentkit/skills/defillama/stablecoins/fetch_stablecoins.py +2 -2
- intentkit/skills/defillama/tvl/fetch_chain_historical_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_chains.py +2 -2
- intentkit/skills/defillama/tvl/fetch_historical_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocol.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocol_current_tvl.py +2 -2
- intentkit/skills/defillama/tvl/fetch_protocols.py +2 -2
- intentkit/skills/defillama/volumes/fetch_dex_overview.py +2 -2
- intentkit/skills/defillama/volumes/fetch_dex_summary.py +2 -2
- intentkit/skills/defillama/volumes/fetch_options_overview.py +2 -2
- intentkit/skills/defillama/yields/fetch_pool_chart.py +2 -2
- intentkit/skills/defillama/yields/fetch_pools.py +2 -2
- intentkit/skills/dexscreener/__init__.py +97 -102
- intentkit/skills/dexscreener/base.py +125 -130
- intentkit/skills/dexscreener/get_pair_info.py +2 -3
- intentkit/skills/dexscreener/get_token_pairs.py +2 -3
- intentkit/skills/dexscreener/get_tokens_info.py +2 -3
- intentkit/skills/dexscreener/search_token.py +2 -4
- intentkit/skills/dune_analytics/__init__.py +4 -6
- intentkit/skills/dune_analytics/base.py +50 -52
- intentkit/skills/dune_analytics/fetch_kol_buys.py +0 -2
- intentkit/skills/dune_analytics/fetch_nation_metrics.py +0 -2
- intentkit/skills/elfa/__init__.py +5 -18
- intentkit/skills/elfa/base.py +8 -10
- intentkit/skills/enso/__init__.py +9 -29
- intentkit/skills/enso/base.py +3 -6
- intentkit/skills/enso/route.py +1 -3
- intentkit/skills/erc20/__init__.py +1 -5
- intentkit/skills/erc721/__init__.py +1 -3
- intentkit/skills/firecrawl/__init__.py +5 -18
- intentkit/skills/firecrawl/base.py +2 -5
- intentkit/skills/firecrawl/crawl.py +10 -9
- intentkit/skills/firecrawl/query.py +3 -1
- intentkit/skills/firecrawl/scrape.py +8 -10
- intentkit/skills/firecrawl/utils.py +25 -26
- intentkit/skills/github/__init__.py +2 -7
- intentkit/skills/github/base.py +0 -4
- intentkit/skills/heurist/__init__.py +8 -27
- intentkit/skills/heurist/base.py +2 -5
- intentkit/skills/heurist/image_generation_animagine_xl.py +5 -5
- intentkit/skills/heurist/image_generation_arthemy_comics.py +5 -5
- intentkit/skills/heurist/image_generation_arthemy_real.py +5 -5
- intentkit/skills/heurist/image_generation_braindance.py +5 -5
- intentkit/skills/heurist/image_generation_cyber_realistic_xl.py +5 -5
- intentkit/skills/heurist/image_generation_flux_1_dev.py +5 -5
- intentkit/skills/heurist/image_generation_sdxl.py +5 -5
- intentkit/skills/http/__init__.py +4 -15
- intentkit/skills/http/base.py +0 -4
- intentkit/skills/lifi/__init__.py +1 -6
- intentkit/skills/lifi/base.py +0 -4
- intentkit/skills/lifi/token_execute.py +1 -4
- intentkit/skills/lifi/token_quote.py +1 -3
- intentkit/skills/moralis/__init__.py +3 -7
- intentkit/skills/moralis/base.py +2 -5
- intentkit/skills/morpho/__init__.py +1 -3
- intentkit/skills/nation/__init__.py +2 -7
- intentkit/skills/nation/base.py +4 -7
- intentkit/skills/openai/__init__.py +5 -18
- intentkit/skills/openai/base.py +8 -10
- intentkit/skills/openai/dalle_image_generation.py +2 -5
- intentkit/skills/openai/gpt_image_generation.py +2 -5
- intentkit/skills/openai/gpt_image_to_image.py +2 -5
- intentkit/skills/openai/image_to_text.py +2 -5
- intentkit/skills/portfolio/__init__.py +11 -35
- intentkit/skills/portfolio/base.py +2 -5
- intentkit/skills/pyth/__init__.py +1 -5
- intentkit/skills/slack/__init__.py +5 -17
- intentkit/skills/slack/base.py +0 -4
- intentkit/skills/supabase/__init__.py +7 -23
- intentkit/skills/supabase/base.py +0 -4
- intentkit/skills/superfluid/__init__.py +1 -3
- intentkit/skills/system/__init__.py +7 -24
- intentkit/skills/system/add_autonomous_task.py +2 -2
- intentkit/skills/system/delete_autonomous_task.py +2 -2
- intentkit/skills/system/edit_autonomous_task.py +2 -4
- intentkit/skills/system/list_autonomous_tasks.py +2 -2
- intentkit/skills/system/read_agent_api_key.py +6 -4
- intentkit/skills/system/regenerate_agent_api_key.py +6 -4
- intentkit/skills/tavily/__init__.py +3 -12
- intentkit/skills/tavily/base.py +2 -5
- intentkit/skills/tavily/tavily_extract.py +1 -2
- intentkit/skills/tavily/tavily_search.py +3 -3
- intentkit/skills/token/__init__.py +5 -10
- intentkit/skills/token/base.py +2 -6
- intentkit/skills/twitter/__init__.py +11 -35
- intentkit/skills/twitter/base.py +14 -16
- intentkit/skills/twitter/follow_user.py +0 -1
- intentkit/skills/twitter/get_mentions.py +0 -1
- intentkit/skills/twitter/get_timeline.py +0 -1
- intentkit/skills/twitter/get_user_by_username.py +0 -1
- intentkit/skills/twitter/get_user_tweets.py +0 -1
- intentkit/skills/twitter/like_tweet.py +0 -1
- intentkit/skills/twitter/post_tweet.py +2 -2
- intentkit/skills/twitter/reply_tweet.py +2 -2
- intentkit/skills/twitter/retweet.py +0 -1
- intentkit/skills/twitter/search_tweets.py +0 -1
- intentkit/skills/unrealspeech/__init__.py +2 -7
- intentkit/skills/unrealspeech/base.py +0 -4
- intentkit/skills/venice_audio/__init__.py +99 -106
- intentkit/skills/venice_audio/base.py +118 -121
- intentkit/skills/venice_audio/venice_audio.py +1 -5
- intentkit/skills/venice_image/__init__.py +147 -154
- intentkit/skills/venice_image/base.py +185 -192
- intentkit/skills/web_scraper/__init__.py +5 -18
- intentkit/skills/web_scraper/base.py +20 -4
- intentkit/skills/web_scraper/document_indexer.py +6 -4
- intentkit/skills/web_scraper/scrape_and_index.py +11 -8
- intentkit/skills/web_scraper/utils.py +31 -27
- intentkit/skills/web_scraper/website_indexer.py +7 -8
- intentkit/skills/weth/__init__.py +1 -5
- intentkit/skills/wow/__init__.py +1 -5
- intentkit/skills/xmtp/__init__.py +4 -15
- intentkit/utils/schema.py +100 -0
- {intentkit-0.8.12rc0.dist-info → intentkit-0.8.13.dev1.dist-info}/METADATA +1 -1
- {intentkit-0.8.12rc0.dist-info → intentkit-0.8.13.dev1.dist-info}/RECORD +175 -174
- {intentkit-0.8.12rc0.dist-info → intentkit-0.8.13.dev1.dist-info}/WHEEL +0 -0
- {intentkit-0.8.12rc0.dist-info → intentkit-0.8.13.dev1.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.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.slack.base import SlackBaseTool
|
|
9
8
|
from intentkit.skills.slack.get_channel import SlackGetChannel
|
|
@@ -34,7 +33,6 @@ class Config(SkillConfig):
|
|
|
34
33
|
async def get_skills(
|
|
35
34
|
config: "Config",
|
|
36
35
|
is_private: bool,
|
|
37
|
-
store: SkillStoreABC,
|
|
38
36
|
**_,
|
|
39
37
|
) -> list[SlackBaseTool]:
|
|
40
38
|
"""Get all Slack skills."""
|
|
@@ -50,7 +48,7 @@ async def get_skills(
|
|
|
50
48
|
# Get each skill using the cached getter
|
|
51
49
|
result = []
|
|
52
50
|
for name in available_skills:
|
|
53
|
-
skill = get_slack_skill(name
|
|
51
|
+
skill = get_slack_skill(name)
|
|
54
52
|
if skill:
|
|
55
53
|
result.append(skill)
|
|
56
54
|
return result
|
|
@@ -58,40 +56,30 @@ async def get_skills(
|
|
|
58
56
|
|
|
59
57
|
def get_slack_skill(
|
|
60
58
|
name: str,
|
|
61
|
-
store: SkillStoreABC,
|
|
62
59
|
) -> SlackBaseTool:
|
|
63
60
|
"""Get a Slack skill by name.
|
|
64
61
|
|
|
65
62
|
Args:
|
|
66
63
|
name: The name of the skill to get
|
|
67
|
-
store: The skill store for persisting data
|
|
68
64
|
|
|
69
65
|
Returns:
|
|
70
66
|
The requested Slack skill
|
|
71
67
|
"""
|
|
72
68
|
if name == "get_channel":
|
|
73
69
|
if name not in _cache:
|
|
74
|
-
_cache[name] = SlackGetChannel(
|
|
75
|
-
skill_store=store,
|
|
76
|
-
)
|
|
70
|
+
_cache[name] = SlackGetChannel()
|
|
77
71
|
return _cache[name]
|
|
78
72
|
elif name == "get_message":
|
|
79
73
|
if name not in _cache:
|
|
80
|
-
_cache[name] = SlackGetMessage(
|
|
81
|
-
skill_store=store,
|
|
82
|
-
)
|
|
74
|
+
_cache[name] = SlackGetMessage()
|
|
83
75
|
return _cache[name]
|
|
84
76
|
elif name == "schedule_message":
|
|
85
77
|
if name not in _cache:
|
|
86
|
-
_cache[name] = SlackScheduleMessage(
|
|
87
|
-
skill_store=store,
|
|
88
|
-
)
|
|
78
|
+
_cache[name] = SlackScheduleMessage()
|
|
89
79
|
return _cache[name]
|
|
90
80
|
elif name == "send_message":
|
|
91
81
|
if name not in _cache:
|
|
92
|
-
_cache[name] = SlackSendMessage(
|
|
93
|
-
skill_store=store,
|
|
94
|
-
)
|
|
82
|
+
_cache[name] = SlackSendMessage()
|
|
95
83
|
return _cache[name]
|
|
96
84
|
else:
|
|
97
85
|
logger.warning(f"Unknown Slack skill: {name}")
|
intentkit/skills/slack/base.py
CHANGED
|
@@ -4,7 +4,6 @@ from langchain_core.tools.base import ToolException
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
from slack_sdk import WebClient
|
|
6
6
|
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.base import IntentKitSkill
|
|
9
8
|
|
|
10
9
|
|
|
@@ -14,9 +13,6 @@ class SlackBaseTool(IntentKitSkill):
|
|
|
14
13
|
name: str = Field(description="The name of the tool")
|
|
15
14
|
description: str = Field(description="A description of what the tool does")
|
|
16
15
|
args_schema: Type[BaseModel]
|
|
17
|
-
skill_store: SkillStoreABC = Field(
|
|
18
|
-
description="The skill store for persisting data"
|
|
19
|
-
)
|
|
20
16
|
|
|
21
17
|
def get_api_key(self) -> str:
|
|
22
18
|
context = self.get_context()
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from typing import NotRequired, TypedDict
|
|
5
5
|
|
|
6
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
7
6
|
from intentkit.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.supabase.base import SupabaseBaseTool
|
|
9
8
|
from intentkit.skills.supabase.delete_data import SupabaseDeleteData
|
|
@@ -41,7 +40,6 @@ class Config(SkillConfig):
|
|
|
41
40
|
async def get_skills(
|
|
42
41
|
config: "Config",
|
|
43
42
|
is_private: bool,
|
|
44
|
-
store: SkillStoreABC,
|
|
45
43
|
**_,
|
|
46
44
|
) -> list[SupabaseBaseTool]:
|
|
47
45
|
"""Get all Supabase skills."""
|
|
@@ -57,7 +55,7 @@ async def get_skills(
|
|
|
57
55
|
# Get each skill using the cached getter
|
|
58
56
|
result = []
|
|
59
57
|
for name in available_skills:
|
|
60
|
-
skill = get_supabase_skill(name
|
|
58
|
+
skill = get_supabase_skill(name)
|
|
61
59
|
if skill:
|
|
62
60
|
result.append(skill)
|
|
63
61
|
return result
|
|
@@ -65,52 +63,38 @@ async def get_skills(
|
|
|
65
63
|
|
|
66
64
|
def get_supabase_skill(
|
|
67
65
|
name: str,
|
|
68
|
-
store: SkillStoreABC,
|
|
69
66
|
) -> SupabaseBaseTool:
|
|
70
67
|
"""Get a Supabase skill by name.
|
|
71
68
|
|
|
72
69
|
Args:
|
|
73
70
|
name: The name of the skill to get
|
|
74
|
-
store: The skill store for persisting data
|
|
75
71
|
|
|
76
72
|
Returns:
|
|
77
73
|
The requested Supabase skill
|
|
78
74
|
"""
|
|
79
75
|
if name == "fetch_data":
|
|
80
76
|
if name not in _cache:
|
|
81
|
-
_cache[name] = SupabaseFetchData(
|
|
82
|
-
skill_store=store,
|
|
83
|
-
)
|
|
77
|
+
_cache[name] = SupabaseFetchData()
|
|
84
78
|
return _cache[name]
|
|
85
79
|
elif name == "insert_data":
|
|
86
80
|
if name not in _cache:
|
|
87
|
-
_cache[name] = SupabaseInsertData(
|
|
88
|
-
skill_store=store,
|
|
89
|
-
)
|
|
81
|
+
_cache[name] = SupabaseInsertData()
|
|
90
82
|
return _cache[name]
|
|
91
83
|
elif name == "update_data":
|
|
92
84
|
if name not in _cache:
|
|
93
|
-
_cache[name] = SupabaseUpdateData(
|
|
94
|
-
skill_store=store,
|
|
95
|
-
)
|
|
85
|
+
_cache[name] = SupabaseUpdateData()
|
|
96
86
|
return _cache[name]
|
|
97
87
|
elif name == "upsert_data":
|
|
98
88
|
if name not in _cache:
|
|
99
|
-
_cache[name] = SupabaseUpsertData(
|
|
100
|
-
skill_store=store,
|
|
101
|
-
)
|
|
89
|
+
_cache[name] = SupabaseUpsertData()
|
|
102
90
|
return _cache[name]
|
|
103
91
|
elif name == "delete_data":
|
|
104
92
|
if name not in _cache:
|
|
105
|
-
_cache[name] = SupabaseDeleteData(
|
|
106
|
-
skill_store=store,
|
|
107
|
-
)
|
|
93
|
+
_cache[name] = SupabaseDeleteData()
|
|
108
94
|
return _cache[name]
|
|
109
95
|
elif name == "invoke_function":
|
|
110
96
|
if name not in _cache:
|
|
111
|
-
_cache[name] = SupabaseInvokeFunction(
|
|
112
|
-
skill_store=store,
|
|
113
|
-
)
|
|
97
|
+
_cache[name] = SupabaseInvokeFunction()
|
|
114
98
|
return _cache[name]
|
|
115
99
|
else:
|
|
116
100
|
logger.warning(f"Unknown Supabase skill: {name}")
|
|
@@ -4,7 +4,6 @@ from langchain_core.tools import ToolException
|
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
5
|
|
|
6
6
|
from intentkit.abstracts.graph import AgentContext
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.base import IntentKitSkill
|
|
9
8
|
|
|
10
9
|
|
|
@@ -14,9 +13,6 @@ class SupabaseBaseTool(IntentKitSkill):
|
|
|
14
13
|
name: str = Field(description="The name of the tool")
|
|
15
14
|
description: str = Field(description="A description of what the tool does")
|
|
16
15
|
args_schema: Type[BaseModel]
|
|
17
|
-
skill_store: SkillStoreABC = Field(
|
|
18
|
-
description="The skill store for persisting data"
|
|
19
|
-
)
|
|
20
16
|
|
|
21
17
|
@property
|
|
22
18
|
def category(self) -> str:
|
|
@@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Optional, TypedDict
|
|
|
4
4
|
|
|
5
5
|
from coinbase_agentkit import superfluid_action_provider
|
|
6
6
|
|
|
7
|
-
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
7
|
from intentkit.skills.base import (
|
|
9
8
|
SkillConfig,
|
|
10
9
|
SkillState,
|
|
@@ -32,7 +31,6 @@ class Config(SkillConfig):
|
|
|
32
31
|
async def get_skills(
|
|
33
32
|
config: "Config",
|
|
34
33
|
is_private: bool,
|
|
35
|
-
store: SkillStoreABC,
|
|
36
34
|
agent_id: str,
|
|
37
35
|
agent: Optional["Agent"] = None,
|
|
38
36
|
**_,
|
|
@@ -47,7 +45,7 @@ async def get_skills(
|
|
|
47
45
|
available_skills.append(skill_name)
|
|
48
46
|
|
|
49
47
|
actions = await get_agentkit_actions(
|
|
50
|
-
agent_id,
|
|
48
|
+
agent_id, [superfluid_action_provider], agent=agent
|
|
51
49
|
)
|
|
52
50
|
tools: list[SuperfluidBaseTool] = []
|
|
53
51
|
for skill in available_skills:
|
|
@@ -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.skills.base import SkillConfig, SkillOwnerState
|
|
8
7
|
from intentkit.skills.system.add_autonomous_task import AddAutonomousTask
|
|
9
8
|
from intentkit.skills.system.base import SystemBaseTool
|
|
@@ -37,7 +36,6 @@ class Config(SkillConfig):
|
|
|
37
36
|
async def get_skills(
|
|
38
37
|
config: "Config",
|
|
39
38
|
is_private: bool,
|
|
40
|
-
store: SkillStoreABC,
|
|
41
39
|
**_,
|
|
42
40
|
) -> list[SystemBaseTool]:
|
|
43
41
|
"""Get all system skills.
|
|
@@ -45,7 +43,6 @@ async def get_skills(
|
|
|
45
43
|
Args:
|
|
46
44
|
config: The configuration for system skills.
|
|
47
45
|
is_private: Whether to include private skills.
|
|
48
|
-
store: The skill store for persisting data.
|
|
49
46
|
|
|
50
47
|
Returns:
|
|
51
48
|
A list of system skills.
|
|
@@ -62,7 +59,7 @@ async def get_skills(
|
|
|
62
59
|
# Get each skill using the cached getter
|
|
63
60
|
result = []
|
|
64
61
|
for name in available_skills:
|
|
65
|
-
skill = get_system_skill(name
|
|
62
|
+
skill = get_system_skill(name)
|
|
66
63
|
if skill:
|
|
67
64
|
result.append(skill)
|
|
68
65
|
return result
|
|
@@ -70,52 +67,38 @@ async def get_skills(
|
|
|
70
67
|
|
|
71
68
|
def get_system_skill(
|
|
72
69
|
name: str,
|
|
73
|
-
store: SkillStoreABC,
|
|
74
70
|
) -> SystemBaseTool:
|
|
75
71
|
"""Get a system skill by name.
|
|
76
72
|
|
|
77
73
|
Args:
|
|
78
74
|
name: The name of the skill to get
|
|
79
|
-
store: The skill store for persisting data
|
|
80
75
|
|
|
81
76
|
Returns:
|
|
82
77
|
The requested system skill
|
|
83
78
|
"""
|
|
84
79
|
if name == "read_agent_api_key":
|
|
85
80
|
if name not in _cache:
|
|
86
|
-
_cache[name] = ReadAgentApiKey(
|
|
87
|
-
skill_store=store,
|
|
88
|
-
)
|
|
81
|
+
_cache[name] = ReadAgentApiKey()
|
|
89
82
|
return _cache[name]
|
|
90
83
|
elif name == "regenerate_agent_api_key":
|
|
91
84
|
if name not in _cache:
|
|
92
|
-
_cache[name] = RegenerateAgentApiKey(
|
|
93
|
-
skill_store=store,
|
|
94
|
-
)
|
|
85
|
+
_cache[name] = RegenerateAgentApiKey()
|
|
95
86
|
return _cache[name]
|
|
96
87
|
elif name == "list_autonomous_tasks":
|
|
97
88
|
if name not in _cache:
|
|
98
|
-
_cache[name] = ListAutonomousTasks(
|
|
99
|
-
skill_store=store,
|
|
100
|
-
)
|
|
89
|
+
_cache[name] = ListAutonomousTasks()
|
|
101
90
|
return _cache[name]
|
|
102
91
|
elif name == "add_autonomous_task":
|
|
103
92
|
if name not in _cache:
|
|
104
|
-
_cache[name] = AddAutonomousTask(
|
|
105
|
-
skill_store=store,
|
|
106
|
-
)
|
|
93
|
+
_cache[name] = AddAutonomousTask()
|
|
107
94
|
return _cache[name]
|
|
108
95
|
elif name == "delete_autonomous_task":
|
|
109
96
|
if name not in _cache:
|
|
110
|
-
_cache[name] = DeleteAutonomousTask(
|
|
111
|
-
skill_store=store,
|
|
112
|
-
)
|
|
97
|
+
_cache[name] = DeleteAutonomousTask()
|
|
113
98
|
return _cache[name]
|
|
114
99
|
elif name == "edit_autonomous_task":
|
|
115
100
|
if name not in _cache:
|
|
116
|
-
_cache[name] = EditAutonomousTask(
|
|
117
|
-
skill_store=store,
|
|
118
|
-
)
|
|
101
|
+
_cache[name] = EditAutonomousTask()
|
|
119
102
|
return _cache[name]
|
|
120
103
|
else:
|
|
121
104
|
logger.warning(f"Unknown system skill: {name}")
|
|
@@ -75,7 +75,7 @@ class AddAutonomousTask(SystemBaseTool):
|
|
|
75
75
|
AddAutonomousTaskOutput: The created task
|
|
76
76
|
"""
|
|
77
77
|
context = self.get_context()
|
|
78
|
-
|
|
78
|
+
agent = context.agent
|
|
79
79
|
|
|
80
80
|
task = AgentAutonomous(
|
|
81
81
|
name=name,
|
|
@@ -86,6 +86,6 @@ class AddAutonomousTask(SystemBaseTool):
|
|
|
86
86
|
enabled=True,
|
|
87
87
|
)
|
|
88
88
|
|
|
89
|
-
created_task = await
|
|
89
|
+
created_task = await agent.add_autonomous_task(task)
|
|
90
90
|
|
|
91
91
|
return AddAutonomousTaskOutput(task=created_task)
|
|
@@ -45,9 +45,9 @@ class DeleteAutonomousTask(SystemBaseTool):
|
|
|
45
45
|
DeleteAutonomousTaskOutput: Confirmation of deletion
|
|
46
46
|
"""
|
|
47
47
|
context = self.get_context()
|
|
48
|
-
|
|
48
|
+
agent = context.agent
|
|
49
49
|
|
|
50
|
-
await
|
|
50
|
+
await agent.delete_autonomous_task(task_id)
|
|
51
51
|
|
|
52
52
|
return DeleteAutonomousTaskOutput(
|
|
53
53
|
success=True, message=f"Successfully deleted autonomous task {task_id}"
|
|
@@ -85,7 +85,7 @@ class EditAutonomousTask(SystemBaseTool):
|
|
|
85
85
|
EditAutonomousTaskOutput: The updated task
|
|
86
86
|
"""
|
|
87
87
|
context = self.get_context()
|
|
88
|
-
|
|
88
|
+
agent = context.agent
|
|
89
89
|
|
|
90
90
|
if minutes is not None and cron is not None:
|
|
91
91
|
raise ValueError("minutes and cron are mutually exclusive")
|
|
@@ -107,8 +107,6 @@ class EditAutonomousTask(SystemBaseTool):
|
|
|
107
107
|
if enabled is not None:
|
|
108
108
|
task_updates["enabled"] = enabled
|
|
109
109
|
|
|
110
|
-
updated_task = await
|
|
111
|
-
agent_id, task_id, task_updates
|
|
112
|
-
)
|
|
110
|
+
updated_task = await agent.update_autonomous_task(task_id, task_updates)
|
|
113
111
|
|
|
114
112
|
return EditAutonomousTaskOutput(task=updated_task)
|
|
@@ -43,8 +43,8 @@ class ListAutonomousTasks(SystemBaseTool):
|
|
|
43
43
|
ListAutonomousTasksOutput: List of autonomous tasks
|
|
44
44
|
"""
|
|
45
45
|
context = self.get_context()
|
|
46
|
-
|
|
46
|
+
agent = context.agent
|
|
47
47
|
|
|
48
|
-
tasks = await
|
|
48
|
+
tasks = await agent.list_autonomous_tasks()
|
|
49
49
|
|
|
50
50
|
return ListAutonomousTasksOutput(tasks=tasks)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
|
|
3
|
+
from intentkit.config.config import config
|
|
4
|
+
from intentkit.models.agent_data import AgentData
|
|
3
5
|
from intentkit.skills.system.base import SystemBaseTool
|
|
4
6
|
|
|
5
7
|
|
|
@@ -41,11 +43,11 @@ class ReadAgentApiKey(SystemBaseTool):
|
|
|
41
43
|
context = self.get_context()
|
|
42
44
|
agent_id = context.agent_id
|
|
43
45
|
|
|
44
|
-
# Get agent data from
|
|
45
|
-
agent_data = await
|
|
46
|
+
# Get agent data from the database
|
|
47
|
+
agent_data = await AgentData.get(agent_id)
|
|
46
48
|
|
|
47
49
|
# Get API base URL from system config
|
|
48
|
-
open_api_base_url =
|
|
50
|
+
open_api_base_url = config.open_api_base_url
|
|
49
51
|
api_endpoint = f"{open_api_base_url}/v1/chat/completions"
|
|
50
52
|
|
|
51
53
|
# Check if API keys exist
|
|
@@ -72,7 +74,7 @@ class ReadAgentApiKey(SystemBaseTool):
|
|
|
72
74
|
update_data["api_key_public"] = new_public_api_key
|
|
73
75
|
|
|
74
76
|
if update_data:
|
|
75
|
-
await
|
|
77
|
+
await AgentData.patch(agent_id, update_data)
|
|
76
78
|
|
|
77
79
|
return ReadAgentApiKeyOutput(
|
|
78
80
|
api_key=new_api_key,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
|
|
3
|
+
from intentkit.config.config import config
|
|
4
|
+
from intentkit.models.agent_data import AgentData
|
|
3
5
|
from intentkit.skills.system.base import SystemBaseTool
|
|
4
6
|
|
|
5
7
|
|
|
@@ -43,11 +45,11 @@ class RegenerateAgentApiKey(SystemBaseTool):
|
|
|
43
45
|
context = self.get_context()
|
|
44
46
|
agent_id = context.agent_id
|
|
45
47
|
|
|
46
|
-
# Get agent data from
|
|
47
|
-
agent_data = await
|
|
48
|
+
# Get agent data directly from the model
|
|
49
|
+
agent_data = await AgentData.get(agent_id)
|
|
48
50
|
|
|
49
51
|
# Get API base URL from system config
|
|
50
|
-
open_api_base_url =
|
|
52
|
+
open_api_base_url = config.open_api_base_url
|
|
51
53
|
api_endpoint = f"{open_api_base_url}/v1/chat/completions"
|
|
52
54
|
|
|
53
55
|
# Check if previous API keys existed
|
|
@@ -58,7 +60,7 @@ class RegenerateAgentApiKey(SystemBaseTool):
|
|
|
58
60
|
new_public_api_key = self._generate_public_api_key()
|
|
59
61
|
|
|
60
62
|
# Save the new API keys to agent data (overwrites existing)
|
|
61
|
-
await
|
|
63
|
+
await AgentData.patch(
|
|
62
64
|
agent_id, {"api_key": new_api_key, "api_key_public": new_public_api_key}
|
|
63
65
|
)
|
|
64
66
|
|
|
@@ -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.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.tavily.base import TavilyBaseTool
|
|
9
8
|
from intentkit.skills.tavily.tavily_extract import TavilyExtract
|
|
@@ -30,7 +29,6 @@ class Config(SkillConfig):
|
|
|
30
29
|
async def get_skills(
|
|
31
30
|
config: "Config",
|
|
32
31
|
is_private: bool,
|
|
33
|
-
store: SkillStoreABC,
|
|
34
32
|
**_,
|
|
35
33
|
) -> list[TavilyBaseTool]:
|
|
36
34
|
"""Get all Tavily search skills.
|
|
@@ -38,7 +36,6 @@ async def get_skills(
|
|
|
38
36
|
Args:
|
|
39
37
|
config: The configuration for Tavily search skills.
|
|
40
38
|
is_private: Whether to include private skills.
|
|
41
|
-
store: The skill store for persisting data.
|
|
42
39
|
|
|
43
40
|
Returns:
|
|
44
41
|
A list of Tavily search skills.
|
|
@@ -55,7 +52,7 @@ async def get_skills(
|
|
|
55
52
|
# Get each skill using the cached getter
|
|
56
53
|
result = []
|
|
57
54
|
for name in available_skills:
|
|
58
|
-
skill = get_tavily_skill(name
|
|
55
|
+
skill = get_tavily_skill(name)
|
|
59
56
|
if skill:
|
|
60
57
|
result.append(skill)
|
|
61
58
|
return result
|
|
@@ -63,28 +60,22 @@ async def get_skills(
|
|
|
63
60
|
|
|
64
61
|
def get_tavily_skill(
|
|
65
62
|
name: str,
|
|
66
|
-
store: SkillStoreABC,
|
|
67
63
|
) -> TavilyBaseTool:
|
|
68
64
|
"""Get a Tavily search skill by name.
|
|
69
65
|
|
|
70
66
|
Args:
|
|
71
67
|
name: The name of the skill to get
|
|
72
|
-
store: The skill store for persisting data
|
|
73
68
|
|
|
74
69
|
Returns:
|
|
75
70
|
The requested Tavily search skill
|
|
76
71
|
"""
|
|
77
72
|
if name == "tavily_search":
|
|
78
73
|
if name not in _cache:
|
|
79
|
-
_cache[name] = TavilySearch(
|
|
80
|
-
skill_store=store,
|
|
81
|
-
)
|
|
74
|
+
_cache[name] = TavilySearch()
|
|
82
75
|
return _cache[name]
|
|
83
76
|
elif name == "tavily_extract":
|
|
84
77
|
if name not in _cache:
|
|
85
|
-
_cache[name] = TavilyExtract(
|
|
86
|
-
skill_store=store,
|
|
87
|
-
)
|
|
78
|
+
_cache[name] = TavilyExtract()
|
|
88
79
|
return _cache[name]
|
|
89
80
|
else:
|
|
90
81
|
logger.warning(f"Unknown Tavily skill: {name}")
|
intentkit/skills/tavily/base.py
CHANGED
|
@@ -3,7 +3,7 @@ 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.
|
|
6
|
+
from intentkit.config.config import config
|
|
7
7
|
from intentkit.skills.base import IntentKitSkill
|
|
8
8
|
|
|
9
9
|
|
|
@@ -13,16 +13,13 @@ class TavilyBaseTool(IntentKitSkill):
|
|
|
13
13
|
name: str = Field(description="The name of the tool")
|
|
14
14
|
description: str = Field(description="A description of what the tool does")
|
|
15
15
|
args_schema: Type[BaseModel]
|
|
16
|
-
skill_store: SkillStoreABC = Field(
|
|
17
|
-
description="The skill store for persisting data"
|
|
18
|
-
)
|
|
19
16
|
|
|
20
17
|
def get_api_key(self) -> str:
|
|
21
18
|
context = self.get_context()
|
|
22
19
|
skill_config = context.agent.skill_config(self.category)
|
|
23
20
|
api_key_provider = skill_config.get("api_key_provider")
|
|
24
21
|
if api_key_provider == "platform":
|
|
25
|
-
return
|
|
22
|
+
return config.tavily_api_key
|
|
26
23
|
# for backward compatibility, may only have api_key in skill_config
|
|
27
24
|
elif skill_config.get("api_key"):
|
|
28
25
|
return skill_config.get("api_key")
|
|
@@ -73,9 +73,8 @@ class TavilyExtract(TavilyBaseTool):
|
|
|
73
73
|
"rate_limit_minutes"
|
|
74
74
|
):
|
|
75
75
|
await self.user_rate_limit_by_category(
|
|
76
|
-
context.user_id,
|
|
77
76
|
skill_config["rate_limit_number"],
|
|
78
|
-
skill_config["rate_limit_minutes"],
|
|
77
|
+
skill_config["rate_limit_minutes"] * 60,
|
|
79
78
|
)
|
|
80
79
|
|
|
81
80
|
# Get the API key from the agent's configuration
|
|
@@ -4,6 +4,7 @@ from typing import Type
|
|
|
4
4
|
import httpx
|
|
5
5
|
from pydantic import BaseModel, Field
|
|
6
6
|
|
|
7
|
+
from intentkit.config.config import config
|
|
7
8
|
from intentkit.skills.tavily.base import TavilyBaseTool
|
|
8
9
|
|
|
9
10
|
logger = logging.getLogger(__name__)
|
|
@@ -80,16 +81,15 @@ class TavilySearch(TavilyBaseTool):
|
|
|
80
81
|
"rate_limit_minutes"
|
|
81
82
|
):
|
|
82
83
|
await self.user_rate_limit_by_category(
|
|
83
|
-
context.user_id,
|
|
84
84
|
skill_config["rate_limit_number"],
|
|
85
|
-
skill_config["rate_limit_minutes"],
|
|
85
|
+
skill_config["rate_limit_minutes"] * 60,
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
# Get the API key from the agent's configuration
|
|
89
89
|
if skill_config.get("api_key_provider") == "agent_owner":
|
|
90
90
|
api_key = skill_config.get("api_key")
|
|
91
91
|
else:
|
|
92
|
-
api_key =
|
|
92
|
+
api_key = config.tavily_api_key
|
|
93
93
|
if not api_key:
|
|
94
94
|
return "Error: No Tavily API key provided in the configuration."
|
|
95
95
|
|
|
@@ -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.skills.base import SkillConfig, SkillState
|
|
8
7
|
from intentkit.skills.token.base import TokenBaseTool
|
|
9
8
|
from intentkit.skills.token.erc20_transfers import ERC20Transfers
|
|
@@ -36,7 +35,6 @@ class Config(SkillConfig):
|
|
|
36
35
|
async def get_skills(
|
|
37
36
|
config: "Config",
|
|
38
37
|
is_private: bool,
|
|
39
|
-
store: SkillStoreABC,
|
|
40
38
|
**_,
|
|
41
39
|
) -> list[TokenBaseTool]:
|
|
42
40
|
"""Get all Token blockchain analysis skills.
|
|
@@ -44,7 +42,6 @@ async def get_skills(
|
|
|
44
42
|
Args:
|
|
45
43
|
config: The configuration for Token skills.
|
|
46
44
|
is_private: Whether to include private skills.
|
|
47
|
-
store: The skill store for persisting data.
|
|
48
45
|
|
|
49
46
|
Returns:
|
|
50
47
|
A list of Token blockchain analysis skills.
|
|
@@ -65,7 +62,7 @@ async def get_skills(
|
|
|
65
62
|
# Get each skill using the cached getter
|
|
66
63
|
result = []
|
|
67
64
|
for name in available_skills:
|
|
68
|
-
skill = get_token_skill(name
|
|
65
|
+
skill = get_token_skill(name)
|
|
69
66
|
if skill:
|
|
70
67
|
result.append(skill)
|
|
71
68
|
|
|
@@ -74,13 +71,11 @@ async def get_skills(
|
|
|
74
71
|
|
|
75
72
|
def get_token_skill(
|
|
76
73
|
name: str,
|
|
77
|
-
store: SkillStoreABC,
|
|
78
74
|
) -> TokenBaseTool:
|
|
79
75
|
"""Get a Token blockchain analysis skill by name.
|
|
80
76
|
|
|
81
77
|
Args:
|
|
82
78
|
name: The name of the skill to get
|
|
83
|
-
store: The skill store for persisting data
|
|
84
79
|
|
|
85
80
|
Returns:
|
|
86
81
|
The requested Token blockchain analysis skill
|
|
@@ -90,13 +85,13 @@ def get_token_skill(
|
|
|
90
85
|
|
|
91
86
|
skill = None
|
|
92
87
|
if name == "token_price":
|
|
93
|
-
skill = TokenPrice(
|
|
88
|
+
skill = TokenPrice()
|
|
94
89
|
elif name == "token_erc20_transfers":
|
|
95
|
-
skill = ERC20Transfers(
|
|
90
|
+
skill = ERC20Transfers()
|
|
96
91
|
elif name == "token_search":
|
|
97
|
-
skill = TokenSearch(
|
|
92
|
+
skill = TokenSearch()
|
|
98
93
|
elif name == "token_analytics":
|
|
99
|
-
skill = TokenAnalytics(
|
|
94
|
+
skill = TokenAnalytics()
|
|
100
95
|
else:
|
|
101
96
|
logger.warning(f"Unknown Token skill: {name}")
|
|
102
97
|
return None
|
intentkit/skills/token/base.py
CHANGED
|
@@ -5,7 +5,7 @@ from typing import Any, Dict
|
|
|
5
5
|
|
|
6
6
|
import aiohttp
|
|
7
7
|
|
|
8
|
-
from intentkit.
|
|
8
|
+
from intentkit.config.config import config
|
|
9
9
|
from intentkit.skills.base import IntentKitSkill
|
|
10
10
|
from intentkit.skills.token.constants import MORALIS_API_BASE_URL
|
|
11
11
|
|
|
@@ -19,10 +19,6 @@ class TokenBaseTool(IntentKitSkill):
|
|
|
19
19
|
including making HTTP requests to the Moralis API.
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
|
-
def __init__(self, skill_store: SkillStoreABC = None):
|
|
23
|
-
"""Initialize the token tool with a skill store."""
|
|
24
|
-
super().__init__(skill_store=skill_store)
|
|
25
|
-
|
|
26
22
|
@property
|
|
27
23
|
def category(self) -> str:
|
|
28
24
|
return "token"
|
|
@@ -37,7 +33,7 @@ class TokenBaseTool(IntentKitSkill):
|
|
|
37
33
|
skill_config = context.agent.skill_config(self.category)
|
|
38
34
|
if skill_config.get("api_key_provider") == "agent_owner":
|
|
39
35
|
return skill_config.get("api_key")
|
|
40
|
-
return
|
|
36
|
+
return config.moralis_api_key
|
|
41
37
|
|
|
42
38
|
def _prepare_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
|
|
43
39
|
"""Convert boolean values to lowercase strings for API compatibility.
|