Package org.springframework.ai.anthropic
Class AnthropicCitationDocument.Builder
java.lang.Object
org.springframework.ai.anthropic.AnthropicCitationDocument.Builder
- Enclosing class:
- AnthropicCitationDocument
Builder class for AnthropicCitationDocument.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the AnthropicCitationDocument.citationsEnabled(boolean enabled) Enable or disable citations for this document.Set the document context.customContent(String... textBlocks) Create a custom content document from text blocks.pdf(byte[] pdfBytes) Create a PDF document from byte array.Create a PDF document from file path.Create a plain text document.Set the document title.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
plainText
Create a plain text document.- Parameters:
text- the document text content- Returns:
- builder for method chaining
-
pdf
Create a PDF document from byte array.- Parameters:
pdfBytes- the PDF file content as bytes- Returns:
- builder for method chaining
-
pdfFile
Create a PDF document from file path.- Parameters:
filePath- path to the PDF file- Returns:
- builder for method chaining
- Throws:
IOException- if file cannot be read
-
customContent
Create a custom content document from text blocks.- Parameters:
textBlocks- variable number of text strings to create content blocks- Returns:
- builder for method chaining
-
title
Set the document title.- Parameters:
title- document title for reference- Returns:
- builder for method chaining
-
context
Set the document context.- Parameters:
context- additional context about the document- Returns:
- builder for method chaining
-
citationsEnabled
Enable or disable citations for this document.- Parameters:
enabled- whether citations should be enabled- Returns:
- builder for method chaining
-
build
Build the AnthropicCitationDocument.- Returns:
- configured citation document
-