F module - Ollama-backed text summarisation.
Find a file
flemming-it e02485750b
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
chore: cargo fmt
Signed-off-by: flemming-it <sf@flemming.it>
2026-08-20 22:30:32 +02:00
.forgejo/workflows fix(ci): embed official.pub — round-trip verify fetched it from a private repo 2026-08-20 22:07:12 +02:00
src chore: cargo fmt 2026-08-20 22:30:32 +02:00
.gitignore feat: initial text-summarize v0.1.0 (text.summarize@0.1.0) 2026-05-04 11:18:29 +02:00
Cargo.lock feat: api accepts 'vllm' as a first-class value 2026-08-20 17:13:43 +02:00
Cargo.toml feat: selectable wire format — ollama (default), openai (vLLM etc.), anthropic 2026-08-20 16:33:11 +02:00
LICENSE chore: org rename fai-modules/fai-plugins -> chain-modules/chain-plugins + LICENSE holder 2026-06-16 18:25:41 +02:00
MODULE.de.md feat: api accepts 'vllm' as a first-class value 2026-08-20 17:13:43 +02:00
MODULE.md feat: api accepts 'vllm' as a first-class value 2026-08-20 17:13:43 +02:00
module.wasm chore: pin chain-module-sdk v0.3.0 and switch to #[chain_module] 2026-07-12 13:52:41 +02:00
module.yaml feat: api accepts 'vllm' as a first-class value 2026-08-20 17:13:43 +02:00
NOTICE feat: initial text-summarize v0.1.0 (text.summarize@0.1.0) 2026-05-04 11:18:29 +02:00
README.md chore: pin chain-module-sdk v0.3.0 and switch to #[chain_module] 2026-07-12 13:52:41 +02:00
rust-toolchain.toml feat: initial text-summarize v0.1.0 (text.summarize@0.1.0) 2026-05-04 11:18:29 +02:00

text-summarize

Provides the text.summarize capability for Ch∆In.

Build

cargo build --release --target wasm32-wasip2

Test

cargo test                 # host-side unit + integration tests
fai test .                 # load the wasm component in the runtime sandbox

Authoring with chain-module-sdk

The module body is one decorated function:

#[chain_module]
pub fn invoke(_ctx: Context, inputs: Inputs) -> Result<Outputs, ModuleError> {
    let message = inputs.require_text("message")?;
    Ok(Outputs::new().with_text("reply", format!("got: {message}")))
}

The macro hides the wit_bindgen call, the Guest impl, the Payload variant matching, and the wit_bindgen::export! invocation. See chain-module-sdk documentation for the full surface.

SDK source

The Cargo.toml git-deps chain-module-sdk from https://git.flemming.ws/fai/module-sdk.git. If your environment requires authentication for that host (e.g. Forgejo with REQUIRE_SIGNIN_VIEW=true), set up git config insteadOf with your PAT, or use cargo:net.git-fetch-with-cli=true plus a credential helper.

License

Apache-2.0