file-processor
workflowv1.0.0Single-shot document summarizer that reads a file from --file, stdin, or KDEPS_FILE_PATH and returns a structured summary.
Install
kdeps registry install file-processor
Then run locally:
kdeps exec file-processor
Configure LLM provider in ~/.kdeps/config.yaml (created automatically on first run).
README
file-processor
Demonstrates the file input source - a single-shot workflow that reads a document from a file and returns a structured AI analysis.
Structure
file-processor/
├── workflow.yaml
└── resources/
├── 01-read-file.yaml # expose file metadata
├── 02-summarize.yaml # LLM summarization
└── 03-response.yaml # structured JSON output
Usage
# Pass a file path via --file flag (highest priority)
kdeps run examples/file-processor --file /path/to/document.txt
# Pipe content via stdin
cat document.txt | kdeps run examples/file-processor
# Use an environment variable
KDEPS_FILE_PATH=/tmp/doc.txt kdeps run examples/file-processor
# Pipe JSON with inline content
echo '{"path":"/tmp/doc.txt","content":"Your text here"}' | kdeps run examples/file-processor
Requirements
- Ollama running locally with
llama3.2installed (ollama pull llama3.2)
Input Resolution Priority
--file <path>CLI argument- stdin (raw text or JSON
{"path":"...","content":"..."}) KDEPS_FILE_PATHenvironment variableinput.file.pathconfig field
Accessing File Data
Inside resources, use the input() expression:
| Expression | Value |
|---|---|
input('fileContent') | The file's text content |
input('filePath') | The source file path |
input('content') | Alias for fileContent |
input('path') | Alias for filePath |
The file Source
settings:
input:
sources: [file]
file:
path: "" # optional default path; override via --file or stdin
The workflow runs once and exits after processing the file.
Sample Output
{
"file": "/path/to/document.txt",
"analysis": {
"title": "Introduction to Machine Learning",
"summary": "This document covers the fundamentals of ML...",
"key_points": [
"Supervised learning uses labeled training data",
"Neural networks are inspired by the human brain",
"Regularization prevents overfitting"
]
}
}
Validate
kdeps validate examples/file-processor
Versions
| Version | Published | Status |
|---|---|---|
| 1.0.0 | 4/11/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 1.0.0
- Published
- 4/11/2026
Tags
filesummarizer