pub struct ToolApprovalResponse {
pub approval_id: ApprovalId,
pub approved: bool,
pub reason: Option<String>,
pub provider_executed: bool,
}Expand description
The user’s answer to a ToolApprovalRequest, recorded in a tool
message.
Fields§
§approval_id: ApprovalIdThe approval being answered.
approved: boolWhether execution was approved.
reason: Option<String>Optional explanation.
provider_executed: boolWhether the approved tool is executed by the provider.
Implementations§
Source§impl ToolApprovalResponse
impl ToolApprovalResponse
Sourcepub fn approved(approval_id: impl Into<ApprovalId>) -> Self
pub fn approved(approval_id: impl Into<ApprovalId>) -> Self
An approval.
Sourcepub fn denied(approval_id: impl Into<ApprovalId>) -> Self
pub fn denied(approval_id: impl Into<ApprovalId>) -> Self
A denial.
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 provider_executed(self) -> Self
pub fn provider_executed(self) -> Self
Marks the tool as provider-executed.
Trait Implementations§
Source§impl Clone for ToolApprovalResponse
impl Clone for ToolApprovalResponse
Source§fn clone(&self) -> ToolApprovalResponse
fn clone(&self) -> ToolApprovalResponse
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 ToolApprovalResponse
impl Debug for ToolApprovalResponse
Source§impl<'de> Deserialize<'de> for ToolApprovalResponse
impl<'de> Deserialize<'de> for ToolApprovalResponse
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 ToolApprovalResponse
Source§impl From<ToolApprovalResponse> for ToolPart
impl From<ToolApprovalResponse> for ToolPart
Source§fn from(part: ToolApprovalResponse) -> Self
fn from(part: ToolApprovalResponse) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ToolApprovalResponse
impl PartialEq for ToolApprovalResponse
Source§impl Serialize for ToolApprovalResponse
impl Serialize for ToolApprovalResponse
impl StructuralPartialEq for ToolApprovalResponse
Auto Trait Implementations§
impl Freeze for ToolApprovalResponse
impl RefUnwindSafe for ToolApprovalResponse
impl Send for ToolApprovalResponse
impl Sync for ToolApprovalResponse
impl Unpin for ToolApprovalResponse
impl UnsafeUnpin for ToolApprovalResponse
impl UnwindSafe for ToolApprovalResponse
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.