Interface PrintMessageHandler

All Superinterfaces:
PrintAdvanceMessageHandler

public interface PrintMessageHandler extends PrintAdvanceMessageHandler
Represents a PrintMessageHandler. The Core uses this to print messages to the user or API Clients.
  • Method Details

    • printMessage

      void printMessage(String message)
      Handles the printing of a message. This is meant to output the message to the user or API Client.
      Parameters:
      message - The message to be printed.
    • printMessage

      default void printMessage(OllamaMessage message)
      This is a default implementation when wrapping PrintAdvanceMessageHandler to this "simpler" PrintMessageHandler
      Specified by:
      printMessage in interface PrintAdvanceMessageHandler
      Parameters:
      message - The OllamaMessage requested to be printed from a veriity of sources, see OllamaMessageRole
    • color

      boolean color()
      Gets if color is supported by the PrintMessageHandler. This uses ANSI escape codes to color the output.
      Returns:
      a boolean indicating if color is supported by the PrintMessageHandler.
    • printError

      default void printError(String message)
      Default method to print error messages to the user or API Client. This uses ANSI escape codes to color the output red if color is supported.
      Parameters:
      message - The error message to be printed. If color is not supported, it will print the message without color.
    • printErrorMessage

      default void printErrorMessage(OllamaMessage errorMessage)
      This is a default implementation when wrapping PrintAdvanceMessageHandler to this "simpler" PrintMessageHandler Default method to print error messages to the user or API Client. This uses ANSI escape codes to color the output red if color is supported.
      Specified by:
      printErrorMessage in interface PrintAdvanceMessageHandler
      Parameters:
      errorMessage - The error message to be printed. If color is not supported, it will print the message without color.
    • printToolCalling

      default void printToolCalling(String representation)
      Description copied from interface: PrintAdvanceMessageHandler
      Used when a tool is to have it's calling rendered
      Specified by:
      printToolCalling in interface PrintAdvanceMessageHandler
      Parameters:
      representation - the string to be printed