Package dev.langchain4j.data.message
Class PdfFileContent
java.lang.Object
dev.langchain4j.data.message.PdfFileContent
- All Implemented Interfaces:
Content
-
Constructor Summary
ConstructorDescriptionPdfFileContent
(PdfFile pdfFile) Create a newPdfFileContent
from the given PDF file.PdfFileContent
(String url) Create a newPdfFileContent
from the given url.PdfFileContent
(String base64Data, String mimeType) Create a newPdfFileContent
from the given base64 data and mime type.PdfFileContent
(URI url) Create a newPdfFileContent
from the given url. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static PdfFileContent
Create a newPdfFileContent
from the given PDF.static PdfFileContent
Create a newPdfFileContent
from the given url.static PdfFileContent
Create a newPdfFileContent
from the given base64 data and mime type.static PdfFileContent
Create a newPdfFileContent
from the given url.int
hashCode()
pdfFile()
Get thePdfFile
.toString()
type()
Returns the type of content.
-
Constructor Details
-
PdfFileContent
Create a newPdfFileContent
from the given url.- Parameters:
url
- the url of the PDF.
-
PdfFileContent
Create a newPdfFileContent
from the given url.- Parameters:
url
- the url of the PDF.
-
PdfFileContent
Create a newPdfFileContent
from the given base64 data and mime type.- Parameters:
base64Data
- the base64 data of the PDF.mimeType
- the mime type of the PDF.
-
PdfFileContent
Create a newPdfFileContent
from the given PDF file.- Parameters:
pdfFile
- the PDF.
-
-
Method Details
-
type
Description copied from interface:Content
Returns the type of content.Can be used to cast the content to the correct type.
-
pdfFile
Get thePdfFile
.- Returns:
- the
PdfFile
.
-
equals
-
hashCode
public int hashCode() -
toString
-
from
Create a newPdfFileContent
from the given url.- Parameters:
url
- the url of the PDF.- Returns:
- the new
PdfFileContent
.
-
from
Create a newPdfFileContent
from the given url.- Parameters:
url
- the url of the PDF.- Returns:
- the new
PdfFileContent
.
-
from
Create a newPdfFileContent
from the given base64 data and mime type.- Parameters:
base64Data
- the base64 data of the PDF.mimeType
- the mime type of the PDF.- Returns:
- the new
PdfFileContent
.
-
from
Create a newPdfFileContent
from the given PDF.- Parameters:
pdfFile
- the PDF.- Returns:
- the new
PdfFileContent
.
-