kader 0.1.3__py3-none-any.whl → 0.1.4__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.
cli/app.py
CHANGED
|
@@ -171,11 +171,15 @@ class KaderApp(App):
|
|
|
171
171
|
self._confirmation_result = (event.confirmed, None)
|
|
172
172
|
|
|
173
173
|
# Remove selector and show result message
|
|
174
|
+
tool_message = None
|
|
174
175
|
if self._inline_selector:
|
|
176
|
+
tool_message = self._inline_selector.message
|
|
175
177
|
self._inline_selector.remove()
|
|
176
178
|
self._inline_selector = None
|
|
177
179
|
|
|
178
180
|
if event.confirmed:
|
|
181
|
+
if tool_message:
|
|
182
|
+
conversation.add_message(tool_message, "assistant")
|
|
179
183
|
conversation.add_message("✅ Executing tool...", "assistant")
|
|
180
184
|
# Restart spinner
|
|
181
185
|
try:
|
kader/agent/base.py
CHANGED
|
@@ -322,7 +322,7 @@ class BaseAgent:
|
|
|
322
322
|
return f"execute {tool_name}"
|
|
323
323
|
|
|
324
324
|
def _confirm_tool_execution(
|
|
325
|
-
self, tool_call_dict: dict
|
|
325
|
+
self, tool_call_dict: dict, llm_content: Optional[str] = None
|
|
326
326
|
) -> tuple[bool, Optional[str]]:
|
|
327
327
|
"""
|
|
328
328
|
Ask user for confirmation before executing a tool.
|
|
@@ -336,6 +336,9 @@ class BaseAgent:
|
|
|
336
336
|
"""
|
|
337
337
|
display_str = self._format_tool_call_for_display(tool_call_dict)
|
|
338
338
|
|
|
339
|
+
if llm_content and len(llm_content) > 0:
|
|
340
|
+
display_str = f"{llm_content}\n\n{display_str}"
|
|
341
|
+
|
|
339
342
|
# Use callback if provided (e.g., for GUI/TUI)
|
|
340
343
|
if self.tool_confirmation_callback:
|
|
341
344
|
return self.tool_confirmation_callback(display_str)
|
|
@@ -357,7 +360,7 @@ class BaseAgent:
|
|
|
357
360
|
print("Please enter 'yes' or 'no'.")
|
|
358
361
|
|
|
359
362
|
async def _aconfirm_tool_execution(
|
|
360
|
-
self, tool_call_dict: dict
|
|
363
|
+
self, tool_call_dict: dict, llm_content: Optional[str] = None
|
|
361
364
|
) -> tuple[bool, Optional[str]]:
|
|
362
365
|
"""
|
|
363
366
|
Async version - Ask user for confirmation before executing a tool.
|
|
@@ -375,7 +378,9 @@ class BaseAgent:
|
|
|
375
378
|
# In production, use asyncio.to_thread or aioconsole
|
|
376
379
|
import asyncio
|
|
377
380
|
|
|
378
|
-
return await asyncio.to_thread(
|
|
381
|
+
return await asyncio.to_thread(
|
|
382
|
+
self._confirm_tool_execution, tool_call_dict, llm_content
|
|
383
|
+
)
|
|
379
384
|
|
|
380
385
|
def _process_tool_calls(
|
|
381
386
|
self, response: LLMResponse
|
|
@@ -396,7 +401,7 @@ class BaseAgent:
|
|
|
396
401
|
# Check for interrupt before tool execution
|
|
397
402
|
if self.interrupt_before_tool:
|
|
398
403
|
should_execute, user_input = self._confirm_tool_execution(
|
|
399
|
-
tool_call_dict
|
|
404
|
+
tool_call_dict, response.content
|
|
400
405
|
)
|
|
401
406
|
if not should_execute:
|
|
402
407
|
# Return the user's elaboration to be processed
|
|
@@ -455,7 +460,7 @@ class BaseAgent:
|
|
|
455
460
|
# Check for interrupt before tool execution
|
|
456
461
|
if self.interrupt_before_tool:
|
|
457
462
|
should_execute, user_input = await self._aconfirm_tool_execution(
|
|
458
|
-
tool_call_dict
|
|
463
|
+
tool_call_dict, response.content
|
|
459
464
|
)
|
|
460
465
|
if not should_execute:
|
|
461
466
|
return (False, user_input)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
cli/README.md,sha256=DY3X7w6LPka1GzhtTrGwhpkFmx0YyRpcTCHjFmti3Yg,4654
|
|
2
2
|
cli/__init__.py,sha256=OAi_KSwcuYXR0sRxKuw1DYQrz1jbu8p7vn41_99f36I,107
|
|
3
3
|
cli/__main__.py,sha256=xO2JVjCsh691b-cjSBAEKocJeUeI3P0gfUqM-f1Mp1A,95
|
|
4
|
-
cli/app.py,sha256=
|
|
4
|
+
cli/app.py,sha256=xRh92l8KA4TbIr-g981_WMyKa0VeSGZ3Eofsvfr2nTE,24987
|
|
5
5
|
cli/app.tcss,sha256=fImM5JxlTCWvD4i3OmpJpBOEE8HGo87Q9E8rKbOKEGU,10416
|
|
6
6
|
cli/utils.py,sha256=GkyVTkIjNsnEEYCVD2l5snQybReXknfg5RihKXWuK4w,1846
|
|
7
7
|
cli/widgets/__init__.py,sha256=1vj31CrJyxZROLthkKr79i_GbNyj8g3q60ZQPbJHK5k,300
|
|
@@ -12,7 +12,7 @@ kader/__init__.py,sha256=QXb0aQvySAiNmhP2kNMNtuuzG_eSUgRVcTRSafko1r0,602
|
|
|
12
12
|
kader/config.py,sha256=B1s1PNgZ5SrFEJU5TtJG-ZAc7Umff4cwyHR7mfQgeLA,4261
|
|
13
13
|
kader/agent/__init__.py,sha256=UJzUw9NIzggCrhIBHC6nJnfzkhCjCZnIzmD6uUn2SNA,159
|
|
14
14
|
kader/agent/agents.py,sha256=lo41hlkPm3CStI9VAwSOR6IYhCBkqQJ48Ego5XN1XU8,4299
|
|
15
|
-
kader/agent/base.py,sha256
|
|
15
|
+
kader/agent/base.py,sha256=-0pzD2IeCLuNSLs6pffxrPllAHjHD-a_i8Pq5dyoRhc,36703
|
|
16
16
|
kader/agent/logger.py,sha256=3vFwz_yycSBU-5mcdalfZ3KBVT9P_20Q-WT5Al8yIXo,5796
|
|
17
17
|
kader/memory/__init__.py,sha256=VUzzhGOWvO_2aYB6uuavmtNI8l94K7H3uPn4_1MVUUs,1473
|
|
18
18
|
kader/memory/conversation.py,sha256=h6Bamd8_rYnk0Bwt4MJWZRfv2wxCcg6eUxPvzP-tIyA,11810
|
|
@@ -39,7 +39,7 @@ kader/tools/rag.py,sha256=37Nd49D5R_DlWmMyhSdSvst_XFOnoxpaFNtlbLEt6qM,15653
|
|
|
39
39
|
kader/tools/todo.py,sha256=omirxoG7_KVHAmMoD12DGmn7scqRaewbI1cqWm0ShUo,7735
|
|
40
40
|
kader/tools/utils.py,sha256=bfq7b1vpA1qBaL_QZYBFTqOM35-omu_UeDjo6v0rxEg,14176
|
|
41
41
|
kader/tools/web.py,sha256=2Aqy0nO7ZwNLAqE9IWjCg5y8qnhbt-AIZOHy02XgbxA,8464
|
|
42
|
-
kader-0.1.
|
|
43
|
-
kader-0.1.
|
|
44
|
-
kader-0.1.
|
|
45
|
-
kader-0.1.
|
|
42
|
+
kader-0.1.4.dist-info/METADATA,sha256=qfivfbam-Ve7_OJW9Mt4nLhCXiRwfm_8kWFyGK-lVSw,9521
|
|
43
|
+
kader-0.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
44
|
+
kader-0.1.4.dist-info/entry_points.txt,sha256=TK0VOtrfDFqZ8JQfxpuAHHvDLHyoiafUjS-VOixl02c,39
|
|
45
|
+
kader-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|