chore: pin chain-module-sdk v0.3.0 and switch to #[chain_module]
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
Some checks failed
CI / Linux x86_64 (Forgejo) (push) Failing after 2s
The pre-rename #[fai_module] attribute is gone in SDK 0.3.0; the dependency is tag-pinned so an SDK push can no longer change what this module builds against. Rebuilt artifact where tracked. Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
parent
ee6543240d
commit
19886a7072
5 changed files with 7 additions and 7 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -40,8 +40,8 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chain-module-sdk"
|
name = "chain-module-sdk"
|
||||||
version = "0.1.2"
|
version = "0.3.0"
|
||||||
source = "git+https://git.flemming.ai/fai/chain-module-sdk-rust.git?branch=main#98e98e9371f7409560a1ef08bc0923d9a2506449"
|
source = "git+https://git.flemming.ai/fai/chain-module-sdk-rust.git?tag=v0.3.0#a4415ada7e76aac5e3aabf3e4c4311ffc348d8d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chain-module-sdk-macros",
|
"chain-module-sdk-macros",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
@ -52,8 +52,8 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chain-module-sdk-macros"
|
name = "chain-module-sdk-macros"
|
||||||
version = "0.1.2"
|
version = "0.3.0"
|
||||||
source = "git+https://git.flemming.ai/fai/chain-module-sdk-rust.git?branch=main#98e98e9371f7409560a1ef08bc0923d9a2506449"
|
source = "git+https://git.flemming.ai/fai/chain-module-sdk-rust.git?tag=v0.3.0#a4415ada7e76aac5e3aabf3e4c4311ffc348d8d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ description = "F∆I module providing text.summarize"
|
||||||
crate-type = ["cdylib", "rlib"]
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chain-module-sdk = { git = "https://git.flemming.ai/fai/chain-module-sdk-rust.git", branch = "main" }
|
chain-module-sdk = { git = "https://git.flemming.ai/fai/chain-module-sdk-rust.git", tag = "v0.3.0" }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
thiserror = "2"
|
thiserror = "2"
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ fai test . # load the wasm component in the runtime sandbox
|
||||||
The module body is one decorated function:
|
The module body is one decorated function:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
#[fai_module]
|
#[chain_module]
|
||||||
pub fn invoke(_ctx: Context, inputs: Inputs) -> Result<Outputs, ModuleError> {
|
pub fn invoke(_ctx: Context, inputs: Inputs) -> Result<Outputs, ModuleError> {
|
||||||
let message = inputs.require_text("message")?;
|
let message = inputs.require_text("message")?;
|
||||||
Ok(Outputs::new().with_text("reply", format!("got: {message}")))
|
Ok(Outputs::new().with_text("reply", format!("got: {message}")))
|
||||||
|
|
|
||||||
BIN
module.wasm
BIN
module.wasm
Binary file not shown.
|
|
@ -16,7 +16,7 @@ Produce a faithful, neutral summary of the user's text in the user's language. \
|
||||||
Preserve named entities, numbers, and dates verbatim. Do not editorialise. \
|
Preserve named entities, numbers, and dates verbatim. Do not editorialise. \
|
||||||
Emit only the summary — no preamble, no metadata.";
|
Emit only the summary — no preamble, no metadata.";
|
||||||
|
|
||||||
#[fai_module]
|
#[chain_module]
|
||||||
pub fn invoke(_ctx: Context, inputs: Inputs) -> Result<Outputs, ModuleError> {
|
pub fn invoke(_ctx: Context, inputs: Inputs) -> Result<Outputs, ModuleError> {
|
||||||
let text = inputs.require_text("text")?.to_string();
|
let text = inputs.require_text("text")?.to_string();
|
||||||
let endpoint = inputs.require_text("endpoint")?.to_string();
|
let endpoint = inputs.require_text("endpoint")?.to_string();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue