#[non_exhaustive]pub struct CallOrigin {
pub carrier: Principal,
pub call_key: String,
pub message_position: Option<MessagePosition>,
}Expand description
Who really asked for a call that another module relays.
When a module forwards a tool call on behalf of a different caller, the
provider sees the forwarding module as the route’s principal and the
forwarder’s own call_key. This records the caller behind it, so the
provider can attribute the call in its logs and ledgers.
It is a claim made by the forwarding module, not something the daemon checks: a provider may record it but must never grant or refuse anything because of it. Authority stays with the route’s own principal.
#[non_exhaustive] so a later member is an additive change; build it with
CallOrigin::new.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.carrier: PrincipalThe original caller, in the same form the daemon stamps on a route.
call_key: StringThe original caller’s key for the call, with the same bounds as
ToolCallRequest::call_key; check it with validate_call_origin.
message_position: Option<MessagePosition>Where the call sits in the model message that asked for it, when the
forwarder knows. None means unknown, never “first” or “alone”.
Implementations§
Source§impl CallOrigin
impl CallOrigin
Sourcepub fn new(carrier: Principal, call_key: impl Into<String>) -> Self
pub fn new(carrier: Principal, call_key: impl Into<String>) -> Self
An origin naming carrier as the caller and call_key as its key, with
no message position.
Sourcepub fn with_message_position(self, position: MessagePosition) -> Self
pub fn with_message_position(self, position: MessagePosition) -> Self
Set where the call sits in the model message that asked for it.