Class DecisionModelInputUtils
java.lang.Object
dev.langchain4j.internal.DecisionModelInputUtils
Converts chat messages into the input of a
DecisionModel, the same way for
all components that use one.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhasText(UserMessage userMessage) Whether the user message contains text, not only other content such as images.messages(List<ChatMessage> messages) The user and assistant messages withtext, as{"role": "user" | "assistant", "text": ...}maps.static Stringtext(ChatMessage message) The text of a user or assistant message.
-
Method Details
-
text
The text of a user or assistant message. Content of a user message other than text is represented by a marker, such as[attached image]. Other messages, and assistant messages without text, give an empty string. -
hasText
Whether the user message contains text, not only other content such as images. -
messages
The user and assistant messages withtext, as{"role": "user" | "assistant", "text": ...}maps. System messages, tool results, assistant messages with only tool calls and custom messages are left out: they are about how the application works rather than what the user wants, and tool results can be large.
-