pub struct HarnessRuntime<P, H> { /* private fields */ }Expand description
Outer runtime that drives an AgentKernel with a Provider and
governed Harness.
The runtime owns model and effect execution. The agent kernel only maintains reasoning state and requests the next action.
Implementations§
Source§impl<P, H> HarnessRuntime<P, H>
impl<P, H> HarnessRuntime<P, H>
Sourcepub fn new(provider: P, harness: H) -> HarnessRuntime<P, H>
pub fn new(provider: P, harness: H) -> HarnessRuntime<P, H>
Constructs a runtime from a provider and harness.
Sourcepub fn with_config(self, config: HarnessRuntimeConfig) -> HarnessRuntime<P, H>
pub fn with_config(self, config: HarnessRuntimeConfig) -> HarnessRuntime<P, H>
Replaces runtime configuration.
Sourcepub async fn run<K>(
&self,
kernel: &mut K,
request: RunRequest,
context: RunContext,
) -> Result<RunOutput, HarnessRuntimeError>where
K: AgentKernel,
pub async fn run<K>(
&self,
kernel: &mut K,
request: RunRequest,
context: RunContext,
) -> Result<RunOutput, HarnessRuntimeError>where
K: AgentKernel,
Runs a kernel to completion.
§Errors
Returns HarnessRuntimeError::Provider when model communication
fails, HarnessRuntimeError::Harness when governance infrastructure
fails, HarnessRuntimeError::Agent when the kernel rejects a step,
and HarnessRuntimeError::TooManyAgentSteps when the configured
step limit is exceeded.
Trait Implementations§
Auto Trait Implementations§
impl<P, H> Freeze for HarnessRuntime<P, H>
impl<P, H> RefUnwindSafe for HarnessRuntime<P, H>where
P: RefUnwindSafe,
H: RefUnwindSafe,
impl<P, H> Send for HarnessRuntime<P, H>
impl<P, H> Sync for HarnessRuntime<P, H>
impl<P, H> Unpin for HarnessRuntime<P, H>
impl<P, H> UnsafeUnpin for HarnessRuntime<P, H>where
P: UnsafeUnpin,
H: UnsafeUnpin,
impl<P, H> UnwindSafe for HarnessRuntime<P, H>where
P: UnwindSafe,
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more