Package dev.langchain4j.data.message
Class CustomMessage
java.lang.Object
dev.langchain4j.data.message.CustomMessage
- All Implemented Interfaces:
ChatMessage
Represents a custom message.
Can be used only with
ChatLanguageModel
implementations that support this type of message.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the message attributes.static CustomMessage
customMessage
(Map<String, Object> attributes) Creates a new custom message.boolean
static CustomMessage
Creates a new custom message.int
hashCode()
text()
The text of the message.toString()
type()
The type of the message.
-
Constructor Details
-
CustomMessage
Creates a new custom message.- Parameters:
attributes
- the message attributes.
-
-
Method Details
-
attributes
Returns the message attributes.- Returns:
- the message attributes.
-
type
Description copied from interface:ChatMessage
The type of the message.- Specified by:
type
in interfaceChatMessage
- Returns:
- the type of the message
-
text
Description copied from interface:ChatMessage
The text of the message.- Specified by:
text
in interfaceChatMessage
- Returns:
- the text of the message
-
equals
-
hashCode
public int hashCode() -
toString
-
from
Creates a new custom message.- Parameters:
attributes
- the message attributes.- Returns:
- the custom message.
-
customMessage
Creates a new custom message.- Parameters:
attributes
- the message attributes.- Returns:
- the custom message.
-