Spaces:
Sleeping
Sleeping
| from pptx import Presentation | |
| from pptx.util import Inches, Pt | |
| from pptx.enum.text import PP_ALIGN | |
| SLIDES = [ | |
| { | |
| "title": "Agentic Feature 1: Consistent Output Control", | |
| "bullets": [ | |
| "Standardize outputs for reliable downstream use", | |
| "Use stable dict/array shapes across success/empty/error", | |
| "Examples: search_pubmed (articles list), retrieve_guidelines (fixed keys), generate_flash_cards (full set)" | |
| ], | |
| "notes": ( | |
| "Consistent structures make orchestration predictable. " | |
| "Point to tools/pubmed_search.py, tools/retrieve_guidelines.py, tools/generate_flash_cards.py." | |
| ) | |
| }, | |
| { | |
| "title": "Agentic Feature 2: Input Control via Missing Fields", | |
| "bullets": [ | |
| "Validate inputs; return missing_fields + actionable message", | |
| "Phase-1 discovery prompts user/agent for what's needed", | |
| "Examples: IPC_reporting (jurisdiction/city_state), NHSN_criteria_evaluator (required_fields)" | |
| ], | |
| "notes": ( | |
| "Show how IPC_reporting and NHSN_criteria_evaluator guide the user/agent stepwise. " | |
| "Refs: tools/ipc_reporting.py, tools/nhsn_criteria_evaluator.py." | |
| ) | |
| }, | |
| { | |
| "title": "Agentic Feature 3: Dynamic Input Schemas (KB & Internet)", | |
| "bullets": [ | |
| "KB-driven schemas: history_taking builds args dynamically per syndrome", | |
| "Internet-driven discovery: IPC_reporting finds jurisdiction requirements", | |
| "Tailors data collection without code changes" | |
| ], | |
| "notes": ( | |
| "Refs: tools/history_taking.py uses consult_kb_stepwise.json; IPC_reporting searches web for current fields." | |
| ) | |
| }, | |
| { | |
| "title": "Agentic Feature 4: Multistep Execution", | |
| "bullets": [ | |
| "Two-phase tools: discover β complete (NHSN/IPC)", | |
| "Iterative research β report β slides (create_educational_presentation)", | |
| "Blueprint β draft/critique/enhance (generate_board_exam_question)" | |
| ], | |
| "notes": ( | |
| "Emphasize inspectable intermediates and fallbacks/timeouts. " | |
| "Refs: tools/create_educational_presentation.py, tools/generate_board_exam_question.py." | |
| ) | |
| }, | |
| { | |
| "title": "Agentic Feature 5: API Calls (NCBI / Web Search)", | |
| "bullets": [ | |
| "PubMed: ESearch β ESummary with NCBI_EMAIL/API_KEY support", | |
| "Serper web search with retries/backoff and normalized output", | |
| "Env: SERPER_API_KEY, NCBI_EMAIL (+ NCBI_API_KEY)" | |
| ], | |
| "notes": ( | |
| "Refs: tools/pubmed_search.py, tools/internet_search.py. Show the normalized outputs and env keys." | |
| ) | |
| } | |
| ] | |
| def add_title_and_bullets(slide, title, bullets): | |
| title_shape = slide.shapes.title | |
| title_shape.text = title | |
| # Add a bullet text frame | |
| body = slide.shapes.placeholders[1] | |
| tf = body.text_frame | |
| tf.clear() | |
| for i, bullet in enumerate(bullets): | |
| p = tf.add_paragraph() if i > 0 else tf.paragraphs[0] | |
| p.text = bullet | |
| p.font.size = Pt(18) | |
| p.level = 0 | |
| def add_speaker_notes(slide, notes_text): | |
| notes_slide = slide.notes_slide | |
| notes_tf = notes_slide.notes_text_frame | |
| notes_tf.text = notes_text | |
| def build_pptx(output_path: str): | |
| prs = Presentation() | |
| # Use the default Title and Content layout for all slides | |
| layout = prs.slide_layouts[1] | |
| for s in SLIDES: | |
| slide = prs.slides.add_slide(layout) | |
| add_title_and_bullets(slide, s["title"], s["bullets"]) | |
| add_speaker_notes(slide, s["notes"]) | |
| prs.save(output_path) | |
| if __name__ == "__main__": | |
| import os | |
| out_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "docs") | |
| os.makedirs(out_dir, exist_ok=True) | |
| out_path = os.path.join(out_dir, "Agentic_Features_Tools.pptx") | |
| build_pptx(out_path) | |
| print(f"Wrote {out_path}") | |