Skip to content

Commit caf25c0

Browse files
committed
feat: initialize documentation directory
1 parent ad64318 commit caf25c0

File tree

3 files changed

+61
-3
lines changed

3 files changed

+61
-3
lines changed

src/rai_whoami/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ This embodiment info is then used to create a system prompt for LLM-based agents
2323

2424
### Directory Structure
2525

26-
Prepare your robot documentation directory as follows:
26+
Initialize the documentation directory:
27+
28+
```bash
29+
initialize-docs documentation_dir
30+
```
31+
32+
Populate your robot documentation directory:
2733

2834
```
2935
documentation_dir/
@@ -37,7 +43,7 @@ documentation_dir/
3743
To generate the system prompt from your documentation directory:
3844

3945
```bash
40-
python src/rai_whoami/rai_whoami/build_whoami.py documentation_dir [--output_dir output_dir] [--build-vector-db]
46+
build-whoami documentation_dir [--output_dir output_dir] [--build-vector-db]
4147
```
4248

4349
Generated files will be saved in the `output_dir / generated` directory or `documentation_dir / generated` if not specified.

src/rai_whoami/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "rai_whoami"
3-
version = "0.0.4"
3+
version = "0.0.5"
44
description = "Package to extract embodiment information from robot documentation"
55
authors = ["Maciej Majek <[email protected]>"]
66
readme = "README.md"
@@ -24,6 +24,7 @@ pypdf = "^5.4.0"
2424

2525
[tool.poetry.scripts]
2626
build-whoami = "rai_whoami.build_whoami:main"
27+
initialize-docs = "rai_whoami.initialize_docs_directory:main"
2728

2829

2930
[build-system]
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (C) 2025 Robotec.AI
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import argparse
16+
import os
17+
from pathlib import Path
18+
19+
SUBDIRECTORIES = [
20+
"images",
21+
"documentation",
22+
"urdf",
23+
]
24+
25+
26+
def initialize_docs_directory(args: argparse.Namespace) -> None:
27+
documentation_dir = Path(args.documentation_dir)
28+
if os.path.exists(documentation_dir):
29+
print(
30+
f"Directory {documentation_dir} already exists. Remove it or use different folder."
31+
)
32+
return
33+
34+
os.makedirs(documentation_dir)
35+
print(f"Initialized documentation directory at {documentation_dir}")
36+
for subdirectory in SUBDIRECTORIES:
37+
os.makedirs(documentation_dir / subdirectory)
38+
print(
39+
f"Initialized subdirectory {subdirectory} at {documentation_dir / subdirectory}"
40+
)
41+
42+
43+
def main():
44+
parser = argparse.ArgumentParser()
45+
parser.add_argument("documentation_dir", type=Path)
46+
args = parser.parse_args()
47+
initialize_docs_directory(args)
48+
49+
50+
if __name__ == "__main__":
51+
main()

0 commit comments

Comments
 (0)