pub struct ToolApprovalRequest {
pub approval_id: ApprovalId,
pub tool_call_id: ToolCallId,
pub reason: Option<String>,
pub is_automatic: bool,
pub signature: Option<String>,
}Expand description
A request for user approval of a tool call, recorded in an assistant message.
Fields§
§approval_id: ApprovalIdApproval identifier.
tool_call_id: ToolCallIdThe tool call awaiting approval.
reason: Option<String>Why approval is needed.
is_automatic: boolWhether the request was created automatically (for example by a provider-executed tool) rather than by the tool’s approval policy.
signature: Option<String>Tamper-detection signature over the request.
Implementations§
Source§impl ToolApprovalRequest
impl ToolApprovalRequest
Sourcepub fn new(
approval_id: impl Into<ApprovalId>,
tool_call_id: impl Into<ToolCallId>,
) -> Self
pub fn new( approval_id: impl Into<ApprovalId>, tool_call_id: impl Into<ToolCallId>, ) -> Self
Creates a request.
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Sets the reason.
Sourcepub fn with_signature(self, signature: impl Into<String>) -> Self
pub fn with_signature(self, signature: impl Into<String>) -> Self
Sets the signature.
Trait Implementations§
Source§impl Clone for ToolApprovalRequest
impl Clone for ToolApprovalRequest
Source§fn clone(&self) -> ToolApprovalRequest
fn clone(&self) -> ToolApprovalRequest
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 ToolApprovalRequest
impl Debug for ToolApprovalRequest
Source§impl<'de> Deserialize<'de> for ToolApprovalRequest
impl<'de> Deserialize<'de> for ToolApprovalRequest
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
impl Eq for ToolApprovalRequest
Source§impl From<ToolApprovalRequest> for AssistantPart
impl From<ToolApprovalRequest> for AssistantPart
Source§fn from(part: ToolApprovalRequest) -> Self
fn from(part: ToolApprovalRequest) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ToolApprovalRequest
impl PartialEq for ToolApprovalRequest
Source§impl Serialize for ToolApprovalRequest
impl Serialize for ToolApprovalRequest
impl StructuralPartialEq for ToolApprovalRequest
Auto Trait Implementations§
impl Freeze for ToolApprovalRequest
impl RefUnwindSafe for ToolApprovalRequest
impl Send for ToolApprovalRequest
impl Sync for ToolApprovalRequest
impl Unpin for ToolApprovalRequest
impl UnsafeUnpin for ToolApprovalRequest
impl UnwindSafe for ToolApprovalRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.