Skip to main content

Crate sage_runtime_web

Crate sage_runtime_web 

Source
Expand description

WASM platform layer for the Sage runtime.

Provides browser-compatible implementations of platform primitives:

  • spawn_local for async task spawning (no Send required)
  • sleep via browser setTimeout
  • Console logging via web-sys
  • web-time re-export for Instant shim
  • Thread-local LLM config injection for browser environments

Structs§

Instant
Re-export web_time::Instant as the WASM-compatible Instant. A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
WasmLlmConfig
LLM configuration for WASM environments.

Functions§

console_error
Log an error to the browser console.
console_log
Log a message to the browser console.
console_warn
Log a warning to the browser console.
get_llm_config
Get the current WASM LLM configuration.
sage_configure
Configure the LLM endpoint from JavaScript.
set_panic_hook
Re-export panic hook setup. Set the console.error panic hook the first time this is called. Subsequent invocations do nothing.
sleep
Async sleep using browser setTimeout.
spawn_local
Re-export wasm_bindgen_futures::spawn_local. Runs a Rust Future on the current thread.