Package dev.langchain4j.data.message
Class TextFileContent
-
- All Implemented Interfaces:
-
dev.langchain4j.data.message.Content
public class TextFileContent implements Content
-
-
Constructor Summary
Constructors Constructor Description TextFileContent(URI url)Create a new TextFileContent from the given url. TextFileContent(String url)Create a new TextFileContent from the given url. TextFileContent(String base64Data, String mimeType)Create a new TextFileContent from the given base64 data and mime type. TextFileContent(TextFile textFile)Create a new TextFileContent from the given text file.
-
Method Summary
Modifier and Type Method Description ContentTypetype()Returns the type of content. TextFiletextFile()Get the TextFile.booleanequals(Object o)inthashCode()StringtoString()static TextFileContentfrom(URI url)Create a new TextFileContent from the given url. static TextFileContentfrom(String url)Create a new TextFileContent from the given url. static TextFileContentfrom(String base64Data, String mimeType)Create a new TextFileContent from the given base64 data and mime type. static TextFileContentfrom(TextFile textFile)Create a new TextFileContent from the given text file. -
-
Constructor Detail
-
TextFileContent
TextFileContent(URI url)
Create a new TextFileContent from the given url.- Parameters:
url- the url of the text file.
-
TextFileContent
TextFileContent(String url)
Create a new TextFileContent from the given url.- Parameters:
url- the url of the text file.
-
TextFileContent
TextFileContent(String base64Data, String mimeType)
Create a new TextFileContent 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
TextFileContent(TextFile textFile)
Create a new TextFileContent from the given text file.- Parameters:
textFile- the text file.
-
-
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 TextFileContent from(URI url)
Create a new TextFileContent from the given url.
- Parameters:
url- the url of the text file.- Returns:
the new TextFileContent.
-
from
static TextFileContent from(String url)
Create a new TextFileContent from the given url.
- Parameters:
url- the url of the text file.- Returns:
the new TextFileContent.
-
from
static TextFileContent from(String base64Data, String mimeType)
Create a new TextFileContent 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
static TextFileContent from(TextFile textFile)
Create a new TextFileContent from the given text file.
- Parameters:
textFile- the text file.- Returns:
the new TextFileContent.
-
-
-
-