pub struct FunctionInvocationContext {
pub function_name: String,
pub arguments: Value,
pub session: Option<AgentSession>,
pub metadata: HashMap<String, Value>,
pub result: Option<Value>,
pub result_properties: Map<String, Value>,
pub terminate: bool,
/* private fields */
}Expand description
Context flowing through the function middleware pipeline.
Fields§
§function_name: String§arguments: Value§session: Option<AgentSession>The AgentSession of the agent run
this invocation belongs to, if the call originated from an agent run
with a session. Middleware may read it; tools receive it via
Tool::invoke_in_context
(the hook behind Agent::as_tool with propagate_session). Mirrors
upstream’s FunctionInvocationContext.session.
metadata: HashMap<String, Value>§result: Option<Value>§result_properties: Map<String, Value>Host-side extras for the result (see
Tool::invoke_with_properties),
copied onto the
FunctionResultContent.
terminate: boolImplementations§
Source§impl FunctionInvocationContext
impl FunctionInvocationContext
pub fn new( function_name: impl Into<String>, arguments: Value, ) -> FunctionInvocationContext
Sourcepub fn with_session(
self,
session: Option<AgentSession>,
) -> FunctionInvocationContext
pub fn with_session( self, session: Option<AgentSession>, ) -> FunctionInvocationContext
Builder: attach the agent session this invocation belongs to.
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionInvocationContext
impl !UnwindSafe for FunctionInvocationContext
impl Freeze for FunctionInvocationContext
impl Send for FunctionInvocationContext
impl Sync for FunctionInvocationContext
impl Unpin for FunctionInvocationContext
impl UnsafeUnpin for FunctionInvocationContext
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