Skip to content

Commit 27cf06f

Browse files
committed
fix: removed namespaces.md generation to docs standalone script
1 parent ccdd745 commit 27cf06f

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

nerve/cli/ns.py renamed to docs/make_ns.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import inspect
22
import pkgutil
33

4+
import nerve.tools.namespaces as namespaces
45

5-
def print_namespaces() -> None:
6-
import nerve.tools.namespaces as namespaces
6+
if __name__ == "__main__":
7+
head = """
8+
# Namespaces
9+
10+
Nerve offers a rich set of predefined tools, organized in namespaces, that the agent can import [via the `using` directive](index.md#usage). This page contains the list of namespaces available in Nerve, with the descriptive prompt that will be provided to the model.
11+
""".strip()
12+
13+
print(head)
14+
print()
715

816
for _, modname, _ in pkgutil.iter_modules(namespaces.__path__):
917
if modname[0] != "_" and not modname.startswith("test_"):

docs/namespaces.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ Provides tools for getting the current date and time and waiting for a given num
5252
| Tool | Description |
5353
|------|-------------|
5454
| `current_time_and_date` | <pre>Get the current date and time.</pre> |
55-
| `wait` | <pre>Wait for a given number of seconds.</pre> |
55+
| `wait` | <pre>Wait for a given number of seconds.</pre> |
56+

nerve/cli/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
DEFAULT_TIMEOUT,
1616
)
1717
from nerve.cli.execute import execute_flow
18-
from nerve.cli.ns import print_namespaces
1918
from nerve.cli.replay import replay
2019
from nerve.generation import conversation
2120
from nerve.runtime import logging
@@ -59,13 +58,6 @@ def version() -> None:
5958
print(f"nerve: {nerve.__version__}")
6059

6160

62-
@cli.command(
63-
help="Print the markdown formatted list of available namespaces.",
64-
)
65-
def ns() -> None:
66-
print_namespaces()
67-
68-
6961
@cli.command(
7062
context_settings={"help_option_names": ["-h", "--help"]},
7163
no_args_is_help=True,

0 commit comments

Comments
 (0)