Package dev.langchain4j.data.message
Class CustomMessage
-
- All Implemented Interfaces:
-
dev.langchain4j.data.message.ChatMessage
public class CustomMessage implements ChatMessage
Represents a custom message. Can be used only with ChatLanguageModel implementations that support this type of message.
-
-
Constructor Summary
Constructors Constructor Description CustomMessage(Map<String, Object> attributes)
Creates a new custom message.
-
Method Summary
Modifier and Type Method Description Map<String, Object>
attributes()
Returns the message attributes. ChatMessageType
type()
The type of the message. String
text()
The text of the message. boolean
equals(Object o)
int
hashCode()
String
toString()
static CustomMessage
from(Map<String, Object> attributes)
Creates a new custom message. static CustomMessage
customMessage(Map<String, Object> attributes)
Creates a new custom message. -
-
Method Detail
-
attributes
Map<String, Object> attributes()
Returns the message attributes.
- Returns:
the message attributes.
-
type
ChatMessageType type()
The type of the message.
- Returns:
the type of the message
-
hashCode
int hashCode()
-
from
static CustomMessage from(Map<String, Object> attributes)
Creates a new custom message.
- Parameters:
attributes
- the message attributes.- Returns:
the custom message.
-
customMessage
static CustomMessage customMessage(Map<String, Object> attributes)
Creates a new custom message.
- Parameters:
attributes
- the message attributes.- Returns:
the custom message.
-
-
-
-