Record Class AnthropicApi.CitationResponse
java.lang.Object
java.lang.Record
org.springframework.ai.anthropic.api.AnthropicApi.CitationResponse
- Record Components:
type- The citation location type ("char_location", "page_location", or "content_block_location")citedText- The text that was cited from the documentdocumentIndex- The index of the document that was cited (0-based)documentTitle- The title of the document that was citedstartCharIndex- The starting character index for "char_location" type (0-based, inclusive)endCharIndex- The ending character index for "char_location" type (exclusive)startPageNumber- The starting page number for "page_location" type (1-based, inclusive)endPageNumber- The ending page number for "page_location" type (exclusive)startBlockIndex- The starting content block index for "content_block_location" type (0-based, inclusive)endBlockIndex- The ending content block index for "content_block_location" type (exclusive)
- Enclosing class:
AnthropicApi
public static record AnthropicApi.CitationResponse(String type, String citedText, Integer documentIndex, String documentTitle, Integer startCharIndex, Integer endCharIndex, Integer startPageNumber, Integer endPageNumber, Integer startBlockIndex, Integer endBlockIndex)
extends Record
Citation response structure from Anthropic API. Maps to the actual API response
format for citations. Contains location information that varies by document type:
character indices for plain text, page numbers for PDFs, or content block indices
for custom content.
- Since:
- 1.0.0
- Author:
- Christian Tzolov, Mariusz Bernacki, Thomas Vitale, Jihoon Kim, Alexandros Pappas, Jonghoon Park, Claudio Silva Junior, Filip Hrisafov, Soby Chacko, Austin Dase
-
Constructor Summary
ConstructorsConstructorDescriptionCitationResponse(String type, String citedText, Integer documentIndex, String documentTitle, Integer startCharIndex, Integer endCharIndex, Integer startPageNumber, Integer endPageNumber, Integer startBlockIndex, Integer endBlockIndex) Creates an instance of aCitationResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecitedTextrecord component.Returns the value of thedocumentIndexrecord component.Returns the value of thedocumentTitlerecord component.Returns the value of theendBlockIndexrecord component.Returns the value of theendCharIndexrecord component.Returns the value of theendPageNumberrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thestartBlockIndexrecord component.Returns the value of thestartCharIndexrecord component.Returns the value of thestartPageNumberrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
CitationResponse
public CitationResponse(String type, String citedText, Integer documentIndex, String documentTitle, Integer startCharIndex, Integer endCharIndex, Integer startPageNumber, Integer endPageNumber, Integer startBlockIndex, Integer endBlockIndex) Creates an instance of aCitationResponserecord class.- Parameters:
type- the value for thetyperecord componentcitedText- the value for thecitedTextrecord componentdocumentIndex- the value for thedocumentIndexrecord componentdocumentTitle- the value for thedocumentTitlerecord componentstartCharIndex- the value for thestartCharIndexrecord componentendCharIndex- the value for theendCharIndexrecord componentstartPageNumber- the value for thestartPageNumberrecord componentendPageNumber- the value for theendPageNumberrecord componentstartBlockIndex- the value for thestartBlockIndexrecord componentendBlockIndex- the value for theendBlockIndexrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
type
-
citedText
-
documentIndex
Returns the value of thedocumentIndexrecord component.- Returns:
- the value of the
documentIndexrecord component
-
documentTitle
Returns the value of thedocumentTitlerecord component.- Returns:
- the value of the
documentTitlerecord component
-
startCharIndex
Returns the value of thestartCharIndexrecord component.- Returns:
- the value of the
startCharIndexrecord component
-
endCharIndex
Returns the value of theendCharIndexrecord component.- Returns:
- the value of the
endCharIndexrecord component
-
startPageNumber
Returns the value of thestartPageNumberrecord component.- Returns:
- the value of the
startPageNumberrecord component
-
endPageNumber
Returns the value of theendPageNumberrecord component.- Returns:
- the value of the
endPageNumberrecord component
-
startBlockIndex
Returns the value of thestartBlockIndexrecord component.- Returns:
- the value of the
startBlockIndexrecord component
-
endBlockIndex
Returns the value of theendBlockIndexrecord component.- Returns:
- the value of the
endBlockIndexrecord component
-