Class OllamaChatMessage

java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.ollama.OllamaChatMessage
All Implemented Interfaces:
IChatMessage

public class OllamaChatMessage extends Object implements IChatMessage
Represents a chat message exchanged with the Ollama model. The OllamaChatMessage class implements IChatMessage and encapsulates the role and content of a message in the chat context.
  • Constructor Details

    • OllamaChatMessage

      public OllamaChatMessage()
      Default constructor for creating an empty OllamaChatMessage.
    • OllamaChatMessage

      public OllamaChatMessage(Role role, String content)
      Constructs a new OllamaChatMessage with the specified role and content.
      Parameters:
      role - the role of the message (e.g., Role.USER, Role.SYSTEM).
      content - the content of the message.
  • Method Details

    • getContent

      public String getContent()
      Retrieves the content of the message.
      Returns:
      the content of the message as a String.
    • getMessage

      public String getMessage()
      Retrieves the message content. This is the implementation of the IChatMessage.getMessage() method.
      Specified by:
      getMessage in interface IChatMessage
      Returns:
      the message content as a String.
    • getRole

      public Role getRole()
      Retrieves the role associated with the message. This is the implementation of the IChatMessage.getRole() method.
      Specified by:
      getRole in interface IChatMessage
      Returns:
      the role of the message as a Role.
    • setContent

      public void setContent(String content)
      Sets the content of the message.
      Parameters:
      content - the new content of the message.
    • setRole

      public void setRole(Role role)
      Sets the role of the message.
      Parameters:
      role - the new role of the message (e.g., Role.USER, Role.SYSTEM).