pub struct WebSearchToolResultError {
pub error_code: WebSearchErrorCode,
}anthropic-client only.Expand description
An error that occurred when using the web search tool.
This struct represents various failure conditions that can occur during web search operations, from input validation errors to service availability issues.
Fields§
§error_code: WebSearchErrorCodeThe specific error code indicating the type of failure.
This code can be used to programmatically handle different error scenarios and provide appropriate user feedback or retry logic.
Implementations§
Source§impl WebSearchToolResultError
impl WebSearchToolResultError
Sourcepub fn new(error_code: WebSearchErrorCode) -> WebSearchToolResultError
pub fn new(error_code: WebSearchErrorCode) -> WebSearchToolResultError
Creates a new WebSearchToolResultError with the specified error code.
Sourcepub fn is_invalid_input(&self) -> bool
pub fn is_invalid_input(&self) -> bool
Returns true if the error is due to an invalid tool input.
Returns true if the error is due to the service being unavailable.
Sourcepub fn is_max_uses_exceeded(&self) -> bool
pub fn is_max_uses_exceeded(&self) -> bool
Returns true if the error is due to exceeding the maximum number of uses.
Sourcepub fn is_too_many_requests(&self) -> bool
pub fn is_too_many_requests(&self) -> bool
Returns true if the error is due to too many requests.
Sourcepub fn is_query_too_long(&self) -> bool
pub fn is_query_too_long(&self) -> bool
Returns true if the error is due to a query that is too long.
Trait Implementations§
Source§impl Clone for WebSearchToolResultError
impl Clone for WebSearchToolResultError
Source§fn clone(&self) -> WebSearchToolResultError
fn clone(&self) -> WebSearchToolResultError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebSearchToolResultError
impl Debug for WebSearchToolResultError
Source§impl<'de> Deserialize<'de> for WebSearchToolResultError
impl<'de> Deserialize<'de> for WebSearchToolResultError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WebSearchToolResultError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WebSearchToolResultError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for WebSearchToolResultError
impl PartialEq for WebSearchToolResultError
Source§impl Serialize for WebSearchToolResultError
impl Serialize for WebSearchToolResultError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for WebSearchToolResultError
Auto Trait Implementations§
impl Freeze for WebSearchToolResultError
impl RefUnwindSafe for WebSearchToolResultError
impl Send for WebSearchToolResultError
impl Sync for WebSearchToolResultError
impl Unpin for WebSearchToolResultError
impl UnsafeUnpin for WebSearchToolResultError
impl UnwindSafe for WebSearchToolResultError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request