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 ContentType
type()
Returns the type of content. TextFile
textFile()
Get the TextFile
.boolean
equals(Object o)
int
hashCode()
String
toString()
static TextFileContent
from(URI url)
Create a new TextFileContent from the given url. static TextFileContent
from(String url)
Create a new TextFileContent from the given url. static TextFileContent
from(String base64Data, String mimeType)
Create a new TextFileContent from the given base64 data and mime type. static TextFileContent
from(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.
-
-
-
-