Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion aws_doc_sdk_examples_tools/agent/bin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from aws_doc_sdk_examples_tools.agent.make_prompts import main as make_prompts
from aws_doc_sdk_examples_tools.agent.parse_json_files import main as parse_json_files
from aws_doc_sdk_examples_tools.agent.update_doc_gen import main as update_doc_gen
from aws_doc_sdk_examples_tools.yaml_writer import prepare_write, write_many

app = typer.Typer()

Expand All @@ -32,7 +33,11 @@ def update(iam_tributary_root: str, system_prompts: List[str] = []) -> None:
run(["npx", "@ailly/cli", "--root", AILLY_DIR])
file_paths = get_ailly_files(AILLY_DIR_PATH)
parse_json_files(file_paths=file_paths, out=IAM_UPDATES_PATH)
update_doc_gen(doc_gen_root=doc_gen_root, iam_updates_path=IAM_UPDATES_PATH)
doc_gen = update_doc_gen(
doc_gen_root=doc_gen_root, iam_updates_path=IAM_UPDATES_PATH
)
writes = prepare_write(doc_gen.examples)
write_many(doc_gen_root, writes)


if __name__ == "__main__":
Expand Down
13 changes: 2 additions & 11 deletions aws_doc_sdk_examples_tools/agent/update_doc_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,8 @@ def update_examples(doc_gen: DocGen, examples: Iterable[Example]) -> None:
logger.warning(f"Could not find example with id: {example.id}")


def main(doc_gen_root: Path, iam_updates_path: Path) -> None:
def main(doc_gen_root: Path, iam_updates_path: Path) -> DocGen:
doc_gen = DocGen.from_root(doc_gen_root)
examples = examples_from_updates(iam_updates_path)
update_examples(doc_gen, examples)
print(
[
{
"title": ex.title,
"title_abbrev": ex.title_abbrev,
"synopsis": ex.synopsis,
}
for _, ex in doc_gen.examples.items()
]
)
return doc_gen