intentkit 0.8.13.dev2__py3-none-any.whl → 0.8.14__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/agent.py +5 -2
- intentkit/models/llm.py +6 -2
- intentkit/skills/x402/ask_agent.py +62 -3
- intentkit/skills/x402/schema.json +2 -2
- intentkit/skills/x402/x402.webp +0 -0
- {intentkit-0.8.13.dev2.dist-info → intentkit-0.8.14.dist-info}/METADATA +1 -1
- {intentkit-0.8.13.dev2.dist-info → intentkit-0.8.14.dist-info}/RECORD +10 -10
- intentkit/skills/x402/x402.png +0 -0
- {intentkit-0.8.13.dev2.dist-info → intentkit-0.8.14.dist-info}/WHEEL +0 -0
- {intentkit-0.8.13.dev2.dist-info → intentkit-0.8.14.dist-info}/licenses/LICENSE +0 -0
intentkit/__init__.py
CHANGED
intentkit/models/agent.py
CHANGED
|
@@ -1141,8 +1141,11 @@ class Agent(AgentCreate, AgentPublicInfo):
|
|
|
1141
1141
|
return False
|
|
1142
1142
|
|
|
1143
1143
|
async def is_model_support_image(self) -> bool:
|
|
1144
|
-
|
|
1145
|
-
|
|
1144
|
+
try:
|
|
1145
|
+
model = await LLMModelInfo.get(self.model)
|
|
1146
|
+
return model.supports_image_input
|
|
1147
|
+
except Exception:
|
|
1148
|
+
return False
|
|
1146
1149
|
|
|
1147
1150
|
def to_yaml(self) -> str:
|
|
1148
1151
|
"""
|
intentkit/models/llm.py
CHANGED
|
@@ -12,7 +12,7 @@ from intentkit.models.app_setting import AppSetting
|
|
|
12
12
|
from intentkit.models.base import Base
|
|
13
13
|
from intentkit.models.db import get_session
|
|
14
14
|
from intentkit.models.redis import get_redis
|
|
15
|
-
from intentkit.utils.error import
|
|
15
|
+
from intentkit.utils.error import IntentKitAPIError
|
|
16
16
|
from langchain.chat_models.base import BaseChatModel
|
|
17
17
|
from pydantic import BaseModel, ConfigDict, Field
|
|
18
18
|
from sqlalchemy import Boolean, Column, DateTime, Integer, Numeric, String, func, select
|
|
@@ -282,7 +282,11 @@ class LLMModelInfo(BaseModel):
|
|
|
282
282
|
return model_info
|
|
283
283
|
|
|
284
284
|
# Not found anywhere
|
|
285
|
-
raise
|
|
285
|
+
raise IntentKitAPIError(
|
|
286
|
+
400,
|
|
287
|
+
"ModelNotFound",
|
|
288
|
+
f"Model {model_id} not found, maybe deprecated, please change it in the agent configuration.",
|
|
289
|
+
)
|
|
286
290
|
|
|
287
291
|
@classmethod
|
|
288
292
|
async def get_all(cls, session: AsyncSession | None = None) -> list["LLMModelInfo"]:
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import threading
|
|
1
2
|
from typing import Any, Dict, Optional, Type
|
|
2
3
|
|
|
4
|
+
from coinbase_agentkit.wallet_providers.evm_wallet_provider import (
|
|
5
|
+
EvmWalletSigner as CoinbaseEvmWalletSigner,
|
|
6
|
+
)
|
|
3
7
|
from langchain_core.tools import ToolException
|
|
4
8
|
from pydantic import BaseModel, Field
|
|
5
9
|
from x402.clients.httpx import x402HttpxClient
|
|
6
10
|
|
|
11
|
+
from intentkit.clients import get_wallet_provider
|
|
7
12
|
from intentkit.config.config import config
|
|
8
13
|
from intentkit.models.chat import AuthorType
|
|
9
14
|
from intentkit.skills.x402.base import X402BaseSkill
|
|
@@ -42,8 +47,10 @@ class X402AskAgent(X402BaseSkill):
|
|
|
42
47
|
if not base_url:
|
|
43
48
|
raise ValueError("X402 API base URL is not configured.")
|
|
44
49
|
|
|
45
|
-
#
|
|
46
|
-
|
|
50
|
+
# Use wallet provider signer to satisfy eth_account.BaseAccount interface requirements
|
|
51
|
+
context = self.get_context()
|
|
52
|
+
wallet_provider = await get_wallet_provider(context.agent)
|
|
53
|
+
account = ThreadSafeEvmWalletSigner(wallet_provider)
|
|
47
54
|
|
|
48
55
|
payload: Dict[str, Any] = {
|
|
49
56
|
"agent_id": agent_id,
|
|
@@ -56,7 +63,7 @@ class X402AskAgent(X402BaseSkill):
|
|
|
56
63
|
payload["super_mode"] = super_mode
|
|
57
64
|
|
|
58
65
|
async with x402HttpxClient(
|
|
59
|
-
account=
|
|
66
|
+
account=account,
|
|
60
67
|
base_url=base_url,
|
|
61
68
|
timeout=20.0,
|
|
62
69
|
) as client:
|
|
@@ -80,3 +87,55 @@ class X402AskAgent(X402BaseSkill):
|
|
|
80
87
|
raise ToolException("Agent response did not include message text.")
|
|
81
88
|
|
|
82
89
|
return str(content)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class ThreadSafeEvmWalletSigner(CoinbaseEvmWalletSigner):
|
|
93
|
+
"""EVM wallet signer that avoids nested event loop errors.
|
|
94
|
+
|
|
95
|
+
Coinbase's signer runs async wallet calls in the current thread. When invoked
|
|
96
|
+
inside an active asyncio loop (as happens in async skills), it trips over the
|
|
97
|
+
loop already running. We hop work to a background thread so the provider can
|
|
98
|
+
spin up its own loop safely.
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
def _run_in_thread(self, func: Any, *args: Any, **kwargs: Any) -> Any:
|
|
102
|
+
result: list[Any] = []
|
|
103
|
+
error: list[BaseException] = []
|
|
104
|
+
|
|
105
|
+
def _target() -> None:
|
|
106
|
+
try:
|
|
107
|
+
result.append(func(*args, **kwargs))
|
|
108
|
+
except BaseException as exc: # pragma: no cover - bubble up original error
|
|
109
|
+
error.append(exc)
|
|
110
|
+
|
|
111
|
+
thread = threading.Thread(target=_target, daemon=True)
|
|
112
|
+
thread.start()
|
|
113
|
+
thread.join()
|
|
114
|
+
|
|
115
|
+
if error:
|
|
116
|
+
raise error[0]
|
|
117
|
+
return result[0] if result else None
|
|
118
|
+
|
|
119
|
+
def unsafe_sign_hash(self, message_hash: Any) -> Any:
|
|
120
|
+
return self._run_in_thread(super().unsafe_sign_hash, message_hash)
|
|
121
|
+
|
|
122
|
+
def sign_message(self, signable_message: Any) -> Any:
|
|
123
|
+
return self._run_in_thread(super().sign_message, signable_message)
|
|
124
|
+
|
|
125
|
+
def sign_transaction(self, transaction_dict: Any) -> Any:
|
|
126
|
+
return self._run_in_thread(super().sign_transaction, transaction_dict)
|
|
127
|
+
|
|
128
|
+
def sign_typed_data(
|
|
129
|
+
self,
|
|
130
|
+
domain_data: Optional[Dict[str, Any]] = None,
|
|
131
|
+
message_types: Optional[Dict[str, Any]] = None,
|
|
132
|
+
message_data: Optional[Dict[str, Any]] = None,
|
|
133
|
+
full_message: Optional[Dict[str, Any]] = None,
|
|
134
|
+
) -> Any:
|
|
135
|
+
return self._run_in_thread(
|
|
136
|
+
super().sign_typed_data,
|
|
137
|
+
domain_data=domain_data,
|
|
138
|
+
message_types=message_types,
|
|
139
|
+
message_data=message_data,
|
|
140
|
+
full_message=full_message,
|
|
141
|
+
)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "object",
|
|
4
4
|
"title": "x402",
|
|
5
5
|
"description": "Interact with other IntentKit agents through the x402 payment protocol.",
|
|
6
|
-
"x-icon": "https://ai.service.crestal.dev/skills/x402/x402.
|
|
6
|
+
"x-icon": "https://ai.service.crestal.dev/skills/x402/x402.webp",
|
|
7
7
|
"x-tags": [
|
|
8
8
|
"Communication",
|
|
9
9
|
"Infrastructure"
|
|
@@ -37,4 +37,4 @@
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: intentkit
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.14
|
|
4
4
|
Summary: Intent-based AI Agent Platform - Core Package
|
|
5
5
|
Project-URL: Homepage, https://github.com/crestalnetwork/intentkit
|
|
6
6
|
Project-URL: Repository, https://github.com/crestalnetwork/intentkit
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
intentkit/__init__.py,sha256=
|
|
1
|
+
intentkit/__init__.py,sha256=ju3oZWNJZsPELh-Bs5uw3iAUxNEILWGOrsXABlbH3ho,379
|
|
2
2
|
intentkit/abstracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
intentkit/abstracts/agent.py,sha256=108gb5W8Q1Sy4G55F2_ZFv2-_CnY76qrBtpIr0Oxxqk,1489
|
|
4
4
|
intentkit/abstracts/api.py,sha256=ZUc24vaQvQVbbjznx7bV0lbbQxdQPfEV8ZxM2R6wZWo,166
|
|
@@ -24,7 +24,7 @@ intentkit/core/node.py,sha256=-QVgmQuMnrzo6cF-4AECOIVT3R4gCnWfQ1EjTm2Sz1g,8791
|
|
|
24
24
|
intentkit/core/prompt.py,sha256=cf33qLpGozRc_aPdbnI_pDFREivSUhvUB9VboOKscXA,17212
|
|
25
25
|
intentkit/core/scheduler.py,sha256=XK-VVGkUk1PSjiFc5va2T134cmzMYHH_eIzInLzjv8c,2929
|
|
26
26
|
intentkit/core/statistics.py,sha256=-IZmxIBzyzZuai7QyfPEY1tx8Q8ydmmcm6eqbSSy_6o,6366
|
|
27
|
-
intentkit/models/agent.py,sha256=
|
|
27
|
+
intentkit/models/agent.py,sha256=L1RN5UqmvfEcfaCkwALxgwfqx2gHOx0qvG5cKH_M-34,70156
|
|
28
28
|
intentkit/models/agent_data.py,sha256=5zq3EPKnygT2P1OHc2IfEmL8hXkjeBND6sJ0JJsvQJg,28370
|
|
29
29
|
intentkit/models/agent_public.json,sha256=0X8Bd2WOobDJLsok8avWNzmzu4uvKSGEyy6Myn53eT4,2802
|
|
30
30
|
intentkit/models/agent_schema.json,sha256=_-oviPLPCdveQ3H4wTuoxC2PF5tOhFXuG7BUsmhUJG8,11829
|
|
@@ -37,7 +37,7 @@ intentkit/models/db.py,sha256=1uX1DJZGMx9A3lq6WKSTSwpXhWgWaiki55-iiED8BYM,5082
|
|
|
37
37
|
intentkit/models/db_mig.py,sha256=vT6Tanm-BHC2T7dTztuB1UG494EFBAlHADKsNzR6xaQ,3577
|
|
38
38
|
intentkit/models/generator.py,sha256=lyZu9U9rZUGkqd_QT5SAhay9DY358JJY8EhDSpN8I1M,10298
|
|
39
39
|
intentkit/models/llm.csv,sha256=0NIGyo-6E9sKkPy-iCw4xl3KK8dFO5t45le1gwfg7Vs,3801
|
|
40
|
-
intentkit/models/llm.py,sha256=
|
|
40
|
+
intentkit/models/llm.py,sha256=_t4dCyKo4l3dlETKt1SCEKAn-RZ2LRs1bhJfTESarpI,22313
|
|
41
41
|
intentkit/models/redis.py,sha256=Vqb9pjeMQ85Az5GvUbqCsQ5stBpFg3n85p94TB40xEw,3727
|
|
42
42
|
intentkit/models/skill.py,sha256=vGJgKpUmjGsThFznEwMLipuZIlqtto_ovVELp1_AjB8,20709
|
|
43
43
|
intentkit/models/skills.csv,sha256=4Ni3OlVLLVEv8ipBtFzBJ23pysi59HbJ4CRCMHAMDYQ,19219
|
|
@@ -437,10 +437,10 @@ intentkit/skills/wow/base.py,sha256=nFt8sJtQQsu2_ZlRasXhyG148fSJYRL-20kEt380PaE,
|
|
|
437
437
|
intentkit/skills/wow/schema.json,sha256=jGpugebVupGTlOUYNu7fN99p-zL-cfaoOYSX7KW8VQc,2292
|
|
438
438
|
intentkit/skills/wow/wow.svg,sha256=PO0-m6TZjJCql9r1oWohlRV5PyqGc5kIDUEnpP2-5SU,427
|
|
439
439
|
intentkit/skills/x402/__init__.py,sha256=tAO80tBlMluExByWiQ_r2GZlaAYTMsaWxCXDREaqqAg,1315
|
|
440
|
-
intentkit/skills/x402/ask_agent.py,sha256=
|
|
440
|
+
intentkit/skills/x402/ask_agent.py,sha256=9zp73uHmYZXnJQtEF7SRxC8N36e41cOwsNqVFo2Q9IQ,5053
|
|
441
441
|
intentkit/skills/x402/base.py,sha256=KhC9CWFEgdfQjWH1QCRJiNSWCnmgypVIe1ap1hb3X5E,211
|
|
442
|
-
intentkit/skills/x402/schema.json,sha256=
|
|
443
|
-
intentkit/skills/x402/x402.
|
|
442
|
+
intentkit/skills/x402/schema.json,sha256=drzDQYukjZisupVS-_A73F5GtT7MDHxKcTzDIr-aYTs,1069
|
|
443
|
+
intentkit/skills/x402/x402.webp,sha256=uFUnkwm9lwCwJgmNqa9ZgF6PjzCcAdQ8b_CKAFh8g-Y,4490
|
|
444
444
|
intentkit/skills/xmtp/README.md,sha256=7y3ny77l5WUI758Q3xip1akFEgBdbibkwZjeJDu5MwE,2963
|
|
445
445
|
intentkit/skills/xmtp/__init__.py,sha256=2x3roc8BaHT_Mfd7IXPw0UgUdca8TDB8NBFvMRibhD0,2180
|
|
446
446
|
intentkit/skills/xmtp/base.py,sha256=hPDcio_mgtD_blsQuMOJcwHQRKiFFaLR022JZZq1HPY,2512
|
|
@@ -458,7 +458,7 @@ intentkit/utils/s3.py,sha256=A8Nsx5QJyLsxhj9g7oHNy2-m24tjQUhC9URm8Qb1jFw,10057
|
|
|
458
458
|
intentkit/utils/schema.py,sha256=ATeTskEO2Y-MLFcOJEm5BoFJvxqc_zqQwiRS3rO4XDQ,3428
|
|
459
459
|
intentkit/utils/slack_alert.py,sha256=s7UpRgyzLW7Pbmt8cKzTJgMA9bm4EP-1rQ5KXayHu6E,2264
|
|
460
460
|
intentkit/utils/tx.py,sha256=2yLLGuhvfBEY5n_GJ8wmIWLCzn0FsYKv5kRNzw_sLUI,1454
|
|
461
|
-
intentkit-0.8.
|
|
462
|
-
intentkit-0.8.
|
|
463
|
-
intentkit-0.8.
|
|
464
|
-
intentkit-0.8.
|
|
461
|
+
intentkit-0.8.14.dist-info/METADATA,sha256=SGpkCX6bGfYxpW-DZLOLWU-ZDhF82LpYsUnX74d6Nms,6311
|
|
462
|
+
intentkit-0.8.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
463
|
+
intentkit-0.8.14.dist-info/licenses/LICENSE,sha256=Bln6DhK-LtcO4aXy-PBcdZv2f24MlJFm_qn222biJtE,1071
|
|
464
|
+
intentkit-0.8.14.dist-info/RECORD,,
|
intentkit/skills/x402/x402.png
DELETED
|
Binary file
|
|
File without changes
|
|
File without changes
|