intentkit 0.7.4rc1__py3-none-any.whl → 0.7.4rc3__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.

@@ -0,0 +1,98 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "title": "AgentPublicInfo",
5
+ "description": "Public information of the agent",
6
+ "properties": {
7
+ "description": {
8
+ "title": "Description",
9
+ "type": "string",
10
+ "description": "Description of the agent, for public view, not contained in prompt",
11
+ "x-group": "basic",
12
+ "x-placeholder": "Introduce your agent"
13
+ },
14
+ "external_website": {
15
+ "title": "External Website",
16
+ "type": "string",
17
+ "description": "Link of external website of the agent, if you have one",
18
+ "format": "uri",
19
+ "x-group": "basic",
20
+ "x-placeholder": "Enter agent external website url"
21
+ },
22
+ "ticker": {
23
+ "title": "Ticker",
24
+ "type": "string",
25
+ "description": "Ticker symbol of the agent",
26
+ "maxLength": 10,
27
+ "minLength": 1,
28
+ "x-group": "basic",
29
+ "x-placeholder": "If one day, your agent has it's own token, what will it be?"
30
+ },
31
+ "token_address": {
32
+ "title": "Token Address",
33
+ "type": "string",
34
+ "description": "Token address of the agent",
35
+ "maxLength": 42,
36
+ "x-group": "internal",
37
+ "readOnly": true
38
+ },
39
+ "token_pool": {
40
+ "title": "Token Pool",
41
+ "type": "string",
42
+ "description": "Pool of the agent token",
43
+ "maxLength": 42,
44
+ "x-group": "internal",
45
+ "readOnly": true
46
+ },
47
+ "fee_percentage": {
48
+ "title": "Fee Percentage",
49
+ "type": "number",
50
+ "description": "Fee percentage of the agent",
51
+ "minimum": 0,
52
+ "x-group": "basic"
53
+ },
54
+ "example_intro": {
55
+ "title": "Example Introduction",
56
+ "type": "string",
57
+ "description": "Introduction of the example",
58
+ "maxLength": 2000,
59
+ "x-group": "examples"
60
+ },
61
+ "examples": {
62
+ "title": "Examples",
63
+ "type": "array",
64
+ "description": "List of example prompts for the agent",
65
+ "maxItems": 6,
66
+ "items": {
67
+ "type": "object",
68
+ "properties": {
69
+ "name": {
70
+ "title": "Name",
71
+ "type": "string",
72
+ "description": "Name of the example",
73
+ "maxLength": 50,
74
+ "x-group": "examples"
75
+ },
76
+ "description": {
77
+ "title": "Description",
78
+ "type": "string",
79
+ "description": "Description of the example",
80
+ "maxLength": 200,
81
+ "x-group": "examples"
82
+ },
83
+ "prompt": {
84
+ "title": "Prompt",
85
+ "type": "string",
86
+ "description": "Example prompt",
87
+ "maxLength": 2000,
88
+ "x-group": "examples"
89
+ }
90
+ },
91
+ "required": ["name", "description", "prompt"]
92
+ },
93
+ "x-group": "examples",
94
+ "x-inline": true
95
+ }
96
+ },
97
+ "additionalProperties": true
98
+ }
@@ -67,48 +67,6 @@
67
67
  "x-group": "basic",
68
68
  "x-placeholder": "Enter agent name"
69
69
  },
70
- "mode": {
71
- "title": "Usage Type",
72
- "type": "string",
73
- "description": "Mode of the agent, Public App or Personal Assistant",
74
- "enum": [
75
- "public",
76
- "private"
77
- ],
78
- "x-enum-title": [
79
- "Public App",
80
- "Personal Assistant"
81
- ],
82
- "x-group": "deprecated"
83
- },
84
- "fee_percentage": {
85
- "title": "Service Fee",
86
- "type": "number",
87
- "description": "A CAPs % added to the base cost, paid to the agent for delivering its unique logic and execution.",
88
- "minimum": 0,
89
- "maximum": 100,
90
- "default": 0,
91
- "x-step": 1,
92
- "x-group": "basic",
93
- "x-component": "slider-with-box",
94
- "x-nft-extra": 10
95
- },
96
- "description": {
97
- "title": "Description",
98
- "type": "string",
99
- "description": "Description of the agent, for public view, not contained in prompt",
100
- "maxLength": 3000,
101
- "x-group": "basic",
102
- "x-placeholder": "Introduce your agent"
103
- },
104
- "external_website": {
105
- "title": "External Website",
106
- "type": "string",
107
- "description": "Link of external website of the agent, if you have one",
108
- "format": "uri",
109
- "x-group": "basic",
110
- "x-placeholder": "Enter agent external website url"
111
- },
112
70
  "picture": {
113
71
  "title": "Picture",
114
72
  "type": "string",
@@ -116,31 +74,6 @@
116
74
  "x-group": "experimental",
117
75
  "x-placeholder": "Upload a picture of your agent"
118
76
  },
119
- "slug": {
120
- "title": "Slug",
121
- "type": "string",
122
- "description": "Slug of the agent, used for URL generation",
123
- "maxLength": 30,
124
- "minLength": 2,
125
- "readOnly": true,
126
- "x-group": "internal"
127
- },
128
- "owner": {
129
- "title": "Owner",
130
- "type": "string",
131
- "description": "Owner identifier of the agent, used for access control",
132
- "readOnly": true,
133
- "maxLength": 50,
134
- "x-group": "internal"
135
- },
136
- "upstream_id": {
137
- "title": "Upstream ID",
138
- "type": "string",
139
- "description": "External reference ID for idempotent operations",
140
- "readOnly": true,
141
- "maxLength": 100,
142
- "x-group": "internal"
143
- },
144
77
  "model": {
145
78
  "title": "AI Model",
146
79
  "type": "string",
@@ -602,52 +535,6 @@
602
535
  "x-group": "autonomous",
603
536
  "x-inline": true
604
537
  },
605
- "example_intro": {
606
- "title": "Agent Greeting",
607
- "type": "string",
608
- "description": "This is the first thing users see when they meet your agent. Use it to explain what your agent does, the services it provides and how it fits into the Nation.",
609
- "maxLength": 2000,
610
- "x-group": "examples"
611
- },
612
- "examples": {
613
- "title": "Quick Action List",
614
- "type": "array",
615
- "maxItems": 6,
616
- "items": {
617
- "type": "object",
618
- "properties": {
619
- "name": {
620
- "title": "Action Name",
621
- "type": "string",
622
- "description": "Quick action will show up on the UI as this name",
623
- "maxLength": 50,
624
- "x-group": "examples"
625
- },
626
- "description": {
627
- "title": "Description",
628
- "type": "string",
629
- "description": "Description of what this action does",
630
- "maxLength": 200,
631
- "x-group": "examples"
632
- },
633
- "prompt": {
634
- "title": "Prompt",
635
- "type": "string",
636
- "description": "When user clicks this action, the agent will execute this prompt",
637
- "maxLength": 2000,
638
- "x-str-type": "prompt",
639
- "x-group": "examples"
640
- }
641
- },
642
- "required": [
643
- "name",
644
- "description",
645
- "prompt"
646
- ]
647
- },
648
- "description": "Quick clickable actions users can use with the agent without having to type any text instructions.",
649
- "x-group": "examples"
650
- },
651
538
  "wallet_provider": {
652
539
  "title": "Wallet Provider",
653
540
  "type": "string",
@@ -681,29 +568,6 @@
681
568
  "optimism-sepolia"
682
569
  ],
683
570
  "x-group": "onchain"
684
- },
685
- "ticker": {
686
- "title": "Ticker",
687
- "type": "string",
688
- "description": "Ticker symbol of the agent",
689
- "maxLength": 10,
690
- "minLength": 1,
691
- "x-group": "onchain",
692
- "x-placeholder": "Enter agent ticker"
693
- },
694
- "token_address": {
695
- "title": "Token Address",
696
- "type": "string",
697
- "description": "Token address of the agent, if it already has one",
698
- "maxLength": 42,
699
- "x-group": "onchain"
700
- },
701
- "token_pool": {
702
- "title": "Token Pool",
703
- "type": "string",
704
- "description": "Pool of the agent token, if it has one",
705
- "maxLength": 42,
706
- "x-group": "onchain"
707
571
  }
708
572
  },
709
573
  "if": {
intentkit/models/db.py CHANGED
@@ -102,7 +102,7 @@ async def get_db() -> AsyncGenerator[AsyncSession, None]:
102
102
 
103
103
 
104
104
  @asynccontextmanager
105
- async def get_session() -> AsyncSession:
105
+ async def get_session() -> AsyncGenerator[AsyncSession, None]:
106
106
  """Get a database session using an async context manager.
107
107
 
108
108
  This function is designed to be used with the 'async with' statement,
intentkit/models/user.py CHANGED
@@ -170,7 +170,7 @@ class UserUpdate(BaseModel):
170
170
  note=note,
171
171
  )
172
172
 
173
- async def patch(self, id: str) -> "User":
173
+ async def patch(self, id: str) -> UserModelType:
174
174
  """Update only the provided fields of a user in the database.
175
175
  If the user doesn't exist, create a new one with the provided ID and fields.
176
176
  If nft_count changes, update the daily quota accordingly.
@@ -182,7 +182,9 @@ class UserUpdate(BaseModel):
182
182
  Updated or newly created User model
183
183
  """
184
184
  user_model_class = user_model_registry.get_user_model_class()
185
+ assert issubclass(user_model_class, User)
185
186
  user_table_class = user_model_registry.get_user_table_class()
187
+ assert issubclass(user_table_class, UserTable)
186
188
  async with get_session() as db:
187
189
  db_user = await db.get(user_table_class, id)
188
190
  old_nft_count = 0 # Default for new users
@@ -208,7 +210,7 @@ class UserUpdate(BaseModel):
208
210
 
209
211
  return user_model_class.model_validate(db_user)
210
212
 
211
- async def put(self, id: str) -> "User":
213
+ async def put(self, id: str) -> UserModelType:
212
214
  """Replace all fields of a user in the database with the provided values.
213
215
  If the user doesn't exist, create a new one with the provided ID and fields.
214
216
  If nft_count changes, update the daily quota accordingly.
@@ -220,7 +222,9 @@ class UserUpdate(BaseModel):
220
222
  Updated or newly created User model
221
223
  """
222
224
  user_model_class = user_model_registry.get_user_model_class()
225
+ assert issubclass(user_model_class, User)
223
226
  user_table_class = user_model_registry.get_user_table_class()
227
+ assert issubclass(user_table_class, UserTable)
224
228
  async with get_session() as db:
225
229
  db_user = await db.get(user_table_class, id)
226
230
  old_nft_count = 0 # Default for new users
@@ -261,7 +265,7 @@ class User(UserUpdate):
261
265
  ]
262
266
 
263
267
  @classmethod
264
- async def get(cls, user_id: str) -> Optional["User"]:
268
+ async def get(cls, user_id: str) -> Optional[UserModelType]:
265
269
  """Get a user by ID.
266
270
 
267
271
  Args:
@@ -276,7 +280,7 @@ class User(UserUpdate):
276
280
  @classmethod
277
281
  async def get_in_session(
278
282
  cls, session: AsyncSession, user_id: str
279
- ) -> Optional["User"]:
283
+ ) -> Optional[UserModelType]:
280
284
  """Get a user by ID using the provided session.
281
285
 
282
286
  Args:
@@ -286,11 +290,14 @@ class User(UserUpdate):
286
290
  Returns:
287
291
  User model or None if not found
288
292
  """
293
+ user_model_class = user_model_registry.get_user_model_class()
294
+ assert issubclass(user_model_class, User)
289
295
  user_table_class = user_model_registry.get_user_table_class()
296
+ assert issubclass(user_table_class, UserTable)
290
297
  result = await session.execute(
291
298
  select(user_table_class).where(user_table_class.id == user_id)
292
299
  )
293
300
  user = result.scalars().first()
294
301
  if user is None:
295
302
  return None
296
- return cls.model_validate(user)
303
+ return user_model_class.model_validate(user)
intentkit/utils/chain.py CHANGED
@@ -422,9 +422,9 @@ class QuicknodeChainProvider(ChainProvider):
422
422
  )
423
423
 
424
424
  except httpx.HTTPStatusError as http_err:
425
- raise (f"Quicknode API HTTP Error: {http_err}")
425
+ raise Exception(f"Quicknode API HTTP Error: {http_err}")
426
426
  except httpx.RequestError as req_err:
427
- raise (f"Quicknode API Request Error: {req_err}")
427
+ raise Exception(f"Quicknode API Request Error: {req_err}")
428
428
  except (
429
429
  KeyError,
430
430
  TypeError,
@@ -433,4 +433,4 @@ class QuicknodeChainProvider(ChainProvider):
433
433
  f"Error processing QuickNode API response: {e}. Check the API response format."
434
434
  )
435
435
  except Exception as e:
436
- raise (f"Quicknode API An unexpected error occurred: {e}")
436
+ raise Exception(f"Quicknode API An unexpected error occurred: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: intentkit
3
- Version: 0.7.4rc1
3
+ Version: 0.7.4rc3
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=Hm7n1AUuxBnOAUwHU28kCemgEjOyGRbopVI8juF-BxY,383
1
+ intentkit/__init__.py,sha256=s2YFGMc0CUDn5y5wMq8V0MH2BS9nzN7wZ4Ip9doC2A4,383
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
@@ -7,36 +7,36 @@ intentkit/abstracts/graph.py,sha256=sX5hVemXsODvwIYLHufaf-zSXmW97bXRoZuyxYqaEV4,
7
7
  intentkit/abstracts/skill.py,sha256=cIJ6BkASD31U1IEkE8rdAawq99w_xsg0lt3oalqa1ZA,5071
8
8
  intentkit/abstracts/twitter.py,sha256=cEtP7ygR_b-pHdc9i8kBuyooz1cPoGUGwsBHDpowJyY,1262
9
9
  intentkit/clients/__init__.py,sha256=pT_4I7drnuiNWPvYAU_CUAv50PjyaqEAsm_kp-vMPW4,372
10
- intentkit/clients/cdp.py,sha256=_A0QRRi6uPYr_AL26arW-Yofez0JcrEQdfxGCVgC7kM,7038
10
+ intentkit/clients/cdp.py,sha256=OKX-itClQpnUSQxExTVzMtcZ29WaGF_t_dYBvc9bTIM,7014
11
11
  intentkit/clients/twitter.py,sha256=Lfa7srHOFnY96SXcElW0jfg7XKS_WliWnXjPZEe6SQc,18976
12
12
  intentkit/clients/web3.py,sha256=A-w4vBPXHpDh8svsEFj_LkmvRgoDTZw4E-84S-UC9ws,1023
13
13
  intentkit/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  intentkit/config/config.py,sha256=xDbm5KSXt4rZh2Nak0bmrYv5Rf__mJz8aJ9PHzar-Lk,8941
15
15
  intentkit/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- intentkit/core/agent.py,sha256=GIKDn1dTenIHWMRxe-ud7hd1cQaHzbTDdypy5IAgPfU,16658
16
+ intentkit/core/agent.py,sha256=9M5AmgBEJrELlnqRb3Bd2PWFIrGvie3xL1gy4PSjI8I,31687
17
17
  intentkit/core/api.py,sha256=WfoaHNquujYJIpNPuTR1dSaaxog0S3X2W4lG9Ehmkm4,3284
18
18
  intentkit/core/chat.py,sha256=dnwqAUk5uVNyhsX9dNZIHzleW1WbI5XSyHdCsD1ORR8,1639
19
19
  intentkit/core/client.py,sha256=J5K7f08-ucszBKAbn9K3QNOFKIC__7amTbKYii1jFkI,3056
20
20
  intentkit/core/credit.py,sha256=vW3I5c_fKe_bmFvOc9_EaMsMuAbqw-XQ_NbJg_okdA8,75284
21
- intentkit/core/engine.py,sha256=mq8M4UCLu0POcXqr3B2CDnX4insA7qrW2K4YC_RCKr8,36679
21
+ intentkit/core/engine.py,sha256=c5EJp2uxseSv5CLCEAH1UPgqLw6d2C_KlJzOQxSyrM4,36025
22
22
  intentkit/core/node.py,sha256=7h9zgDSd928bzUi3m3EZnKkhbwqlbRAQUr_uz7gKB5Y,8880
23
- intentkit/core/prompt.py,sha256=clZmH9Ryn7cUwi6lQADEH9-AupT4V4NLMaUCzOoFHS4,15899
24
- intentkit/core/skill.py,sha256=vPK37sDRT9kzkMBymPwqZ5uEdxTTRtb_DfREIeyz-Xw,5788
25
- intentkit/models/agent.py,sha256=uC5AErdVucaEajKCXAcF6C3VwYRVIhXTIfOBp-n-Xhg,66310
23
+ intentkit/core/prompt.py,sha256=ssiyKHDNIjQOLU0KwUlIFX3jy51TqgeKOxrwnW4HBkw,15875
24
+ intentkit/models/agent.py,sha256=tFBJjH18q0giEEydAH3vT_O4NtvZPXwKXqOoHiPjXsI,60951
26
25
  intentkit/models/agent_data.py,sha256=mVsiK8TziYa1W1ujU1KwI9osIVIeSM7XJEogGRL1WVU,28263
27
- intentkit/models/agent_schema.json,sha256=LeshtNz_JuLWHVNfY74eeh5D-Znweh8IkJ6FEKQjtT4,21248
26
+ intentkit/models/agent_public.json,sha256=0X8Bd2WOobDJLsok8avWNzmzu4uvKSGEyy6Myn53eT4,2802
27
+ intentkit/models/agent_schema.json,sha256=hFGUE57JIiN8V4olgLf2LBXPejA2QLiQoFc6riM1UFo,17139
28
28
  intentkit/models/app_setting.py,sha256=iYbW63QD91bt4oEYV3wOXHuRFav2b4VXLwb_StgUQtQ,8230
29
29
  intentkit/models/base.py,sha256=o-zRjVrak-f5Jokdvj8BjLm8gcC3yYiYMCTLegwT2lA,185
30
30
  intentkit/models/chat.py,sha256=cDccEHU8nd7Y5uhrHDCuZGwqrRwhqCaeztMiZcemiug,20469
31
31
  intentkit/models/conversation.py,sha256=nrbDIw-3GK5BYi_xkI15FLdx4a6SNrFK8wfAGLCsrqk,9032
32
32
  intentkit/models/credit.py,sha256=JQ_ITxOM98XTkllxGDduKGf9-ZF4R-rYixN3OgNvl-Y,52275
33
- intentkit/models/db.py,sha256=nZjp6HlfLAWbMJeUkWrUcvlS4DAS8C_kpl5PzlO7eTc,5060
33
+ intentkit/models/db.py,sha256=1uX1DJZGMx9A3lq6WKSTSwpXhWgWaiki55-iiED8BYM,5082
34
34
  intentkit/models/db_mig.py,sha256=vT6Tanm-BHC2T7dTztuB1UG494EFBAlHADKsNzR6xaQ,3577
35
35
  intentkit/models/generator.py,sha256=lyZu9U9rZUGkqd_QT5SAhay9DY358JJY8EhDSpN8I1M,10298
36
36
  intentkit/models/llm.py,sha256=ZaCuIwoPQ7e_FGCTiwjSpxpLoqBFt-i-MLwRkffNylM,27211
37
37
  intentkit/models/redis.py,sha256=UoN8jqLREO1VO9_w6m-JhldpP19iEHj4TiGVCMutQW4,3702
38
38
  intentkit/models/skill.py,sha256=h_2wtKEbYE29TLsMdaSnjfOv6vXY6GwMU_abw-ONX28,16374
39
- intentkit/models/user.py,sha256=HwDKEto6jY-ISPv7zIgaXiqAi3aD92x3kaYqWpwYubA,9476
39
+ intentkit/models/user.py,sha256=r2UWpuBJbS6bbfS-fz_rAtOTHL3zodRt1rccA7HhAQM,9902
40
40
  intentkit/skills/__init__.py,sha256=WkjmKB4xvy36zyXMroPMf_DTPgQloNS3L73nVnBmuQI,303
41
41
  intentkit/skills/base.py,sha256=2Lw3LpqKPYzsxRlAaSXz5ObG-LQtHfDxsyT4bgPYEhE,5705
42
42
  intentkit/skills/skills.toml,sha256=BCqO6nQVaU3wSpY0Js1xjakLzfttsq6hcHcJbw7q958,2734
@@ -411,14 +411,14 @@ intentkit/skills/xmtp/swap.py,sha256=h3y0cZT0PfoofRRuoYg-1l5iXz5DWza6ltGRFfQrkZQ
411
411
  intentkit/skills/xmtp/transfer.py,sha256=43t1LG9B_8v5cbGH12F68JDsfd90a9_x2KUsJXnSMbE,7916
412
412
  intentkit/skills/xmtp/xmtp.png,sha256=vQzT-71zIb8aPodg-GkGSQbBnjGAPczWGm3es2ZkJe8,6681
413
413
  intentkit/utils/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
414
- intentkit/utils/chain.py,sha256=3GBHuAbXxQr_HlOvkbB2kruYSkweucfxI5u-swXzY40,15135
414
+ intentkit/utils/chain.py,sha256=PubXjJM_kt6NCwzpKm5uXQ596QvKFLfr2L_DP9ntHAs,15162
415
415
  intentkit/utils/error.py,sha256=sDMIQPAlE5igzQKCsyN7BLR1otgErcNm0Uak_Rfl8SI,4755
416
416
  intentkit/utils/logging.py,sha256=bhwZi5vscjBTd9kaNp_L6ijrfv9Sl3lsr4ARaUB4Iec,2389
417
417
  intentkit/utils/random.py,sha256=DymMxu9g0kuQLgJUqalvgksnIeLdS-v0aRk5nQU0mLI,452
418
418
  intentkit/utils/s3.py,sha256=9trQNkKQ5VgxWsewVsV8Y0q_pXzGRvsCYP8xauyUYkg,8549
419
419
  intentkit/utils/slack_alert.py,sha256=s7UpRgyzLW7Pbmt8cKzTJgMA9bm4EP-1rQ5KXayHu6E,2264
420
420
  intentkit/utils/tx.py,sha256=2yLLGuhvfBEY5n_GJ8wmIWLCzn0FsYKv5kRNzw_sLUI,1454
421
- intentkit-0.7.4rc1.dist-info/METADATA,sha256=Y6cilsXx95wyANrU8va8qQrXBFbXBZHfR1ZC3uW18mU,6407
422
- intentkit-0.7.4rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
423
- intentkit-0.7.4rc1.dist-info/licenses/LICENSE,sha256=Bln6DhK-LtcO4aXy-PBcdZv2f24MlJFm_qn222biJtE,1071
424
- intentkit-0.7.4rc1.dist-info/RECORD,,
421
+ intentkit-0.7.4rc3.dist-info/METADATA,sha256=qm4IQmh6s40Wloz4pJUwzgM0JfHqibsSHI21ykAsiOI,6407
422
+ intentkit-0.7.4rc3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
423
+ intentkit-0.7.4rc3.dist-info/licenses/LICENSE,sha256=Bln6DhK-LtcO4aXy-PBcdZv2f24MlJFm_qn222biJtE,1071
424
+ intentkit-0.7.4rc3.dist-info/RECORD,,
intentkit/core/skill.py DELETED
@@ -1,200 +0,0 @@
1
- from typing import Any, Dict, List, Optional
2
-
3
- from intentkit.abstracts.skill import SkillStoreABC
4
- from intentkit.config.config import config
5
- from intentkit.core.agent import (
6
- add_autonomous_task as _add_autonomous_task,
7
- )
8
- from intentkit.core.agent import (
9
- delete_autonomous_task as _delete_autonomous_task,
10
- )
11
- from intentkit.core.agent import (
12
- list_autonomous_tasks as _list_autonomous_tasks,
13
- )
14
- from intentkit.core.agent import (
15
- update_autonomous_task as _update_autonomous_task,
16
- )
17
- from intentkit.models.agent import Agent, AgentAutonomous
18
- from intentkit.models.agent_data import AgentData, AgentQuota
19
- from intentkit.models.skill import (
20
- AgentSkillData,
21
- AgentSkillDataCreate,
22
- ThreadSkillData,
23
- ThreadSkillDataCreate,
24
- )
25
-
26
-
27
- class SkillStore(SkillStoreABC):
28
- """Implementation of skill data storage operations.
29
-
30
- This class provides concrete implementations for storing and retrieving
31
- skill-related data for both agents and threads.
32
- """
33
-
34
- @staticmethod
35
- def get_system_config(key: str) -> Any:
36
- # TODO: maybe need a whitelist here
37
- if hasattr(config, key):
38
- return getattr(config, key)
39
- return None
40
-
41
- @staticmethod
42
- async def get_agent_config(agent_id: str) -> Optional[Agent]:
43
- return await Agent.get(agent_id)
44
-
45
- @staticmethod
46
- async def get_agent_data(agent_id: str) -> AgentData:
47
- return await AgentData.get(agent_id)
48
-
49
- @staticmethod
50
- async def set_agent_data(agent_id: str, data: Dict) -> AgentData:
51
- return await AgentData.patch(agent_id, data)
52
-
53
- @staticmethod
54
- async def get_agent_quota(agent_id: str) -> AgentQuota:
55
- return await AgentQuota.get(agent_id)
56
-
57
- @staticmethod
58
- async def get_agent_skill_data(
59
- agent_id: str, skill: str, key: str
60
- ) -> Optional[Dict[str, Any]]:
61
- """Get skill data for an agent.
62
-
63
- Args:
64
- agent_id: ID of the agent
65
- skill: Name of the skill
66
- key: Data key
67
-
68
- Returns:
69
- Dictionary containing the skill data if found, None otherwise
70
- """
71
- return await AgentSkillData.get(agent_id, skill, key)
72
-
73
- @staticmethod
74
- async def save_agent_skill_data(
75
- agent_id: str, skill: str, key: str, data: Dict[str, Any]
76
- ) -> None:
77
- """Save or update skill data for an agent.
78
-
79
- Args:
80
- agent_id: ID of the agent
81
- skill: Name of the skill
82
- key: Data key
83
- data: JSON data to store
84
- """
85
- skill_data = AgentSkillDataCreate(
86
- agent_id=agent_id,
87
- skill=skill,
88
- key=key,
89
- data=data,
90
- )
91
- await skill_data.save()
92
-
93
- @staticmethod
94
- async def delete_agent_skill_data(agent_id: str, skill: str, key: str) -> None:
95
- """Delete skill data for an agent.
96
-
97
- Args:
98
- agent_id: ID of the agent
99
- skill: Name of the skill
100
- key: Data key
101
- """
102
- await AgentSkillData.delete(agent_id, skill, key)
103
-
104
- @staticmethod
105
- async def get_thread_skill_data(
106
- thread_id: str, skill: str, key: str
107
- ) -> Optional[Dict[str, Any]]:
108
- """Get skill data for a thread.
109
-
110
- Args:
111
- thread_id: ID of the thread
112
- skill: Name of the skill
113
- key: Data key
114
-
115
- Returns:
116
- Dictionary containing the skill data if found, None otherwise
117
- """
118
- return await ThreadSkillData.get(thread_id, skill, key)
119
-
120
- @staticmethod
121
- async def save_thread_skill_data(
122
- thread_id: str,
123
- agent_id: str,
124
- skill: str,
125
- key: str,
126
- data: Dict[str, Any],
127
- ) -> None:
128
- """Save or update skill data for a thread.
129
-
130
- Args:
131
- thread_id: ID of the thread
132
- agent_id: ID of the agent that owns this thread
133
- skill: Name of the skill
134
- key: Data key
135
- data: JSON data to store
136
- """
137
- skill_data = ThreadSkillDataCreate(
138
- thread_id=thread_id,
139
- agent_id=agent_id,
140
- skill=skill,
141
- key=key,
142
- data=data,
143
- )
144
- await skill_data.save()
145
-
146
- @staticmethod
147
- async def list_autonomous_tasks(agent_id: str) -> List[AgentAutonomous]:
148
- """List all autonomous tasks for an agent.
149
-
150
- Args:
151
- agent_id: ID of the agent
152
-
153
- Returns:
154
- List[AgentAutonomous]: List of autonomous task configurations
155
- """
156
- return await _list_autonomous_tasks(agent_id)
157
-
158
- @staticmethod
159
- async def add_autonomous_task(
160
- agent_id: str, task: AgentAutonomous
161
- ) -> AgentAutonomous:
162
- """Add a new autonomous task to an agent.
163
-
164
- Args:
165
- agent_id: ID of the agent
166
- task: Autonomous task configuration
167
-
168
- Returns:
169
- AgentAutonomous: The created task
170
- """
171
- return await _add_autonomous_task(agent_id, task)
172
-
173
- @staticmethod
174
- async def delete_autonomous_task(agent_id: str, task_id: str) -> None:
175
- """Delete an autonomous task from an agent.
176
-
177
- Args:
178
- agent_id: ID of the agent
179
- task_id: ID of the task to delete
180
- """
181
- await _delete_autonomous_task(agent_id, task_id)
182
-
183
- @staticmethod
184
- async def update_autonomous_task(
185
- agent_id: str, task_id: str, task_updates: dict
186
- ) -> AgentAutonomous:
187
- """Update an autonomous task for an agent.
188
-
189
- Args:
190
- agent_id: ID of the agent
191
- task_id: ID of the task to update
192
- task_updates: Dictionary containing fields to update
193
-
194
- Returns:
195
- AgentAutonomous: The updated task
196
- """
197
- return await _update_autonomous_task(agent_id, task_id, task_updates)
198
-
199
-
200
- skill_store = SkillStore()