intentkit 0.7.5.dev15__py3-none-any.whl → 0.7.5.dev16__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/models/skills.csv +23 -28
- intentkit/skills/base.py +45 -0
- intentkit/skills/basename/__init__.py +49 -0
- intentkit/skills/basename/base.py +11 -0
- intentkit/skills/basename/basename.svg +11 -0
- intentkit/skills/basename/schema.json +57 -0
- intentkit/skills/cdp/__init__.py +18 -92
- intentkit/skills/cdp/schema.json +13 -301
- intentkit/skills/erc20/__init__.py +50 -0
- intentkit/skills/erc20/base.py +11 -0
- intentkit/skills/erc20/erc20.svg +5 -0
- intentkit/skills/erc20/schema.json +73 -0
- intentkit/skills/erc721/__init__.py +51 -0
- intentkit/skills/erc721/base.py +11 -0
- intentkit/skills/erc721/erc721.svg +5 -0
- intentkit/skills/erc721/schema.json +89 -0
- intentkit/skills/morpho/__init__.py +50 -0
- intentkit/skills/morpho/base.py +11 -0
- intentkit/skills/morpho/morpho.svg +12 -0
- intentkit/skills/morpho/schema.json +73 -0
- intentkit/skills/pyth/__init__.py +50 -0
- intentkit/skills/pyth/base.py +11 -0
- intentkit/skills/pyth/pyth.svg +6 -0
- intentkit/skills/pyth/schema.json +73 -0
- intentkit/skills/skills.toml +32 -0
- intentkit/skills/superfluid/__init__.py +51 -0
- intentkit/skills/superfluid/base.py +11 -0
- intentkit/skills/superfluid/schema.json +89 -0
- intentkit/skills/superfluid/superfluid.svg +6 -0
- intentkit/skills/weth/__init__.py +49 -0
- intentkit/skills/weth/base.py +11 -0
- intentkit/skills/weth/schema.json +57 -0
- intentkit/skills/weth/weth.svg +6 -0
- intentkit/skills/wow/__init__.py +51 -0
- intentkit/skills/wow/base.py +11 -0
- intentkit/skills/wow/schema.json +89 -0
- intentkit/skills/wow/wow.svg +7 -0
- {intentkit-0.7.5.dev15.dist-info → intentkit-0.7.5.dev16.dist-info}/METADATA +1 -1
- {intentkit-0.7.5.dev15.dist-info → intentkit-0.7.5.dev16.dist-info}/RECORD +42 -12
- intentkit/skills/cdp/get_balance.py +0 -110
- intentkit/skills/cdp/swap.py +0 -121
- {intentkit-0.7.5.dev15.dist-info → intentkit-0.7.5.dev16.dist-info}/WHEEL +0 -0
- {intentkit-0.7.5.dev15.dist-info → intentkit-0.7.5.dev16.dist-info}/licenses/LICENSE +0 -0
intentkit/__init__.py
CHANGED
intentkit/models/skills.csv
CHANGED
|
@@ -2,34 +2,29 @@ category,config_name,name,enabled,price_level,price,price_self_key,rate_limit_co
|
|
|
2
2
|
acolyt,ask_gpt,acolyt_ask_gpt,FALSE,1,1,1,,,0x2Bd32A312280bF5A01140e68ca630fB76cE8A3De
|
|
3
3
|
aixbt,aixbt_projects,aixbt_projects,TRUE,3,100,5,,,0x3cdd051eeC909f94965F9c1c657f5b70a172B2C0
|
|
4
4
|
allora,get_price_prediction,allora_get_price_prediction,TRUE,4,230,5,,,0x2Bd32A312280bF5A01140e68ca630fB76cE8A3De
|
|
5
|
-
|
|
6
|
-
cdp,
|
|
7
|
-
cdp,
|
|
8
|
-
cdp,
|
|
9
|
-
cdp,
|
|
10
|
-
cdp,
|
|
11
|
-
cdp,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
cdp,WowActionProvider_buy_token,WowActionProvider_buy_token,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
29
|
-
cdp,WowActionProvider_create_token,WowActionProvider_create_token,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
30
|
-
cdp,WowActionProvider_sell_token,WowActionProvider_sell_token,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
31
|
-
cdp,get_balance,cdp_get_balance,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
32
|
-
cdp,swap,cdp_swap,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
5
|
+
basename,BasenameActionProvider_register_basename,BasenameActionProvider_register_basename,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
6
|
+
cdp,CdpApiActionProvider_request_faucet_funds,CdpApiActionProvider_request_faucet_funds,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
7
|
+
cdp,CdpEvmWalletActionProvider_get_swap_price,CdpEvmWalletActionProvider_get_swap_price,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
8
|
+
cdp,CdpEvmWalletActionProvider_swap,CdpEvmWalletActionProvider_swap,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
9
|
+
cdp,WalletActionProvider_get_balance,WalletActionProvider_get_balance,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
10
|
+
cdp,WalletActionProvider_get_wallet_details,WalletActionProvider_get_wallet_details,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
11
|
+
cdp,WalletActionProvider_native_transfer,WalletActionProvider_native_transfer,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
12
|
+
erc20,ERC20ActionProvider_get_balance,ERC20ActionProvider_get_balance,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
13
|
+
erc20,ERC20ActionProvider_transfer,ERC20ActionProvider_transfer,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
14
|
+
erc721,Erc721ActionProvider_get_balance,Erc721ActionProvider_get_balance,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
15
|
+
erc721,Erc721ActionProvider_mint,Erc721ActionProvider_mint,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
16
|
+
erc721,Erc721ActionProvider_transfer,Erc721ActionProvider_transfer,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
17
|
+
morpho,MorphoActionProvider_deposit,MorphoActionProvider_deposit,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
18
|
+
morpho,MorphoActionProvider_withdraw,MorphoActionProvider_withdraw,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
19
|
+
pyth,PythActionProvider_fetch_price,PythActionProvider_fetch_price,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
20
|
+
pyth,PythActionProvider_fetch_price_feed,PythActionProvider_fetch_price_feed,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
21
|
+
superfluid,SuperfluidActionProvider_create_flow,SuperfluidActionProvider_create_flow,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
22
|
+
superfluid,SuperfluidActionProvider_delete_flow,SuperfluidActionProvider_delete_flow,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
23
|
+
superfluid,SuperfluidActionProvider_update_flow,SuperfluidActionProvider_update_flow,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
24
|
+
weth,WethActionProvider_wrap_eth,WethActionProvider_wrap_eth,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
25
|
+
wow,WowActionProvider_buy_token,WowActionProvider_buy_token,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
26
|
+
wow,WowActionProvider_create_token,WowActionProvider_create_token,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
27
|
+
wow,WowActionProvider_sell_token,WowActionProvider_sell_token,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
33
28
|
chainlist,chain_lookup,chain-lookup,TRUE,1,5,5,,,0x3cdd051eeC909f94965F9c1c657f5b70a172B2C0
|
|
34
29
|
common,current_time,common_current_time,TRUE,1,5,5,,,0x445750026A4a1906b61302442E085f9cbAfe206a
|
|
35
30
|
cookiefun,get_account_details,cookiefun_get_account_details,TRUE,2,70,5,,,0x3cdd051eeC909f94965F9c1c657f5b70a172B2C0
|
intentkit/skills/base.py
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from collections.abc import Sequence
|
|
2
3
|
from typing import Any, Callable, Dict, Literal, NotRequired, Optional, TypedDict, Union
|
|
3
4
|
|
|
5
|
+
from coinbase_agentkit import (
|
|
6
|
+
Action,
|
|
7
|
+
AgentKit,
|
|
8
|
+
AgentKitConfig,
|
|
9
|
+
CdpEvmWalletProvider,
|
|
10
|
+
)
|
|
11
|
+
from langchain.tools import StructuredTool
|
|
4
12
|
from langchain_core.tools import BaseTool
|
|
5
13
|
from langchain_core.tools.base import ToolException
|
|
6
14
|
from langgraph.runtime import get_runtime
|
|
@@ -13,6 +21,7 @@ from web3 import Web3
|
|
|
13
21
|
|
|
14
22
|
from intentkit.abstracts.graph import AgentContext
|
|
15
23
|
from intentkit.abstracts.skill import SkillStoreABC
|
|
24
|
+
from intentkit.clients import CdpClient, get_cdp_client
|
|
16
25
|
from intentkit.clients.web3 import get_web3_client
|
|
17
26
|
from intentkit.models.redis import get_redis
|
|
18
27
|
from intentkit.utils.error import RateLimitExceeded
|
|
@@ -162,3 +171,39 @@ class IntentKitSkill(BaseTool):
|
|
|
162
171
|
network_id = agent.network_id
|
|
163
172
|
|
|
164
173
|
return get_web3_client(network_id, self.skill_store)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
async def get_agentkit_actions(
|
|
177
|
+
agent_id: str,
|
|
178
|
+
store: SkillStoreABC,
|
|
179
|
+
provider_factories: Sequence[Callable[[], object]],
|
|
180
|
+
) -> list[Action]:
|
|
181
|
+
"""Build an AgentKit instance and return its actions."""
|
|
182
|
+
|
|
183
|
+
cdp_client: CdpClient = await get_cdp_client(agent_id, store)
|
|
184
|
+
wallet_provider: CdpEvmWalletProvider = await cdp_client.get_wallet_provider()
|
|
185
|
+
|
|
186
|
+
agent_kit = AgentKit(
|
|
187
|
+
AgentKitConfig(
|
|
188
|
+
wallet_provider=wallet_provider,
|
|
189
|
+
action_providers=[factory() for factory in provider_factories],
|
|
190
|
+
)
|
|
191
|
+
)
|
|
192
|
+
return agent_kit.get_actions()
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def action_to_structured_tool(action: Action) -> StructuredTool:
|
|
196
|
+
"""Convert an AgentKit action to a LangChain StructuredTool."""
|
|
197
|
+
|
|
198
|
+
def _tool_fn(**kwargs: object) -> str:
|
|
199
|
+
return action.invoke(kwargs)
|
|
200
|
+
|
|
201
|
+
tool = StructuredTool(
|
|
202
|
+
name=action.name,
|
|
203
|
+
description=action.description,
|
|
204
|
+
func=_tool_fn,
|
|
205
|
+
args_schema=action.args_schema,
|
|
206
|
+
)
|
|
207
|
+
tool.handle_tool_error = lambda e: f"tool error: {e}"
|
|
208
|
+
tool.handle_validation_error = lambda e: f"validation error: {e}"
|
|
209
|
+
return tool
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""Basename AgentKit skills."""
|
|
2
|
+
|
|
3
|
+
from typing import TypedDict
|
|
4
|
+
|
|
5
|
+
from coinbase_agentkit import basename_action_provider
|
|
6
|
+
|
|
7
|
+
from intentkit.abstracts.skill import SkillStoreABC
|
|
8
|
+
from intentkit.skills.base import (
|
|
9
|
+
SkillConfig,
|
|
10
|
+
SkillState,
|
|
11
|
+
action_to_structured_tool,
|
|
12
|
+
get_agentkit_actions,
|
|
13
|
+
)
|
|
14
|
+
from intentkit.skills.basename.base import BasenameBaseTool
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SkillStates(TypedDict):
|
|
18
|
+
BasenameActionProvider_register_basename: SkillState
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Config(SkillConfig):
|
|
22
|
+
"""Configuration for Basename skills."""
|
|
23
|
+
|
|
24
|
+
states: SkillStates
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
async def get_skills(
|
|
28
|
+
config: "Config",
|
|
29
|
+
is_private: bool,
|
|
30
|
+
store: SkillStoreABC,
|
|
31
|
+
agent_id: str,
|
|
32
|
+
**_,
|
|
33
|
+
) -> list[BasenameBaseTool]:
|
|
34
|
+
"""Get all Basename skills."""
|
|
35
|
+
|
|
36
|
+
available_skills: list[str] = []
|
|
37
|
+
for skill_name, state in config["states"].items():
|
|
38
|
+
if state == "disabled":
|
|
39
|
+
continue
|
|
40
|
+
if state == "public" or (state == "private" and is_private):
|
|
41
|
+
available_skills.append(skill_name)
|
|
42
|
+
|
|
43
|
+
actions = await get_agentkit_actions(agent_id, store, [basename_action_provider])
|
|
44
|
+
tools: list[BasenameBaseTool] = []
|
|
45
|
+
for skill in available_skills:
|
|
46
|
+
for action in actions:
|
|
47
|
+
if action.name.endswith(skill):
|
|
48
|
+
tools.append(action_to_structured_tool(action))
|
|
49
|
+
return tools
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4
|
+
<stop offset="0%" stop-color="#4c7dff" />
|
|
5
|
+
<stop offset="100%" stop-color="#0b2f80" />
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="128" height="128" fill="url(#bg)" rx="16" />
|
|
9
|
+
<text x="50%" y="52%" font-family="Arial,Helvetica,sans-serif" font-size="60" fill="#ffffff" font-weight="700" text-anchor="middle">B</text>
|
|
10
|
+
<text x="50%" y="86%" font-family="Arial,Helvetica,sans-serif" font-size="20" fill="#dbe4ff" text-anchor="middle">Base</text>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"title": "Basename",
|
|
5
|
+
"description": "Basename ENS-style name registration via Coinbase AgentKit",
|
|
6
|
+
"x-icon": "https://ai.service.crestal.dev/skills/basename/basename.svg",
|
|
7
|
+
"x-tags": [
|
|
8
|
+
"Blockchain"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"enabled": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"title": "Enabled",
|
|
14
|
+
"description": "Whether this skill is enabled",
|
|
15
|
+
"default": true
|
|
16
|
+
},
|
|
17
|
+
"states": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"properties": {
|
|
20
|
+
"BasenameActionProvider_register_basename": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"title": "Register Basename",
|
|
23
|
+
"enum": [
|
|
24
|
+
"disabled",
|
|
25
|
+
"public",
|
|
26
|
+
"private"
|
|
27
|
+
],
|
|
28
|
+
"x-enum-title": [
|
|
29
|
+
"Disabled",
|
|
30
|
+
"Agent Owner + All Users",
|
|
31
|
+
"Agent Owner Only"
|
|
32
|
+
],
|
|
33
|
+
"description": "State for BasenameActionProvider_register_basename",
|
|
34
|
+
"default": "disabled"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"description": "States for each Basename skill (disabled, public, or private)"
|
|
38
|
+
},
|
|
39
|
+
"api_key_provider": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"title": "API Key Provider",
|
|
42
|
+
"description": "Who provides the API key",
|
|
43
|
+
"enum": [
|
|
44
|
+
"platform"
|
|
45
|
+
],
|
|
46
|
+
"x-enum-title": [
|
|
47
|
+
"Nation Hosted"
|
|
48
|
+
],
|
|
49
|
+
"default": "platform"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"required": [
|
|
53
|
+
"states",
|
|
54
|
+
"enabled"
|
|
55
|
+
],
|
|
56
|
+
"additionalProperties": true
|
|
57
|
+
}
|
intentkit/skills/cdp/__init__.py
CHANGED
|
@@ -3,70 +3,28 @@
|
|
|
3
3
|
from typing import TypedDict
|
|
4
4
|
|
|
5
5
|
from coinbase_agentkit import (
|
|
6
|
-
Action,
|
|
7
|
-
AgentKit,
|
|
8
|
-
AgentKitConfig,
|
|
9
|
-
CdpEvmWalletProvider,
|
|
10
|
-
basename_action_provider,
|
|
11
6
|
cdp_api_action_provider,
|
|
12
|
-
|
|
13
|
-
morpho_action_provider,
|
|
14
|
-
pyth_action_provider,
|
|
15
|
-
superfluid_action_provider,
|
|
7
|
+
cdp_evm_wallet_action_provider,
|
|
16
8
|
wallet_action_provider,
|
|
17
|
-
weth_action_provider,
|
|
18
|
-
wow_action_provider,
|
|
19
9
|
)
|
|
20
|
-
from coinbase_agentkit.action_providers.erc721 import erc721_action_provider
|
|
21
|
-
from langchain.tools import StructuredTool
|
|
22
10
|
|
|
23
11
|
from intentkit.abstracts.skill import SkillStoreABC
|
|
24
|
-
from intentkit.
|
|
25
|
-
|
|
12
|
+
from intentkit.skills.base import (
|
|
13
|
+
SkillConfig,
|
|
14
|
+
SkillState,
|
|
15
|
+
action_to_structured_tool,
|
|
16
|
+
get_agentkit_actions,
|
|
17
|
+
)
|
|
26
18
|
from intentkit.skills.cdp.base import CDPBaseTool
|
|
27
|
-
from intentkit.skills.cdp.get_balance import GetBalance
|
|
28
|
-
from intentkit.skills.cdp.swap import Swap
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def _action_to_structured_tool(action: Action) -> StructuredTool:
|
|
32
|
-
"""Convert an AgentKit action to a LangChain StructuredTool."""
|
|
33
|
-
|
|
34
|
-
def _tool_fn(**kwargs: object) -> str:
|
|
35
|
-
return action.invoke(kwargs)
|
|
36
|
-
|
|
37
|
-
return StructuredTool(
|
|
38
|
-
name=action.name,
|
|
39
|
-
description=action.description,
|
|
40
|
-
func=_tool_fn,
|
|
41
|
-
args_schema=action.args_schema,
|
|
42
|
-
)
|
|
43
19
|
|
|
44
20
|
|
|
45
21
|
class SkillStates(TypedDict):
|
|
46
|
-
get_balance: SkillState
|
|
47
|
-
swap: SkillState
|
|
48
22
|
WalletActionProvider_get_balance: SkillState
|
|
49
23
|
WalletActionProvider_get_wallet_details: SkillState
|
|
50
24
|
WalletActionProvider_native_transfer: SkillState
|
|
51
|
-
CdpApiActionProvider_address_reputation: SkillState
|
|
52
25
|
CdpApiActionProvider_request_faucet_funds: SkillState
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
BasenameActionProvider_register_basename: SkillState
|
|
56
|
-
ERC20ActionProvider_get_balance: SkillState
|
|
57
|
-
ERC20ActionProvider_transfer: SkillState
|
|
58
|
-
Erc721ActionProvider_get_balance: SkillState
|
|
59
|
-
Erc721ActionProvider_mint: SkillState
|
|
60
|
-
Erc721ActionProvider_transfer: SkillState
|
|
61
|
-
WethActionProvider_wrap_eth: SkillState
|
|
62
|
-
MorphoActionProvider_deposit: SkillState
|
|
63
|
-
MorphoActionProvider_withdraw: SkillState
|
|
64
|
-
SuperfluidActionProvider_create_flow: SkillState
|
|
65
|
-
SuperfluidActionProvider_delete_flow: SkillState
|
|
66
|
-
SuperfluidActionProvider_update_flow: SkillState
|
|
67
|
-
WowActionProvider_buy_token: SkillState
|
|
68
|
-
WowActionProvider_create_token: SkillState
|
|
69
|
-
WowActionProvider_sell_token: SkillState
|
|
26
|
+
CdpEvmWalletActionProvider_get_swap_price: SkillState
|
|
27
|
+
CdpEvmWalletActionProvider_swap: SkillState
|
|
70
28
|
|
|
71
29
|
|
|
72
30
|
class Config(SkillConfig):
|
|
@@ -105,50 +63,18 @@ async def get_skills(
|
|
|
105
63
|
available_skills.append(skill_name)
|
|
106
64
|
|
|
107
65
|
# Initialize CDP client
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
pyth_action_provider(),
|
|
117
|
-
basename_action_provider(),
|
|
118
|
-
erc20_action_provider(),
|
|
119
|
-
erc721_action_provider(),
|
|
120
|
-
weth_action_provider(),
|
|
121
|
-
morpho_action_provider(),
|
|
122
|
-
superfluid_action_provider(),
|
|
123
|
-
wow_action_provider(),
|
|
124
|
-
],
|
|
125
|
-
)
|
|
66
|
+
actions = await get_agentkit_actions(
|
|
67
|
+
agent_id,
|
|
68
|
+
store,
|
|
69
|
+
[
|
|
70
|
+
wallet_action_provider,
|
|
71
|
+
cdp_api_action_provider,
|
|
72
|
+
cdp_evm_wallet_action_provider,
|
|
73
|
+
],
|
|
126
74
|
)
|
|
127
|
-
actions = agent_kit.get_actions()
|
|
128
75
|
tools = []
|
|
129
76
|
for skill in available_skills:
|
|
130
|
-
if skill == "get_balance":
|
|
131
|
-
# Get the account object for the custom GetBalance skill
|
|
132
|
-
tools.append(
|
|
133
|
-
GetBalance(
|
|
134
|
-
agent_id=agent_id,
|
|
135
|
-
skill_store=store,
|
|
136
|
-
)
|
|
137
|
-
)
|
|
138
|
-
continue
|
|
139
|
-
elif skill == "swap" or skill.endswith("_trade"):
|
|
140
|
-
# Add the custom Swap skill, "trade" is backword compatible
|
|
141
|
-
tools.append(
|
|
142
|
-
Swap(
|
|
143
|
-
agent_id=agent_id,
|
|
144
|
-
skill_store=store,
|
|
145
|
-
)
|
|
146
|
-
)
|
|
147
|
-
continue
|
|
148
77
|
for action in actions:
|
|
149
78
|
if action.name.endswith(skill):
|
|
150
|
-
|
|
151
|
-
tool.handle_tool_error = lambda e: f"tool error: {e}"
|
|
152
|
-
tool.handle_validation_error = lambda e: f"validation error: {e}"
|
|
153
|
-
tools.append(tool)
|
|
79
|
+
tools.append(action_to_structured_tool(action))
|
|
154
80
|
return tools
|