Class DecisionModelInputUtils

java.lang.Object
dev.langchain4j.internal.DecisionModelInputUtils

public class DecisionModelInputUtils extends Object
Converts chat messages into the input of a DecisionModel, the same way for all components that use one.
  • Method Details

    • text

      public static String text(ChatMessage message)
      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

      public static boolean hasText(UserMessage userMessage)
      Whether the user message contains text, not only other content such as images.
    • messages

      public static List<Map<String,String>> messages(List<ChatMessage> messages)
      The user and assistant messages with text, 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.