pub struct InputRequest {
pub session_id: SessionId,
pub reason: String,
}Expand description
Descriptor for a LoopInterrupt::AwaitingInput interrupt.
Returned when the driver has no pending input and needs the host to
supply items before advancing. This is the entry point for every user
turn that wasn’t preloaded via AgentBuilder::input. Transcript items
loaded via AgentBuilder::transcript are passive, so when no input is
preloaded the first LoopDriver::next call surfaces AwaitingInput
and the host injects the first user message via InputRequest::submit.
§Example
match driver.next().await? {
LoopStep::Interrupt(LoopInterrupt::AwaitingInput(pending)) => {
pending.submit(driver, items)?;
}
_ => {}
}Fields§
§session_id: SessionIdThe session that is waiting for input.
reason: StringHuman-readable explanation of why input is needed.
Implementations§
Source§impl InputRequest
impl InputRequest
Sourcepub fn submit<S: ModelSession>(
self,
driver: &mut LoopDriver<S>,
items: Vec<Item>,
) -> Result<(), LoopError>
pub fn submit<S: ModelSession>( self, driver: &mut LoopDriver<S>, items: Vec<Item>, ) -> Result<(), LoopError>
Submit input items to the driver.
Trait Implementations§
Source§impl Clone for InputRequest
impl Clone for InputRequest
Source§fn clone(&self) -> InputRequest
fn clone(&self) -> InputRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InputRequest
impl Debug for InputRequest
Source§impl<'de> Deserialize<'de> for InputRequest
impl<'de> Deserialize<'de> for InputRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for InputRequest
impl PartialEq for InputRequest
Source§fn eq(&self, other: &InputRequest) -> bool
fn eq(&self, other: &InputRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for InputRequest
impl Serialize for InputRequest
impl Eq for InputRequest
impl StructuralPartialEq for InputRequest
Auto Trait Implementations§
impl Freeze for InputRequest
impl RefUnwindSafe for InputRequest
impl Send for InputRequest
impl Sync for InputRequest
impl Unpin for InputRequest
impl UnsafeUnpin for InputRequest
impl UnwindSafe for InputRequest
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