You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[plugin_fn]
// see https://docs.rs/extism-pdk/latest/extism_pdk/struct.HttpRequest.html for docs on this type
pub fn http_get(Json(req): Json<HttpRequest>) -> FnResult<()> {
info!("Request to: {}", req.url);
// let mut headers = BTreeMap::new();
// headers.insert("User-Agent".to_owned(), "my-http-client/1.0".to_owned());
// let request = HttpRequest::new(String::from("https://bing.com"));
// let res = http::request::<()>(&request, None)?;
// Ok(res)
Ok(())
}
Run
cargo build --release --target wasm32-unknown-unknown && extism call target/wasm32-unknown-unknown/release/memelooop_plugin_openai.wasm http_get --input "this is a test"
The text was updated successfully, but these errors were encountered:
No, I'm fremillar with Rust, I've develop Affine's rust client.
Its this lib's err message and lack of example that makes bad dev experience. I post it here because this will help someone google here, and become the complement of the lacking doc.
Don't know what this error message talk about
Plugin:
Run
The text was updated successfully, but these errors were encountered: