Document Summarizer Agent
Source:vignettes/document-summarizer-agent.Rmd
document-summarizer-agent.RmdWhat This Agent Does
build_doc_summarizer_agent() summarizes documents (PDF,
DOCX, PPTX, TXT, or plain text) into structured output.
Generate Mermaid PNGs
library(LLMAgentR)
my_llm_wrapper <- function(prompt, verbose = FALSE) "LLM response placeholder"
workflow <- build_doc_summarizer_agent(
llm = my_llm_wrapper,
output = "both",
direction = "LR"
)
save_mermaid_png(
x = workflow,
file = "pkgdown/assets/document-summarizer-agent-workflow.png"
)Step 1: Build the Summarizer
library(LLMAgentR)
my_llm_wrapper <- function(prompt, verbose = FALSE) "LLM response placeholder"
summarizer <- build_doc_summarizer_agent(
llm = my_llm_wrapper,
chunk_size = 4000,
overlap = 200,
verbose = FALSE
)Step 2: Summarize Input
result <- summarizer("This is a short policy document about customer support SLAs.")
str(result)