View source: R/build_doc_summarizer_agent.R
build_doc_summarizer_agent | R Documentation |
Creates an LLM-powered document summarization workflow that processes PDF, DOCX, PPTX, TXT, or plain text input and returns structured markdown summaries.
build_doc_summarizer_agent(
llm,
summary_template = NULL,
chunk_size = 4000,
overlap = 200,
verbose = TRUE
)
llm |
A function that accepts a character prompt and returns an LLM response. |
summary_template |
Optional custom summary template in markdown format. |
chunk_size |
Maximum character length for document chunks (default: 4000). |
overlap |
Character overlap between chunks (default: 200). |
verbose |
Logical controlling progress messages (default: TRUE). |
A function that accepts file paths or text input and returns:
summary - The generated markdown summary
metadata - Document metadata if available
chunks - Number of processing chunks used
success - Logical indicating success
## Not run:
# Build document summarizer agent
summarizer_agent <- build_doc_summarizer_agent(
llm = my_llm_wrapper,
summary_template = NULL,
chunk_size = 4000,
overlap = 200,
verbose = FALSE
)
# Summarize document
final_state <- summarizer_agent("https://github.com/knowusuboaky/LLMAgentR/raw/main/\
tests/testthat/test-data/scrum.docx")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.