Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

operations: nlp: tools: dffml docs: write paper: Markdown saved to file at end of run #1555

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
19 changes: 16 additions & 3 deletions operations/nlp/dffml_operations_nlp/tools/dffml_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class WritePaperSectionContent(BaseModel):
)
text: str = Field(
json_schema_extra={
"description": "The content for this section. This should be at least 500 words",
"description": "The content for this section. This should be at least 1000 words. Please include mermaid diagrams to illustrate points when you think necessary",
}
)
comments: str = Field(
Expand Down Expand Up @@ -187,8 +187,6 @@ def generate_markdown(write_paper_model: WritePaper):

rich_console.print(rich.markdown.Markdown(markdown_content))

sys.exit(0)


# with open("WritePaper.schema.json", "wt") as fileobj:
# print(json.dumps(WritePaperSection.model_json_schema(), indent=4,
Expand Down Expand Up @@ -874,6 +872,21 @@ def do_llm_call(prompt):

data_path.write_text(write_paper.model_dump_json())

write_paper_instance = write_paper

# Generate Markdown content
markdown_content = generate_markdown(write_paper_instance)

md_path.write_text(markdown_content)

# Print or save the markdown content
import rich.console
import rich.markdown

rich_console = rich.console.Console(width=80)

rich_console.print(rich.markdown.Markdown(markdown_content))

print()

sys.exit(0)
Expand Down
Loading