pub struct InjectedState<S: State> { /* private fields */ }Expand description
Marker: this tool parameter receives the current graph state.
The LLM never sees this parameter — it’s injected by the runtime.
The value is a clone of the state at the time ToolNode::call() executes.
§Future usage (with #[tool] macro, Plan 010)
ⓘ
#[tool]
async fn my_tool(
query: String,
state: InjectedState<AgentState>,
) -> Result<Value, PeError> {
let messages = state.get().messages();
// ... use state for context ...
}Implementations§
Auto Trait Implementations§
impl<S> Freeze for InjectedState<S>where
S: Freeze,
impl<S> RefUnwindSafe for InjectedState<S>where
S: RefUnwindSafe,
impl<S> Send for InjectedState<S>
impl<S> Sync for InjectedState<S>
impl<S> Unpin for InjectedState<S>where
S: Unpin,
impl<S> UnsafeUnpin for InjectedState<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for InjectedState<S>where
S: 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