feat: initial text-summarize v0.1.0 (text.summarize@0.1.0)
All checks were successful
CI / Linux x86_64 (Forgejo) (push) Successful in 1m32s
All checks were successful
CI / Linux x86_64 (Forgejo) (push) Successful in 1m32s
Ollama-backed summarisation module — fourth real F∆I capability,
following text.extract / llm.chat / text.translate. Completes
the text-processing trio for compose-grade workflows
(extract -> translate -> summarise, or any subset).
Capability:
Inputs:
text : text (source text)
style : text (e.g. "one paragraph", "three bullets";
defaults to "one paragraph")
language : text (output language hint; empty = source)
endpoint : text (Ollama /api/chat URL)
model : text
api_key : text (optional)
Outputs:
summary : text
style : text (echo for audit)
language : text (echo for audit)
model_endpoint : text
model_name : text
model_digest : text (Ollama /api/show probe; empty for
non-Ollama or transient failures)
Permissions: net to localhost / 127.0.0.1 / api.openai.com /
api.anthropic.com.
System prompt is conservative: faithful, neutral, preserves
named entities, no editorialising, no metadata. Reuses the LLM
client + digest-probe pattern from llm-chat / text-translate;
the duplication is acceptable at four modules and will be
factored into a shared crate when a fifth lands.
15 host-side tests cover prompt-building (style + language +
empty-language), Ollama-shaped response parsing, URL transform,
digest extraction, end-to-end success / probe-failure / non-
Ollama paths.
Wasm artifact: 118 KB. Built with v1.0 fai:platform imports.
Bootstrapped via 'fai new module text.summarize'.
Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
commit
3422fe526d
11 changed files with 1445 additions and 0 deletions
49
Cargo.toml
Normal file
49
Cargo.toml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# Standalone Cargo.toml — targets wasm32-wasip2.
|
||||
#
|
||||
# Build with:
|
||||
# cargo build --release --target wasm32-wasip2
|
||||
|
||||
[package]
|
||||
name = "text_summarize"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
license = "Apache-2.0"
|
||||
publish = false
|
||||
description = "F∆I module providing text.summarize"
|
||||
|
||||
[lib]
|
||||
# cdylib for the wasm artifact, rlib so integration tests can
|
||||
# link against the module's `invoke` function on the host.
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
fai-module-sdk = { git = "https://git.flemming.ws/fai/module-sdk.git", branch = "main" }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
thiserror = "2"
|
||||
|
||||
# WASI-0.2 HTTP client. Only compiled into the wasm32-wasip2 build.
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
waki = "0.5"
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1"
|
||||
|
||||
[profile.release]
|
||||
opt-level = "s"
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
strip = "symbols"
|
||||
|
||||
[lints.rust]
|
||||
unsafe_op_in_unsafe_fn = "warn"
|
||||
|
||||
[lints.clippy]
|
||||
unwrap_used = "deny"
|
||||
expect_used = "deny"
|
||||
panic = "deny"
|
||||
print_stdout = "deny"
|
||||
print_stderr = "deny"
|
||||
|
||||
[workspace]
|
||||
# Empty so this package is NOT picked up by a parent.
|
||||
Loading…
Add table
Add a link
Reference in a new issue