Package dev.langchain4j.data.message
Class TextFileContent
java.lang.Object
dev.langchain4j.data.message.TextFileContent
- All Implemented Interfaces:
Content
-
Constructor Summary
ConstructorDescriptionTextFileContent
(TextFile textFile) Create a newTextFileContent
from the given text file.TextFileContent
(String url) Create a newTextFileContent
from the given url.TextFileContent
(String base64Data, String mimeType) Create a newTextFileContent
from the given base64 data and mime type.TextFileContent
(URI url) Create a newTextFileContent
from the given url. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static TextFileContent
Create a newTextFileContent
from the given text file.static TextFileContent
Create a newTextFileContent
from the given url.static TextFileContent
Create a newTextFileContent
from the given base64 data and mime type.static TextFileContent
Create a newTextFileContent
from the given url.int
hashCode()
textFile()
Get theTextFile
.toString()
type()
Returns the type of content.
-
Constructor Details
-
TextFileContent
Create a newTextFileContent
from the given url.- Parameters:
url
- the url of the text file.
-
TextFileContent
Create a newTextFileContent
from the given url.- Parameters:
url
- the url of the text file.
-
TextFileContent
Create a newTextFileContent
from 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 newTextFileContent
from the given text file.- Parameters:
textFile
- the text file.
-
-
Method Details
-
type
Description copied from interface:Content
Returns 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 newTextFileContent
from the given url.- Parameters:
url
- the url of the text file.- Returns:
- the new
TextFileContent
.
-
from
Create a newTextFileContent
from the given url.- Parameters:
url
- the url of the text file.- Returns:
- the new
TextFileContent
.
-
from
Create a newTextFileContent
from 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 newTextFileContent
from the given text file.- Parameters:
textFile
- the text file.- Returns:
- the new
TextFileContent
.
-