pub trait AgentRuntime: Send + Sync {
// Required methods
fn backend(&self) -> &AgentBackend;
fn agent_did(&self) -> &str;
fn validate_intent(&self, intent: &AgentIntent) -> WebizenVerdict;
fn infer(
&self,
prompt: &str,
graph_context: &str,
) -> Result<AgentOutput, AgentError>;
fn validate_output(&self, output: &AgentOutput) -> WebizenVerdict;
fn memory_budget_remaining(&self) -> u64;
}Expand description
The core abstraction. All LLM backends MUST implement this. The trait is object-safe so it can be boxed and swapped at runtime.
Required Methods§
Sourcefn backend(&self) -> &AgentBackend
fn backend(&self) -> &AgentBackend
Returns the configured backend variant.
Sourcefn validate_intent(&self, intent: &AgentIntent) -> WebizenVerdict
fn validate_intent(&self, intent: &AgentIntent) -> WebizenVerdict
Submits an intent to the Webizen for pre-flight validation.
This MUST be called before infer. Callers must not proceed if
the verdict is Deny.
Sourcefn infer(
&self,
prompt: &str,
graph_context: &str,
) -> Result<AgentOutput, AgentError>
fn infer( &self, prompt: &str, graph_context: &str, ) -> Result<AgentOutput, AgentError>
Runs inference on the given prompt and graph context.
graph_context is a serialised sub-graph slice provided by the Webizen.
Sourcefn validate_output(&self, output: &AgentOutput) -> WebizenVerdict
fn validate_output(&self, output: &AgentOutput) -> WebizenVerdict
Submits the LLM output to the Webizen for post-flight grounding check. The Webizen verifies provenance citations exist in the live graph.
Sourcefn memory_budget_remaining(&self) -> u64
fn memory_budget_remaining(&self) -> u64
Returns remaining memory budget in bytes.