text-summarize/module.yaml
flemming-it 4a04abf4f0
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
sign-bundle / sign (push) Has been cancelled
feat: selectable wire format — ollama (default), openai (vLLM etc.), anthropic
Port the multi-API client from llm.chat (llm.rs kept in lockstep):
the optional api input selects the dialect, default stays the
unchanged v0.1.x Ollama behavior. openai covers vLLM, LM Studio,
LiteLLM and cloud OpenAI; api-specific error hints; api_key sent
as Bearer (ollama/openai) or x-api-key (anthropic). model_digest
stays an Ollama-only best-effort probe and is documented as such.

Proven end-to-end against a hermetic OpenAI-wire fake (request
shape validated, response parsed) via a hub flow run.

Signed-off-by: flemming-it <sf@flemming.it>
2026-08-20 16:33:11 +02:00

117 lines
3.4 KiB
YAML

schema_version: 3
provider: chain
name: text-summarize
version: 0.2.0
# Capability provided by this module.
provides:
- capability: text.summarize
version: 0.2.0
# Inputs the invoke function accepts.
inputs:
text:
type: text
description:
en: Source text to summarise.
de: Quelltext, der zusammengefasst werden soll.
style:
type: text
description:
en: |
Style / shape of the summary, e.g. "one paragraph",
"three bullet points", "a tweet". Defaults to
"one paragraph" when omitted.
de: |
Stil/Form der Zusammenfassung, z. B. "ein Absatz",
"drei Bulletpoints", "ein Tweet". Default ist
"ein Absatz".
language:
type: text
description:
en: |
Optional output language hint, e.g. "German", "ja-JP".
Empty = same language as the source.
de: |
Optionale Ausgabesprache, z. B. "German", "ja-JP".
Leer = gleiche Sprache wie die Quelle.
endpoint:
type: text
description:
en: |
Chat endpoint URL matching the selected api:
ollama "http://localhost:11434/api/chat",
openai "http://localhost:8000/v1/chat/completions"
(vLLM etc.), anthropic "https://.../v1/messages".
de: |
Chat-Endpunkt-URL passend zum gewählten api:
ollama "http://localhost:11434/api/chat",
openai "http://localhost:8000/v1/chat/completions"
(vLLM u. a.), anthropic "https://.../v1/messages".
api:
type: text
description:
en: |
Optional wire format: "ollama" (default), "openai"
(OpenAI-compatible servers such as vLLM or LM Studio),
or "anthropic" (Messages API). Empty = ollama.
de: |
Optionales Wire-Format: "ollama" (Default), "openai"
(OpenAI-kompatible Server wie vLLM oder LM Studio)
oder "anthropic" (Messages API). Leer = ollama.
model:
type: text
description:
en: Model identifier (e.g. "qwen2.5:14b").
de: Modell-Identifier (z. B. "qwen2.5:14b").
api_key:
type: text
description:
en: Optional bearer token for cloud-hosted endpoints.
de: Optionaler Bearer-Token für Cloud-Endpunkte.
# Outputs produced.
outputs:
summary:
type: text
description:
en: The summary text.
de: Die zusammengefasste Antwort.
style:
type: text
description:
en: Echo of the style input for downstream audit.
de: Echo des Style-Inputs für Downstream-Audit.
language:
type: text
description:
en: Echo of the language input.
de: Echo des Language-Inputs.
model_endpoint:
type: text
description:
en: Endpoint the summary was generated against.
de: Endpunkt, gegen den die Zusammenfassung erzeugt wurde.
model_name:
type: text
description:
en: Model identifier as supplied to the LLM API.
de: An die LLM-API übergebenes Modell.
model_digest:
type: text
description:
en: |
SHA-256 digest of the served model, best-effort probe.
Ollama only — empty for other endpoints (OpenAI / vLLM /
Anthropic expose no digest API).
de: |
SHA-256-Digest des bedienten Modells (Best-Effort-Probe).
Nur bei Ollama — leer bei anderen Endpunkten (OpenAI /
vLLM / Anthropic bieten keine Digest-API).
# Permissions required.
permissions:
- "net: localhost"
- "net: 127.0.0.1"
- "net: api.openai.com"
- "net: api.anthropic.com"