langchain-skilllite 0.1.0__py3-none-any.whl → 0.1.2__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.
- langchain_skilllite/_version.py +1 -1
- langchain_skilllite/tools.py +39 -3
- {langchain_skilllite-0.1.0.dist-info → langchain_skilllite-0.1.2.dist-info}/METADATA +1 -1
- langchain_skilllite-0.1.2.dist-info/RECORD +9 -0
- langchain_skilllite-0.1.0.dist-info/RECORD +0 -9
- {langchain_skilllite-0.1.0.dist-info → langchain_skilllite-0.1.2.dist-info}/WHEEL +0 -0
- {langchain_skilllite-0.1.0.dist-info → langchain_skilllite-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {langchain_skilllite-0.1.0.dist-info → langchain_skilllite-0.1.2.dist-info}/top_level.txt +0 -0
langchain_skilllite/_version.py
CHANGED
langchain_skilllite/tools.py
CHANGED
|
@@ -9,6 +9,7 @@ from __future__ import annotations
|
|
|
9
9
|
|
|
10
10
|
import asyncio
|
|
11
11
|
import hashlib
|
|
12
|
+
import json
|
|
12
13
|
import os
|
|
13
14
|
import time
|
|
14
15
|
import uuid
|
|
@@ -28,6 +29,9 @@ from skilllite import SkillManager, SkillInfo
|
|
|
28
29
|
if TYPE_CHECKING:
|
|
29
30
|
from pathlib import Path
|
|
30
31
|
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
31
35
|
# Type aliases for confirmation callbacks
|
|
32
36
|
ConfirmationCallback = Callable[[str, str], bool]
|
|
33
37
|
AsyncConfirmationCallback = Callable[[str, str], "asyncio.Future[bool]"]
|
|
@@ -279,6 +283,11 @@ class SkillLiteTool(BaseTool):
|
|
|
279
283
|
skip_skillbox_confirmation = False
|
|
280
284
|
old_sandbox_level = None
|
|
281
285
|
|
|
286
|
+
# Handle LangChain's default behavior when args_schema is None
|
|
287
|
+
# LangChain may wrap arguments in {'kwargs': {...}} format
|
|
288
|
+
if len(kwargs) == 1 and 'kwargs' in kwargs and isinstance(kwargs['kwargs'], dict):
|
|
289
|
+
kwargs = kwargs['kwargs']
|
|
290
|
+
|
|
282
291
|
try:
|
|
283
292
|
# Security scan for sandbox level 3
|
|
284
293
|
if self.sandbox_level >= 3:
|
|
@@ -322,7 +331,14 @@ class SkillLiteTool(BaseTool):
|
|
|
322
331
|
timeout=self.timeout
|
|
323
332
|
)
|
|
324
333
|
if result.success:
|
|
325
|
-
|
|
334
|
+
output = result.output
|
|
335
|
+
if output is None:
|
|
336
|
+
return "Execution completed successfully"
|
|
337
|
+
elif isinstance(output, str):
|
|
338
|
+
return output
|
|
339
|
+
else:
|
|
340
|
+
# Convert dict to JSON string for LangChain
|
|
341
|
+
return json.dumps(output, ensure_ascii=False)
|
|
326
342
|
else:
|
|
327
343
|
return f"Error: {result.error}"
|
|
328
344
|
except Exception as e:
|
|
@@ -343,6 +359,11 @@ class SkillLiteTool(BaseTool):
|
|
|
343
359
|
skip_skillbox_confirmation = False
|
|
344
360
|
old_sandbox_level = None
|
|
345
361
|
|
|
362
|
+
# Handle LangChain's default behavior when args_schema is None
|
|
363
|
+
# LangChain may wrap arguments in {'kwargs': {...}} format
|
|
364
|
+
if len(kwargs) == 1 and 'kwargs' in kwargs and isinstance(kwargs['kwargs'], dict):
|
|
365
|
+
kwargs = kwargs['kwargs']
|
|
366
|
+
|
|
346
367
|
try:
|
|
347
368
|
if self.sandbox_level >= 3:
|
|
348
369
|
# Check if already confirmed in this session
|
|
@@ -387,7 +408,14 @@ class SkillLiteTool(BaseTool):
|
|
|
387
408
|
self.timeout
|
|
388
409
|
)
|
|
389
410
|
if result.success:
|
|
390
|
-
|
|
411
|
+
output = result.output
|
|
412
|
+
if output is None:
|
|
413
|
+
return "Execution completed successfully"
|
|
414
|
+
elif isinstance(output, str):
|
|
415
|
+
return output
|
|
416
|
+
else:
|
|
417
|
+
# Convert dict to JSON string for LangChain
|
|
418
|
+
return json.dumps(output, ensure_ascii=False)
|
|
391
419
|
else:
|
|
392
420
|
return f"Error: {result.error}"
|
|
393
421
|
except Exception as e:
|
|
@@ -471,10 +499,18 @@ class SkillLiteToolkit:
|
|
|
471
499
|
if skill_names and skill.name not in skill_names:
|
|
472
500
|
continue
|
|
473
501
|
|
|
502
|
+
# Follow Agent Skills spec: put full SKILL.md content in description
|
|
503
|
+
# Let LLM infer parameters from the complete skill documentation
|
|
504
|
+
description = skill.description or f"Execute the {skill.name} skill"
|
|
505
|
+
if hasattr(skill, 'get_full_content'):
|
|
506
|
+
full_content = skill.get_full_content()
|
|
507
|
+
if full_content:
|
|
508
|
+
description = full_content
|
|
509
|
+
|
|
474
510
|
# Create tool with security confirmation support
|
|
475
511
|
tool = SkillLiteTool(
|
|
476
512
|
name=skill.name,
|
|
477
|
-
description=
|
|
513
|
+
description=description,
|
|
478
514
|
manager=manager,
|
|
479
515
|
skill_name=skill.name,
|
|
480
516
|
allow_network=allow_network,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
langchain_skilllite/__init__.py,sha256=pkzWP7nP7A_hRsfl0TbgA65WWq-UpMMBCyy4VLslD8Q,1461
|
|
2
|
+
langchain_skilllite/_version.py,sha256=5e9XZ2iMOpbdIFsfjmyhyeHg5wt5UYVp7X0yfqcaIbI,75
|
|
3
|
+
langchain_skilllite/callbacks.py,sha256=L-_Qguh_R1jd7Qtx_QN0kaFE5wX7t-9USOoUNaUug6k,5254
|
|
4
|
+
langchain_skilllite/tools.py,sha256=AvQ-D2Vkj9LtLZXLCR1TCmHIxpMBp8aJmcVakKTairQ,22442
|
|
5
|
+
langchain_skilllite-0.1.2.dist-info/licenses/LICENSE,sha256=HcK5iz9Y3FKj6oiQH6Q0tx1fYDXhKqkrCUUM8XRngRk,1072
|
|
6
|
+
langchain_skilllite-0.1.2.dist-info/METADATA,sha256=9o0EuKOuyk4r-gb1WEAczttsujwTnVelVZwkUGmjyfM,6077
|
|
7
|
+
langchain_skilllite-0.1.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
8
|
+
langchain_skilllite-0.1.2.dist-info/top_level.txt,sha256=XmA85AHn71wM124Kssl3hQRQElz3JJuDUjtuLJlL7nE,20
|
|
9
|
+
langchain_skilllite-0.1.2.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
langchain_skilllite/__init__.py,sha256=pkzWP7nP7A_hRsfl0TbgA65WWq-UpMMBCyy4VLslD8Q,1461
|
|
2
|
-
langchain_skilllite/_version.py,sha256=UluS3ysGlayfko8ludKoiC9cT8bp9A2iMfbL6sP5VqQ,75
|
|
3
|
-
langchain_skilllite/callbacks.py,sha256=L-_Qguh_R1jd7Qtx_QN0kaFE5wX7t-9USOoUNaUug6k,5254
|
|
4
|
-
langchain_skilllite/tools.py,sha256=2OBxA2GwNAwnQzYAUmV63FkmI6qB7-r36_LagtVu27E,20921
|
|
5
|
-
langchain_skilllite-0.1.0.dist-info/licenses/LICENSE,sha256=HcK5iz9Y3FKj6oiQH6Q0tx1fYDXhKqkrCUUM8XRngRk,1072
|
|
6
|
-
langchain_skilllite-0.1.0.dist-info/METADATA,sha256=icBeT2u8kwcdN-naTw5zlvaBdsxzD7cdoWzvUjMke84,6077
|
|
7
|
-
langchain_skilllite-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
8
|
-
langchain_skilllite-0.1.0.dist-info/top_level.txt,sha256=XmA85AHn71wM124Kssl3hQRQElz3JJuDUjtuLJlL7nE,20
|
|
9
|
-
langchain_skilllite-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
{langchain_skilllite-0.1.0.dist-info → langchain_skilllite-0.1.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|