docs: add MODULE.md + MODULE.de.md inline docs
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1s
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 1s
Documents the fidelity-over-creativity system-prompt stance explicitly — that's the differentiator from a generic LLM 'summarize' call and worth surfacing in the module detail. Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
parent
3422fe526d
commit
0457ae359d
2 changed files with 191 additions and 0 deletions
97
MODULE.de.md
Normal file
97
MODULE.de.md
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
# text.summarize
|
||||
|
||||
Ollama-basierte treue Zusammenfassung. Sendet Quelltext an
|
||||
einen konfigurierten LLM-Endpunkt mit einem Treue-vor-Kreativität-
|
||||
System-Prompt und liefert die Zusammenfassung plus
|
||||
audit-taugliche Modell-Herkunfts-Felder.
|
||||
|
||||
## Capability
|
||||
|
||||
- `text.summarize@0.1.0`
|
||||
|
||||
## Eingaben
|
||||
|
||||
| Name | Typ | Beschreibung |
|
||||
| ----------- | ---- | ---------------------------------------------------------------------------------- |
|
||||
| `text` | text | Quelltext. |
|
||||
| `style` | text | Optionaler Stil-Hinweis (z.B. `one paragraph`, `three bullet points`, `a tweet`). Default: `one paragraph`. |
|
||||
| `language` | text | Optionaler Ziel-Sprache (z.B. `German`, `ja-JP`). Leer = Quellsprache. |
|
||||
| `endpoint` | text | Ollama-förmiger `/api/chat`-Endpunkt. |
|
||||
| `model` | text | Modell-ID am Endpunkt. |
|
||||
| `api_key` | text | Optionaler Bearer-Token für Cloud-Endpunkte. |
|
||||
|
||||
## Ausgaben
|
||||
|
||||
| Name | Typ | Beschreibung |
|
||||
| ---------------- | ---- | ------------------------------------------------------------------ |
|
||||
| `summary` | text | Die Zusammenfassung. |
|
||||
| `style` | text | Echo des Stil-Inputs. |
|
||||
| `language` | text | Echo des Sprach-Inputs. |
|
||||
| `model_endpoint` | text | URL, gegen die zusammengefasst wurde. |
|
||||
| `model_name` | text | Modell-ID wie an die LLM-API gesendet. |
|
||||
| `model_digest` | text | SHA-256-Digest des bedienenden Ollama-Modells (wenn erreichbar). |
|
||||
|
||||
## Treue vor Kreativität
|
||||
|
||||
Der System-Prompt ist so getrimmt, dass die Zusammenfassung
|
||||
aus dem Quelltext herleitbar bleibt — keine Spekulation, kein
|
||||
mitgedachter Kontext, keine „kreativen" Umformulierungen, die
|
||||
abdriften. Geeignet für Compliance-Flows, in denen eine
|
||||
halluzinierte Zusammenfassung schlimmer ist als eine
|
||||
ausführliche. Das Modell behält die Freiheit, die das vom
|
||||
Operator gewählte LLM ihm gibt; dieses Modul ist der Prompt
|
||||
+ Audit-Rahmen, kein fine-tuned Modell.
|
||||
|
||||
## Berechtigungen
|
||||
|
||||
```yaml
|
||||
permissions:
|
||||
- "net: localhost"
|
||||
- "net: 127.0.0.1"
|
||||
- "net: api.openai.com"
|
||||
- "net: api.anthropic.com"
|
||||
```
|
||||
|
||||
Analog `text.translate` — lokales Ollama per Default, Cloud
|
||||
per Operator-Policy zuschaltbar.
|
||||
|
||||
## Grenzen in v0.1.0
|
||||
|
||||
- Single-Shot. Sehr lange Quelltexte (> 32k Tokens je nach
|
||||
Modell) brauchen einen vorgeschalteten Chunker; v0.1.0
|
||||
macht noch keine automatische Chunked-Summarise+Reduce-
|
||||
Pipeline.
|
||||
- Keine strukturierte Ausgabe. `summary` ist Freitext.
|
||||
JSON-formatierte Zusammenfassungen
|
||||
(`{ key_points: [], conclusions: [] }`) sind ein
|
||||
v0.2.0-Kandidat.
|
||||
|
||||
## Beispiel-Flow
|
||||
|
||||
```yaml
|
||||
name: extract-summarise
|
||||
inputs:
|
||||
document: bytes
|
||||
steps:
|
||||
- id: extract
|
||||
use: text.extract@^0
|
||||
with:
|
||||
document: $inputs.document
|
||||
- id: summarise
|
||||
use: text.summarize@^0
|
||||
with:
|
||||
text: $extract.extracted.pages[*].text
|
||||
style: "three bullet points"
|
||||
endpoint: "http://localhost:11434/api/chat"
|
||||
model: "qwen2.5:14b"
|
||||
outputs:
|
||||
summary: $summarise.summary
|
||||
audit_model: $summarise.model_digest
|
||||
```
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
cargo build --release --target wasm32-wasip2
|
||||
# Ausgabe: target/wasm32-wasip2/release/text_summarize.wasm
|
||||
```
|
||||
94
MODULE.md
Normal file
94
MODULE.md
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
# text.summarize
|
||||
|
||||
Ollama-backed faithful summarisation. Sends source text to a
|
||||
configured LLM endpoint with a fidelity-over-creativity system
|
||||
prompt and emits the summary plus audit-grade
|
||||
model-provenance fields.
|
||||
|
||||
## Capability
|
||||
|
||||
- `text.summarize@0.1.0`
|
||||
|
||||
## Inputs
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----------- | ---- | ---------------------------------------------------------------------------- |
|
||||
| `text` | text | Source text to summarise. |
|
||||
| `style` | text | Optional style hint (e.g. `one paragraph`, `three bullet points`, `a tweet`). Default: `one paragraph`. |
|
||||
| `language` | text | Optional output-language hint (e.g. `German`, `ja-JP`). Empty = same as source. |
|
||||
| `endpoint` | text | Ollama-shaped `/api/chat` endpoint URL. |
|
||||
| `model` | text | Model identifier the endpoint serves. |
|
||||
| `api_key` | text | Optional bearer token for cloud-hosted endpoints. |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------- | ---- | ------------------------------------------------------------ |
|
||||
| `summary` | text | The summary. |
|
||||
| `style` | text | Echo of the input style. |
|
||||
| `language` | text | Echo of the input language. |
|
||||
| `model_endpoint` | text | URL the summary was generated against. |
|
||||
| `model_name` | text | Model identifier as supplied to the LLM API. |
|
||||
| `model_digest` | text | SHA-256 digest of the served Ollama model (when reachable). |
|
||||
|
||||
## Fidelity over creativity
|
||||
|
||||
The system prompt is tuned so the summary is derivable from
|
||||
the source — no speculation, no implied context, no
|
||||
"creative" rephrasing that drifts. Suitable for compliance
|
||||
flows where a hallucinated summary is worse than a verbose
|
||||
one. The model still has the freedom the operator's chosen
|
||||
LLM gives it; this module is the prompt + audit harness, not
|
||||
a fine-tuned model.
|
||||
|
||||
## Permissions
|
||||
|
||||
```yaml
|
||||
permissions:
|
||||
- "net: localhost"
|
||||
- "net: 127.0.0.1"
|
||||
- "net: api.openai.com"
|
||||
- "net: api.anthropic.com"
|
||||
```
|
||||
|
||||
Same shape as `text.translate` — local Ollama by default,
|
||||
opt-in cloud via operator policy.
|
||||
|
||||
## Limits in v0.1.0
|
||||
|
||||
- Single-shot. Very long source texts (>32k tokens depending
|
||||
on the model) need an upstream chunker; v0.1.0 does not yet
|
||||
do automatic chunked-summarise + reduce.
|
||||
- No structured output. `summary` is free-form text. JSON-
|
||||
formatted summaries (e.g. `{ key_points: [], conclusions:
|
||||
[] }`) are a v0.2.0 candidate.
|
||||
|
||||
## Example flow
|
||||
|
||||
```yaml
|
||||
name: extract-summarise
|
||||
inputs:
|
||||
document: bytes
|
||||
steps:
|
||||
- id: extract
|
||||
use: text.extract@^0
|
||||
with:
|
||||
document: $inputs.document
|
||||
- id: summarise
|
||||
use: text.summarize@^0
|
||||
with:
|
||||
text: $extract.extracted.pages[*].text
|
||||
style: "three bullet points"
|
||||
endpoint: "http://localhost:11434/api/chat"
|
||||
model: "qwen2.5:14b"
|
||||
outputs:
|
||||
summary: $summarise.summary
|
||||
audit_model: $summarise.model_digest
|
||||
```
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
cargo build --release --target wasm32-wasip2
|
||||
# Output: target/wasm32-wasip2/release/text_summarize.wasm
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue