intentkit 0.6.7.dev2__py3-none-any.whl → 0.6.7.dev4__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/core/agent.py +9 -3
- intentkit/core/engine.py +39 -0
- intentkit/skills/system/add_autonomous_task.py +5 -2
- intentkit/skills/system/delete_autonomous_task.py +1 -1
- intentkit/skills/system/list_autonomous_tasks.py +1 -1
- intentkit/skills/system/schema.json +5 -5
- {intentkit-0.6.7.dev2.dist-info → intentkit-0.6.7.dev4.dist-info}/METADATA +1 -1
- {intentkit-0.6.7.dev2.dist-info → intentkit-0.6.7.dev4.dist-info}/RECORD +11 -11
- {intentkit-0.6.7.dev2.dist-info → intentkit-0.6.7.dev4.dist-info}/WHEEL +0 -0
- {intentkit-0.6.7.dev2.dist-info → intentkit-0.6.7.dev4.dist-info}/licenses/LICENSE +0 -0
intentkit/__init__.py
CHANGED
intentkit/core/agent.py
CHANGED
|
@@ -329,12 +329,15 @@ async def add_autonomous_task(agent_id: str, task: AgentAutonomous) -> AgentAuto
|
|
|
329
329
|
# Add the new task
|
|
330
330
|
current_tasks.append(task)
|
|
331
331
|
|
|
332
|
+
# Convert all AgentAutonomous objects to dictionaries for JSON serialization
|
|
333
|
+
serializable_tasks = [task_item.model_dump() for task_item in current_tasks]
|
|
334
|
+
|
|
332
335
|
# Update the agent in the database
|
|
333
336
|
async with get_session() as session:
|
|
334
337
|
update_stmt = (
|
|
335
338
|
update(AgentTable)
|
|
336
339
|
.where(AgentTable.id == agent_id)
|
|
337
|
-
.values(autonomous=
|
|
340
|
+
.values(autonomous=serializable_tasks)
|
|
338
341
|
)
|
|
339
342
|
await session.execute(update_stmt)
|
|
340
343
|
await session.commit()
|
|
@@ -369,7 +372,7 @@ async def delete_autonomous_task(agent_id: str, task_id: str) -> None:
|
|
|
369
372
|
task_found = False
|
|
370
373
|
updated_tasks = []
|
|
371
374
|
for task_data in current_tasks:
|
|
372
|
-
if
|
|
375
|
+
if task_data.id == task_id:
|
|
373
376
|
task_found = True
|
|
374
377
|
continue
|
|
375
378
|
updated_tasks.append(task_data)
|
|
@@ -379,12 +382,15 @@ async def delete_autonomous_task(agent_id: str, task_id: str) -> None:
|
|
|
379
382
|
404, "TaskNotFound", f"Autonomous task with ID {task_id} not found."
|
|
380
383
|
)
|
|
381
384
|
|
|
385
|
+
# Convert remaining AgentAutonomous objects to dictionaries for JSON serialization
|
|
386
|
+
serializable_tasks = [task_item.model_dump() for task_item in updated_tasks]
|
|
387
|
+
|
|
382
388
|
# Update the agent in the database
|
|
383
389
|
async with get_session() as session:
|
|
384
390
|
update_stmt = (
|
|
385
391
|
update(AgentTable)
|
|
386
392
|
.where(AgentTable.id == agent_id)
|
|
387
|
-
.values(autonomous=
|
|
393
|
+
.values(autonomous=serializable_tasks)
|
|
388
394
|
)
|
|
389
395
|
await session.execute(update_stmt)
|
|
390
396
|
await session.commit()
|
intentkit/core/engine.py
CHANGED
|
@@ -221,6 +221,45 @@ async def create_agent(
|
|
|
221
221
|
):
|
|
222
222
|
entrypoint_prompt = agent.telegram_entrypoint_prompt
|
|
223
223
|
logger.debug("telegram entrypoint prompt added")
|
|
224
|
+
elif entrypoint == AuthorType.TRIGGER.value:
|
|
225
|
+
task_id = (
|
|
226
|
+
config["configurable"]
|
|
227
|
+
.get("chat_id", "")
|
|
228
|
+
.removeprefix("autonomous-")
|
|
229
|
+
)
|
|
230
|
+
# Find the autonomous task by task_id
|
|
231
|
+
autonomous_task = None
|
|
232
|
+
if agent.autonomous:
|
|
233
|
+
for task in agent.autonomous:
|
|
234
|
+
if task.id == task_id:
|
|
235
|
+
autonomous_task = task
|
|
236
|
+
break
|
|
237
|
+
|
|
238
|
+
if autonomous_task:
|
|
239
|
+
# Build detailed task info - always include task_id
|
|
240
|
+
if autonomous_task.name:
|
|
241
|
+
task_info = f"You are running an autonomous task '{autonomous_task.name}' (ID: {task_id})"
|
|
242
|
+
else:
|
|
243
|
+
task_info = (
|
|
244
|
+
f"You are running an autonomous task (ID: {task_id})"
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
# Add description if available
|
|
248
|
+
if autonomous_task.description:
|
|
249
|
+
task_info += f": {autonomous_task.description}"
|
|
250
|
+
|
|
251
|
+
# Add cycle info
|
|
252
|
+
if autonomous_task.minutes:
|
|
253
|
+
task_info += f". This task runs every {autonomous_task.minutes} minute(s)"
|
|
254
|
+
elif autonomous_task.cron:
|
|
255
|
+
task_info += (
|
|
256
|
+
f". This task runs on schedule: {autonomous_task.cron}"
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
entrypoint_prompt = f"{task_info}. "
|
|
260
|
+
else:
|
|
261
|
+
# Fallback if task not found
|
|
262
|
+
entrypoint_prompt = f"You are running an autonomous task. The task id is {task_id}. "
|
|
224
263
|
if entrypoint_prompt:
|
|
225
264
|
entrypoint_prompt = await explain_prompt(entrypoint_prompt)
|
|
226
265
|
final_system_prompt = f"{final_system_prompt}## Entrypoint rules\n\n{entrypoint_prompt}\n\n"
|
|
@@ -45,7 +45,10 @@ class AddAutonomousTask(SystemBaseTool):
|
|
|
45
45
|
description: str = (
|
|
46
46
|
"Add a new autonomous task configuration to the agent. "
|
|
47
47
|
"Allows setting up scheduled operations with custom prompts and intervals. "
|
|
48
|
-
"The minutes and cron fields are mutually exclusive. But you must provide one of them."
|
|
48
|
+
"The minutes and cron fields are mutually exclusive. But you must provide one of them. "
|
|
49
|
+
"If user want to add a condition task, you can add a 5 minutes task to check the condition. "
|
|
50
|
+
"If the user does not explicitly state that the condition task should be executed continuously, "
|
|
51
|
+
"then add in the task prompt that it will delete itself after successful execution."
|
|
49
52
|
)
|
|
50
53
|
args_schema = AddAutonomousTaskInput
|
|
51
54
|
|
|
@@ -75,7 +78,7 @@ class AddAutonomousTask(SystemBaseTool):
|
|
|
75
78
|
AddAutonomousTaskOutput: The created task
|
|
76
79
|
"""
|
|
77
80
|
context = self.context_from_config(config)
|
|
78
|
-
agent_id = context
|
|
81
|
+
agent_id = context.agent_id
|
|
79
82
|
|
|
80
83
|
task = AgentAutonomous(
|
|
81
84
|
name=name,
|
|
@@ -47,7 +47,7 @@ class DeleteAutonomousTask(SystemBaseTool):
|
|
|
47
47
|
DeleteAutonomousTaskOutput: Confirmation of deletion
|
|
48
48
|
"""
|
|
49
49
|
context = self.context_from_config(config)
|
|
50
|
-
agent_id = context
|
|
50
|
+
agent_id = context.agent_id
|
|
51
51
|
|
|
52
52
|
await self.skill_store.delete_autonomous_task(agent_id, task_id)
|
|
53
53
|
|
|
@@ -45,7 +45,7 @@ class ListAutonomousTasks(SystemBaseTool):
|
|
|
45
45
|
ListAutonomousTasksOutput: List of autonomous tasks
|
|
46
46
|
"""
|
|
47
47
|
context = self.context_from_config(config)
|
|
48
|
-
agent_id = context
|
|
48
|
+
agent_id = context.agent_id
|
|
49
49
|
|
|
50
50
|
tasks = await self.skill_store.list_autonomous_tasks(agent_id)
|
|
51
51
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"Agent Owner Only"
|
|
32
32
|
],
|
|
33
33
|
"description": "Retrieve the API key for the agent. If no API key exists, generates and sets a new one.",
|
|
34
|
-
"default": "
|
|
34
|
+
"default": "disabled"
|
|
35
35
|
},
|
|
36
36
|
"regenerate_agent_api_key": {
|
|
37
37
|
"type": "string",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"Agent Owner Only"
|
|
46
46
|
],
|
|
47
47
|
"description": "Generate a new API key for the agent, replacing any existing key.",
|
|
48
|
-
"default": "
|
|
48
|
+
"default": "disabled"
|
|
49
49
|
},
|
|
50
50
|
"list_autonomous_tasks": {
|
|
51
51
|
"type": "string",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"Agent Owner Only"
|
|
60
60
|
],
|
|
61
61
|
"description": "List all autonomous task configurations for the agent.",
|
|
62
|
-
"default": "
|
|
62
|
+
"default": "disabled"
|
|
63
63
|
},
|
|
64
64
|
"add_autonomous_task": {
|
|
65
65
|
"type": "string",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"Agent Owner Only"
|
|
74
74
|
],
|
|
75
75
|
"description": "Add a new autonomous task configuration to the agent.",
|
|
76
|
-
"default": "
|
|
76
|
+
"default": "disabled"
|
|
77
77
|
},
|
|
78
78
|
"delete_autonomous_task": {
|
|
79
79
|
"type": "string",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"Agent Owner Only"
|
|
88
88
|
],
|
|
89
89
|
"description": "Delete an autonomous task configuration from the agent.",
|
|
90
|
-
"default": "
|
|
90
|
+
"default": "disabled"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: intentkit
|
|
3
|
-
Version: 0.6.7.
|
|
3
|
+
Version: 0.6.7.dev4
|
|
4
4
|
Summary: Intent-based AI Agent Platform - Core Package
|
|
5
5
|
Project-URL: Homepage, https://github.com/crestal-network/intentkit
|
|
6
6
|
Project-URL: Repository, https://github.com/crestal-network/intentkit
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
intentkit/__init__.py,sha256=
|
|
1
|
+
intentkit/__init__.py,sha256=wwO0j6U4aBUbh0VDF2uVO4NqXcoV8XJlPDWsyP2rUo0,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
|
|
@@ -13,11 +13,11 @@ intentkit/clients/twitter.py,sha256=Lfa7srHOFnY96SXcElW0jfg7XKS_WliWnXjPZEe6SQc,
|
|
|
13
13
|
intentkit/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
intentkit/config/config.py,sha256=Gn3KXgFyh4u0zmb-Awpu4AxvDFaGDa_5GrFrKBbOAXk,7509
|
|
15
15
|
intentkit/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
intentkit/core/agent.py,sha256=
|
|
16
|
+
intentkit/core/agent.py,sha256=x_Kz3Vk09ZGDfxBf1sh9CINepGdUiovGGlMZEsBynPI,14553
|
|
17
17
|
intentkit/core/api.py,sha256=3GIMJpwduLUSbVPNW6mQVxZncYHH3OlLwdiqFtYtEAE,1208
|
|
18
18
|
intentkit/core/client.py,sha256=rIwtJVVm-7piXtFNDbeykt9vWdNTecgjW0aA3N-lHnM,1495
|
|
19
19
|
intentkit/core/credit.py,sha256=vLT47NlLrGyvSU1OP8dkVXV5_VHqRNSeAK5t1FqSSYs,61742
|
|
20
|
-
intentkit/core/engine.py,sha256=
|
|
20
|
+
intentkit/core/engine.py,sha256=1JJuTSVs3k57M0aKD87Yx4T86Mc2DeefhLDXcHV13fY,42554
|
|
21
21
|
intentkit/core/node.py,sha256=RqAdcR1Fcpgw4k7q9l1Sry8LgcuZWdNxSjOHDcoavCI,9108
|
|
22
22
|
intentkit/core/prompt.py,sha256=RfLhlUktkB2kCr3wfldqq6ZP2l8heZIMc8jVp31KIyQ,3631
|
|
23
23
|
intentkit/core/skill.py,sha256=WMHEN-0uv8IqvALVDkV_a-0wqYeSbtpN_Xg1RSgrNMc,5188
|
|
@@ -292,13 +292,13 @@ intentkit/skills/supabase/supabase.svg,sha256=65_80QCtJiKKV4EAuny_xbOD5JlTONEiq9
|
|
|
292
292
|
intentkit/skills/supabase/update_data.py,sha256=Hbwsoa52GZNTPIhWdR9vj9VlcPRUn_vCMOYDzmMoPsI,4023
|
|
293
293
|
intentkit/skills/supabase/upsert_data.py,sha256=JgKLFPcQkUwnQhqTZojT4Ae53hYULeGEkQ1gxZJEe-c,2538
|
|
294
294
|
intentkit/skills/system/__init__.py,sha256=kVnWjsFinpLzB9pADRzAkP8BvIjmaqJ9sURVFyfXry4,3354
|
|
295
|
-
intentkit/skills/system/add_autonomous_task.py,sha256=
|
|
295
|
+
intentkit/skills/system/add_autonomous_task.py,sha256=Rv5Zmka4fE4MAET2nyY3eQ-gLzt4mxueOMQDBKBwDts,3424
|
|
296
296
|
intentkit/skills/system/base.py,sha256=Sm4lSNgbxwGK5YimnBfwi3Hc8E1EwSMZIXsCJbIPiLM,700
|
|
297
|
-
intentkit/skills/system/delete_autonomous_task.py,sha256=
|
|
298
|
-
intentkit/skills/system/list_autonomous_tasks.py,sha256=
|
|
297
|
+
intentkit/skills/system/delete_autonomous_task.py,sha256=1zChfY3SkWr1V2QFotyitkVLaBsYBtk68qkhyA_qh-A,1741
|
|
298
|
+
intentkit/skills/system/list_autonomous_tasks.py,sha256=QTPL4He3OuNfil_xLwMwL1uoe1lbww-XZxD1837usuo,1496
|
|
299
299
|
intentkit/skills/system/read_agent_api_key.py,sha256=x8DIQwDxZ1MONz4tyN3o6QUf2-2aEjZd4yVOY28-IaU,3410
|
|
300
300
|
intentkit/skills/system/regenerate_agent_api_key.py,sha256=AiFXOEIRxXJRWiDufKCi3_ViyAyK19P1XZOleM1eQUc,3070
|
|
301
|
-
intentkit/skills/system/schema.json,sha256=
|
|
301
|
+
intentkit/skills/system/schema.json,sha256=w5bjnWd6-5dG2irT3w8SJBmdrn7XkUevIgBWuJD9XgM,2686
|
|
302
302
|
intentkit/skills/system/system.svg,sha256=PVbC6r6rOhvht0lB1fcxDNTcbMUa7haHAkJ8rxp7gm0,3740
|
|
303
303
|
intentkit/skills/tavily/README.md,sha256=VagMkuHrS_ge2Sir9M9CoeqmWc_rysKhTO9-LGICQsA,2840
|
|
304
304
|
intentkit/skills/tavily/__init__.py,sha256=PDtH-O3fdAPCc3lGMbgcXKK1fDdkTO1CW-40825FtGU,2386
|
|
@@ -393,7 +393,7 @@ intentkit/utils/random.py,sha256=DymMxu9g0kuQLgJUqalvgksnIeLdS-v0aRk5nQU0mLI,452
|
|
|
393
393
|
intentkit/utils/s3.py,sha256=9trQNkKQ5VgxWsewVsV8Y0q_pXzGRvsCYP8xauyUYkg,8549
|
|
394
394
|
intentkit/utils/slack_alert.py,sha256=s7UpRgyzLW7Pbmt8cKzTJgMA9bm4EP-1rQ5KXayHu6E,2264
|
|
395
395
|
intentkit/utils/tx.py,sha256=2yLLGuhvfBEY5n_GJ8wmIWLCzn0FsYKv5kRNzw_sLUI,1454
|
|
396
|
-
intentkit-0.6.7.
|
|
397
|
-
intentkit-0.6.7.
|
|
398
|
-
intentkit-0.6.7.
|
|
399
|
-
intentkit-0.6.7.
|
|
396
|
+
intentkit-0.6.7.dev4.dist-info/METADATA,sha256=JVvwgqnK28pEsq8qQzO4H60Ve9C7bxy220FXzUgkrI8,6321
|
|
397
|
+
intentkit-0.6.7.dev4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
398
|
+
intentkit-0.6.7.dev4.dist-info/licenses/LICENSE,sha256=Bln6DhK-LtcO4aXy-PBcdZv2f24MlJFm_qn222biJtE,1071
|
|
399
|
+
intentkit-0.6.7.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|