Skip to content

Document Processing

ToolFront supports data retrieval from various document formats with unified processing patterns.


Connecting a Document

ToolFront all major text-based documents.

1
2
3
4
5
from toolfront import Document

# Research paper or report
doc = Document("research_paper.pdf")
authors = doc.ask("Who are the authors?")
1
2
3
4
5
from toolfront import Document

# Contract or document
doc = Document("contract.docx")
terms = doc.ask("What are the key terms?")
1
2
3
4
5
from toolfront import Document

# Business presentation
doc = Document("presentation.pptx")
summary = doc.ask("Summarize the key points")
1
2
3
4
5
from toolfront import Document

# Configuration or data file
doc = Document("config.json")
settings = doc.ask("What are the main settings?")
1
2
3
4
5
from toolfront import Document

# Markdown documentation
doc = Document("README.md")
instructions = doc.ask("How do I install this?")
1
2
3
4
5
from toolfront import Document

# Plain text file
doc = Document("notes.txt")
key_points = doc.ask("Extract the key points")
1
2
3
4
5
from toolfront import Document

# Web page or report
doc = Document("report.html")
metrics = doc.ask("Extract performance metrics")

Text Input

Process text content without files for quick analysis:

1
2
3
4
5
6
7
8
9
from toolfront import Document

# Direct text processing
text_content = """
Company quarterly report shows 15% growth in revenue.
Sales increased across all regions with Europe leading at 22%.
"""
doc = Document(text=text_content)
metrics = doc.ask("Extract the key metrics")