Skip to main content

Crate sage_runtime

Crate sage_runtime 

Source
Expand description

Runtime library for compiled Sage programs.

This crate provides the types and functions that generated Rust code depends on. It handles:

  • Agent spawning and lifecycle
  • Message passing between agents
  • LLM inference calls
  • RFC-0011: Tool execution (Http, Fs, etc.)
  • RFC-0012: Mock infrastructure for testing
  • Tracing and observability
  • Error handling

Re-exports§

pub use mock::MockLlmClient;
pub use mock::MockQueue;
pub use mock::MockResponse;
pub use tools::HttpClient;
pub use tools::HttpResponse;
pub use tracing as trace;

Modules§

mock
Mock infrastructure for the Sage testing framework (RFC-0012).
prelude
Prelude for generated code.
stdlib
Standard library functions for Sage.
tools
RFC-0011: Tool implementations for Sage agents.
tracing
Tracing support for Sage programs.

Structs§

AgentContext
Context provided to agent handlers.
AgentHandle
Handle to a spawned agent.
LlmClient
Client for making LLM inference calls.

Enums§

ErrorKind
RFC-0007: Error kind classification for Sage errors.
SageError
Error type for Sage runtime errors.

Functions§

spawn
Spawn an agent and return a handle to it.

Type Aliases§

SageResult
Result type for Sage operations.