Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
The product is Ch∆In; the old 'F∆I Platform' name survived in module docs/manifests. Generic 'platform' terms left untouched. Signed-off-by: flemming-it <sf@flemming.it>
46 lines
1.1 KiB
Markdown
46 lines
1.1 KiB
Markdown
# text-summarize
|
|
|
|
Provides the `text.summarize` capability for Ch∆In.
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cargo build --release --target wasm32-wasip2
|
|
```
|
|
|
|
## Test
|
|
|
|
```bash
|
|
cargo test # host-side unit + integration tests
|
|
fai test . # load the wasm component in the runtime sandbox
|
|
```
|
|
|
|
## Authoring with fai-module-sdk
|
|
|
|
The module body is one decorated function:
|
|
|
|
```rust
|
|
#[fai_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 `fai-module-sdk` documentation for the full
|
|
surface.
|
|
|
|
## SDK source
|
|
|
|
The Cargo.toml git-deps `fai-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
|