Run setup to create a small score list, a log, a doubling function, and a disposable registered skill. The sections below inspect those live kernel values and installed standard-library objects; they do not read a saved notebook. Compare a signature, a bounded value, a source location, and a short trace.
Tool catalog: live Python
Run setup to create a small score list, a log, a doubling function, and a disposable registered skill. The sections below inspect those live kernel values and installed standard-library objects; they do not read a saved notebook. Compare a signature, a bounded value, a source location, and a short trace.
from nbinlineai.tools import (
search_kernel_names, inspect_python, show_doc, api_names, search_docs, inspect_value, search_value, source_files, list_skills, read_skill, trace_function
)
catalog_scores = [2, 4, 6]
catalog_log ="ready\nno error\nready"defcatalog_double(value: int) ->int:
"""Double a small integer for the trace example."""return value *2# A small, registered pyskill entry point lets both discovery and static reading# show a real installed-style module without inspecting a personal skill.import sys
from pathlib import Path
from tempfile import TemporaryDirectory
catalog_skill_temp = TemporaryDirectory(prefix="nbinlineai-skill-")
catalog_skill_root = Path(catalog_skill_temp.name)
(catalog_skill_root /"nbinlineai_demo_skill.py").write_text(
"\"\"\"Read the score list first; never change the learner's scores.\"\"\"\n""def main():\n return 'Study the three scores.'\n", encoding="utf-8")
catalog_skill_dist = catalog_skill_root /"nbinlineai_demo_skill-1.0.dist-info"
catalog_skill_dist.mkdir()
(catalog_skill_dist /"METADATA").write_text(
"Metadata-Version: 2.1\nName: nbinlineai-demo-skill\nVersion: 1.0\n", encoding="utf-8")
(catalog_skill_dist /"entry_points.txt").write_text(
"[pyskills]\nnbinlineai_demo = nbinlineai_demo_skill:main\n", encoding="utf-8")
sys.path.insert(0, str(catalog_skill_root))
print("Disposable registered skill: nbinlineai_demo")
### Path.read_text
```python
def read_text(
encoding:NoneType=None, errors:NoneType=None
):
```
*Open the file in text mode, read it, and close the file.*
Documentation matches for 'sample':
statistics.covariance: Return the sample covariance of two inputs *x* and *y*. Covariance
statistics.linear_regression: >>> noise = NormalDist().samples(5, seed=42)
statistics.mean: Return the sample arithmetic mean of data.
statistics.pvariance: To estimate the variance from a sample, the ``variance`` function is
statistics.quantiles: The *data* can be any iterable containing sample.
statistics.random: pick random sample
statistics.stdev: Return the square root of the sample variance.
statistics.variance: Return the sample variance of data.
Source files for Path:
/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py
/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/__future__.py
/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/__hello__.py
/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/_aix_support.py
/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/_collections_abc.py
[partial results; narrow the module or limit]
list_skills
print(list_skills(limit=10))
Installed pyskill entry points:
aidialog.dlgskill (aidialog.dlgskill): Read, search, and edit notebook and dialog content through aidialog's `Dialog` and `Message` APIs. Use for cell sources, stored outputs, prompt/reply pairs, and structural message operations.
fastcore.editskill (fastcore.editskill): Text, file, cell, and notebook editing from `fastcore.tools` and `fastcore.nbio`, plus the conventions the whole fastai editing toolkit follows. Read this before working with the editing tools in any package that shares
nbinlineai_demo (nbinlineai_demo_skill): Read the score list first; never change the learner's scores.
pyskills.skill (pyskills.skill): Pyskills are tool modules that Python packages register so you can find them without importing everything. `list_pyskills()` names the ones installed, with a one-line description each, and needs no imports. Load one with
read_skill
print(read_skill("nbinlineai_demo"))
Pyskill nbinlineai_demo_skill:
Read the score list first; never change the learner's scores.
Use &read_skill with module nbinlineai_demo, registered by setup. State its two instructions from the returned source.
Read the score list first.
Never change the learner’s scores.
Observed live tool calls for the answer above (actual subscription events; private fields shortened).
Executed catalog_double once; effects are retained. return 6
call catalog_double:7 def catalog_double(value: int) -> int: | value=3
line catalog_double:9 return value * 2 | value=3
return catalog_double:9 return value * 2 | value=3
Ask AI to inspect the same live data
Each short question names the tools it needs. Read the saved answer to see the returned fact and the tool calls; the values above remain in this kernel.
Use &search_kernel_names to find catalog_scores, then &inspect_value to report its first three values. Use &search_value on catalog_log for ready and state how many matching lines it reports. Base the answer on the tool results.
catalog_scores starts with 2, 4, 6. The search reports 2 matches for ready in catalog_log.
Observed live tool calls for the answer above (actual subscription events; private fields shortened).
“Matches in catalog_log (text, length 20):\n0: ‘ready\nno error\nready’\n15: ‘ready\nno error\nready’”
Use &inspect_python for the signature of catalog_double, then &trace_function with args_json="[3]". State the argument, returned value, and one trace event.
catalog_double(value: int) -> int was called with value=3 and returned 6. One trace event was line catalog_double:9 return value * 2 | value=3.
Observed live tool calls for the answer above (actual subscription events; private fields shortened).
‘Executed catalog_double once; effects are retained. return 6\ncall catalog_double:7 def catalog_double(value: int) -> int: | value=3\nline catalog_double:9 return value * 2 | value=3\nreturn catalog_double:9 return value * 2 | value=3’
Use &show_doc for Path.read_text from pathlib, &api_names for statistics members matching mean, &search_docs for sample in statistics, and &source_files for Path from pathlib. Give one short finding from each actual result.
Path.read_text opens a file in text mode, reads it, then closes it.
statistics exposes mean, fmean, geometric_mean, and harmonic_mean.
The docs describe statistics.mean as returning the sample arithmetic mean.
Path’s source is in pathlib.py.
Observed live tool calls for the answer above (actual subscription events; private fields shortened).
‘### Path.read_text\n\npython\ndef read_text(\n encoding:NoneType=None, errors:NoneType=None\n):\n\n\nOpen the file in text mode, read it, and close the file.’
“Documentation matches for ‘sample’:\nstatistics.covariance: Return the sample covariance of two inputs x and y. Covariance\nstatistics.linear_regression: >>> noise = NormalDist().samples(5, seed=42)\nstatistics.mean: Return the sample arithmetic mean of data.\nstatistics.pvariance: To estimate the variance from a sample, the variance function is\nstatistics.quantiles: The data can be any iterable containing sample.\nstatistics.random: pick random sample\nstatistics.stdev: Return the square root of the sample variance.\nstatistics.variance: Return the sample variance of data.”
‘Source files for Path:\n/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py\n/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/future.py\n/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/hello.py\n/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/_aix_support.py\n/opt/homebrew/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/_collections_abc.py\n[partial results; narrow the module or limit]’
Use &list_skills to find the disposable nbinlineai_demo entry point, then &read_skill with that returned name. State its two instructions without guessing or importing it.
Read the score list first.
Never change the learner’s scores.
Observed live tool calls for the answer above (actual subscription events; private fields shortened).