pub enum TextCitation {
CharLocation(CitationCharLocation),
PageLocation(CitationPageLocation),
ContentBlockLocation(CitationContentBlockLocation),
WebSearchResultLocation(CitationWebSearchResultLocation),
}Available on crate feature
anthropic-client only.Expand description
A citation reference in a TextBlock.
This enum represents the different types of citations that can be included in a text block’s content.
Variants§
CharLocation(CitationCharLocation)
A character-based location citation
PageLocation(CitationPageLocation)
A page-based location citation
ContentBlockLocation(CitationContentBlockLocation)
A content block-based location citation
WebSearchResultLocation(CitationWebSearchResultLocation)
A web search result location citation
Implementations§
Source§impl TextCitation
impl TextCitation
Sourcepub fn char_location(
cited_text: String,
document_index: i32,
start_char_index: i32,
end_char_index: i32,
document_title: Option<String>,
) -> TextCitation
pub fn char_location( cited_text: String, document_index: i32, start_char_index: i32, end_char_index: i32, document_title: Option<String>, ) -> TextCitation
Creates a new character-based location citation
Sourcepub fn page_location(
cited_text: String,
document_index: i32,
start_page_number: i32,
end_page_number: i32,
document_title: Option<String>,
) -> TextCitation
pub fn page_location( cited_text: String, document_index: i32, start_page_number: i32, end_page_number: i32, document_title: Option<String>, ) -> TextCitation
Creates a new page-based location citation
Sourcepub fn content_block_location(
cited_text: String,
document_index: i32,
start_block_index: i32,
end_block_index: i32,
document_title: Option<String>,
) -> TextCitation
pub fn content_block_location( cited_text: String, document_index: i32, start_block_index: i32, end_block_index: i32, document_title: Option<String>, ) -> TextCitation
Creates a new content block-based location citation
Sourcepub fn web_search_result_location(
cited_text: String,
encrypted_index: String,
url: String,
title: Option<String>,
) -> TextCitation
pub fn web_search_result_location( cited_text: String, encrypted_index: String, url: String, title: Option<String>, ) -> TextCitation
Creates a new web search result location citation
Trait Implementations§
Source§impl Clone for TextCitation
impl Clone for TextCitation
Source§fn clone(&self) -> TextCitation
fn clone(&self) -> TextCitation
Returns a duplicate of the value. Read more
1.0.0 · 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 TextCitation
impl Debug for TextCitation
Source§impl<'de> Deserialize<'de> for TextCitation
impl<'de> Deserialize<'de> for TextCitation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextCitation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TextCitation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TextCitation
impl PartialEq for TextCitation
Source§impl Serialize for TextCitation
impl Serialize for TextCitation
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,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for TextCitation
Auto Trait Implementations§
impl Freeze for TextCitation
impl RefUnwindSafe for TextCitation
impl Send for TextCitation
impl Sync for TextCitation
impl Unpin for TextCitation
impl UnsafeUnpin for TextCitation
impl UnwindSafe for TextCitation
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,
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::RequestCreates a shared type from an unshared type.