Skip to content

Commit 593819c

Browse files
committed
feat: enhance research blueprint output by adding JSON representation and displaying it in CLI
1 parent c550f00 commit 593819c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

pdm.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/compendiumscribe/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def handle_progress(update: ResearchProgress) -> None:
9595
if "section_titles" in meta and meta["section_titles"]:
9696
for title in meta["section_titles"]:
9797
click.echo(f" - {title}")
98+
if "plan_json" in meta and meta["plan_json"]:
99+
click.echo(" Research blueprint JSON:")
100+
click.echo(meta["plan_json"])
98101

99102
try:
100103
config = ResearchConfig(

src/compendiumscribe/research/orchestrator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
from datetime import datetime, timezone
4+
import json
45
from typing import Any, TYPE_CHECKING
56

67
from openai import OpenAI
@@ -75,6 +76,7 @@ def build_compendium(
7576
plan = default_research_plan(normalized_topic)
7677
else:
7778
key_sections = plan.get("key_sections", []) or []
79+
plan_json = json.dumps(plan, indent=2)
7880
emit_progress(
7981
config,
8082
phase="planning",
@@ -88,6 +90,7 @@ def build_compendium(
8890
"section_titles": [
8991
s.get("title") for s in key_sections if s.get("title")
9092
],
93+
"plan_json": plan_json,
9194
},
9295
)
9396

0 commit comments

Comments
 (0)