Package dev.langchain4j.data.message
Class PdfFileContent
-
- All Implemented Interfaces:
-
dev.langchain4j.data.message.Content
public class PdfFileContent implements Content
-
-
Constructor Summary
Constructors Constructor Description PdfFileContent(URI url)Create a new PdfFileContent from the given url. PdfFileContent(String url)Create a new PdfFileContent from the given url. PdfFileContent(String base64Data, String mimeType)Create a new PdfFileContent from the given base64 data and mime type. PdfFileContent(PdfFile pdfFile)Create a new PdfFileContent from the given PDF file.
-
Method Summary
Modifier and Type Method Description ContentTypetype()Returns the type of content. PdfFilepdfFile()Get the PdfFile.booleanequals(Object o)inthashCode()StringtoString()static PdfFileContentfrom(URI url)Create a new PdfFileContent from the given url. static PdfFileContentfrom(String url)Create a new PdfFileContent from the given url. static PdfFileContentfrom(String base64Data, String mimeType)Create a new PdfFileContent from the given base64 data and mime type. static PdfFileContentfrom(PdfFile pdfFile)Create a new PdfFileContent from the given PDF. -
-
Constructor Detail
-
PdfFileContent
PdfFileContent(URI url)
Create a new PdfFileContent from the given url.- Parameters:
url- the url of the PDF.
-
PdfFileContent
PdfFileContent(String url)
Create a new PdfFileContent from the given url.- Parameters:
url- the url of the PDF.
-
PdfFileContent
PdfFileContent(String base64Data, String mimeType)
Create a new PdfFileContent from the given base64 data and mime type.- Parameters:
base64Data- the base64 data of the PDF.mimeType- the mime type of the PDF.
-
PdfFileContent
PdfFileContent(PdfFile pdfFile)
Create a new PdfFileContent from the given PDF file.- Parameters:
pdfFile- the PDF.
-
-
Method Detail
-
type
ContentType type()
Returns the type of content.
Can be used to cast the content to the correct type.
- Returns:
The type of content.
-
hashCode
int hashCode()
-
from
static PdfFileContent from(URI url)
Create a new PdfFileContent from the given url.
- Parameters:
url- the url of the PDF.- Returns:
the new PdfFileContent.
-
from
static PdfFileContent from(String url)
Create a new PdfFileContent from the given url.
- Parameters:
url- the url of the PDF.- Returns:
the new PdfFileContent.
-
from
static PdfFileContent from(String base64Data, String mimeType)
Create a new PdfFileContent 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
static PdfFileContent from(PdfFile pdfFile)
Create a new PdfFileContent from the given PDF.
- Parameters:
pdfFile- the PDF.- Returns:
the new PdfFileContent.
-
-
-
-