Package dev.langchain4j.data.message
Class TextFileContent
java.lang.Object
dev.langchain4j.data.message.TextFileContent
- All Implemented Interfaces:
Content
-
Constructor Summary
ConstructorsConstructorDescriptionTextFileContent(TextFile textFile) Create a newTextFileContentfrom the given text file.TextFileContent(String url) Create a newTextFileContentfrom the given url.TextFileContent(String base64Data, String mimeType) Create a newTextFileContentfrom the given base64 data and mime type.TextFileContent(URI url) Create a newTextFileContentfrom the given url. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TextFileContentCreate a newTextFileContentfrom the given text file.static TextFileContentCreate a newTextFileContentfrom the given url.static TextFileContentCreate a newTextFileContentfrom the given base64 data and mime type.static TextFileContentCreate a newTextFileContentfrom the given url.inthashCode()textFile()Get theTextFile.toString()type()Returns the type of content.
-
Constructor Details
-
TextFileContent
Create a newTextFileContentfrom the given url.- Parameters:
url- the url of the text file.
-
TextFileContent
Create a newTextFileContentfrom the given url.- Parameters:
url- the url of the text file.
-
TextFileContent
Create a newTextFileContentfrom the given base64 data and mime type.- Parameters:
base64Data- the base64 data of the text file.mimeType- the mime type of the text file.
-
TextFileContent
Create a newTextFileContentfrom the given text file.- Parameters:
textFile- the text file.
-
-
Method Details
-
type
Description copied from interface:ContentReturns the type of content.Can be used to cast the content to the correct type.
-
textFile
Get theTextFile.- Returns:
- the
TextFile.
-
equals
-
hashCode
public int hashCode() -
toString
-
from
Create a newTextFileContentfrom the given url.- Parameters:
url- the url of the text file.- Returns:
- the new
TextFileContent.
-
from
Create a newTextFileContentfrom the given url.- Parameters:
url- the url of the text file.- Returns:
- the new
TextFileContent.
-
from
Create a newTextFileContentfrom the given base64 data and mime type.- Parameters:
base64Data- the base64 data of the text file.mimeType- the mime type of the text file.- Returns:
- the new
TextFileContent.
-
from
Create a newTextFileContentfrom the given text file.- Parameters:
textFile- the text file.- Returns:
- the new
TextFileContent.
-