toolslm 0.3.10__py3-none-any.whl → 0.3.11__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.
- toolslm/__init__.py +1 -1
- toolslm/funccall.py +6 -5
- {toolslm-0.3.10.dist-info → toolslm-0.3.11.dist-info}/METADATA +1 -1
- toolslm-0.3.11.dist-info/RECORD +13 -0
- toolslm-0.3.10.dist-info/RECORD +0 -13
- {toolslm-0.3.10.dist-info → toolslm-0.3.11.dist-info}/WHEEL +0 -0
- {toolslm-0.3.10.dist-info → toolslm-0.3.11.dist-info}/entry_points.txt +0 -0
- {toolslm-0.3.10.dist-info → toolslm-0.3.11.dist-info}/licenses/LICENSE +0 -0
- {toolslm-0.3.10.dist-info → toolslm-0.3.11.dist-info}/top_level.txt +0 -0
toolslm/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.3.
|
|
1
|
+
__version__ = "0.3.11"
|
toolslm/funccall.py
CHANGED
|
@@ -111,13 +111,13 @@ def _process_property(name, obj, props, req, defs, evalable=False):
|
|
|
111
111
|
p.update(_handle_type(obj.anno, defs))
|
|
112
112
|
|
|
113
113
|
# %% ../01_funccall.ipynb
|
|
114
|
-
def _get_nested_schema(obj, evalable=False):
|
|
114
|
+
def _get_nested_schema(obj, evalable=False, skip_hidden=False):
|
|
115
115
|
"Generate nested JSON schema for a class or function"
|
|
116
116
|
d = docments(obj, full=True)
|
|
117
117
|
props, req, defs = {}, {}, {}
|
|
118
118
|
|
|
119
119
|
for n, o in d.items():
|
|
120
|
-
if n != 'return' and n != 'self':
|
|
120
|
+
if n != 'return' and n != 'self' and not (skip_hidden and n.startswith('_')):
|
|
121
121
|
_process_property(n, o, props, req, defs, evalable=evalable)
|
|
122
122
|
|
|
123
123
|
tkw = {}
|
|
@@ -131,11 +131,12 @@ def _get_nested_schema(obj, evalable=False):
|
|
|
131
131
|
def get_schema(
|
|
132
132
|
f:Union[callable,dict], # Function to get schema for
|
|
133
133
|
pname='input_schema', # Key name for parameters
|
|
134
|
-
evalable=False
|
|
135
|
-
|
|
134
|
+
evalable=False, # stringify defaults that can't be literal_eval'd?
|
|
135
|
+
skip_hidden=False # skip parameters starting with '_'?
|
|
136
|
+
)->dict: # {'name':..., 'description':..., pname:...}
|
|
136
137
|
"Generate JSON schema for a class, function, or method"
|
|
137
138
|
if isinstance(f, dict): return f
|
|
138
|
-
schema = _get_nested_schema(f, evalable=evalable)
|
|
139
|
+
schema = _get_nested_schema(f, evalable=evalable, skip_hidden=skip_hidden)
|
|
139
140
|
desc = f.__doc__
|
|
140
141
|
assert desc, "Docstring missing!"
|
|
141
142
|
d = docments(f, full=True)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
toolslm/__init__.py,sha256=TESjMH0a_iUkwdfWT4nyzKizSFmmCY2omxnS2XyT97Y,23
|
|
2
|
+
toolslm/_modidx.py,sha256=kpgsDpj-Tvn90wezrHaMttyzhNcyNVgw_dQgK10qotI,5308
|
|
3
|
+
toolslm/download.py,sha256=g3BxUSxylC_575M7RFSJ1GI3Co3EwPDdEeWzxaf2Czk,4451
|
|
4
|
+
toolslm/funccall.py,sha256=_5TyhTjWaWLi-eJ96-4P3_faFv6Ft07nO60UjCF-bPU,11160
|
|
5
|
+
toolslm/md_hier.py,sha256=r_NPezhgfxjRmSYFlu_ND42hXt1qSbaPWHTcjbviOn4,11010
|
|
6
|
+
toolslm/shell.py,sha256=dGInuRKvexu21VmtZkw_0S3BGiTsbAongUG-yG4YHpc,1566
|
|
7
|
+
toolslm/xml.py,sha256=tAHoqXrTRiX8i3pR-9KpHoBb8QXJ_TKEVyTEOPviudE,8095
|
|
8
|
+
toolslm-0.3.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
9
|
+
toolslm-0.3.11.dist-info/METADATA,sha256=LrsRNEumsWCi0JnHLTn73b8GoqjwQ3m6mDak4n2h47g,2404
|
|
10
|
+
toolslm-0.3.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
toolslm-0.3.11.dist-info/entry_points.txt,sha256=xFz0Eymlo5X7BGpaO6DI9gMxvN5A7faebzrlr8ctp5I,95
|
|
12
|
+
toolslm-0.3.11.dist-info/top_level.txt,sha256=4hRTrFWayz_Kz5221XjvlpCwVFrW3WPi1P0fllkTq9s,8
|
|
13
|
+
toolslm-0.3.11.dist-info/RECORD,,
|
toolslm-0.3.10.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
toolslm/__init__.py,sha256=h9TycTJK2pK49s87IMbNRq4lTqRt3xctcJl2jxCe3sU,23
|
|
2
|
-
toolslm/_modidx.py,sha256=kpgsDpj-Tvn90wezrHaMttyzhNcyNVgw_dQgK10qotI,5308
|
|
3
|
-
toolslm/download.py,sha256=g3BxUSxylC_575M7RFSJ1GI3Co3EwPDdEeWzxaf2Czk,4451
|
|
4
|
-
toolslm/funccall.py,sha256=KO08GspCaVROb5Z29cxHRz3MaZdTUFj4j08sbbEyUSs,10968
|
|
5
|
-
toolslm/md_hier.py,sha256=r_NPezhgfxjRmSYFlu_ND42hXt1qSbaPWHTcjbviOn4,11010
|
|
6
|
-
toolslm/shell.py,sha256=dGInuRKvexu21VmtZkw_0S3BGiTsbAongUG-yG4YHpc,1566
|
|
7
|
-
toolslm/xml.py,sha256=tAHoqXrTRiX8i3pR-9KpHoBb8QXJ_TKEVyTEOPviudE,8095
|
|
8
|
-
toolslm-0.3.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
9
|
-
toolslm-0.3.10.dist-info/METADATA,sha256=pqfkL4TIn_jnIpuL06aWoCO5WW8k1yorccDYdnHPpfg,2404
|
|
10
|
-
toolslm-0.3.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
-
toolslm-0.3.10.dist-info/entry_points.txt,sha256=xFz0Eymlo5X7BGpaO6DI9gMxvN5A7faebzrlr8ctp5I,95
|
|
12
|
-
toolslm-0.3.10.dist-info/top_level.txt,sha256=4hRTrFWayz_Kz5221XjvlpCwVFrW3WPi1P0fllkTq9s,8
|
|
13
|
-
toolslm-0.3.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|