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