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. ChatMessageTypetype()The type of the message. Stringtext()The text of the message. booleanequals(Object o)inthashCode()StringtoString()static CustomMessagefrom(Map<String, Object> attributes)Creates a new custom message. static CustomMessagecustomMessage(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.
-
-
-
-