Class OllamaMessage

java.lang.Object
me.neurodock.ollama.OllamaMessage
Direct Known Subclasses:
OllamaMessageToolCall, OllamaToolError, OllamaToolResponse, SystemMessage

public class OllamaMessage extends Object
Represents a message sent by a Tool, Assistant(Ollama), or User.
  • Constructor Details

    • OllamaMessage

      public OllamaMessage(OllamaMessageRole role, String content)
      Creates a new instance of OllamaMessage.
      Parameters:
      role - The role of the message
      content - The content of the message
  • Method Details

    • getRole

      public OllamaMessageRole getRole()
      Returns:
      The role of who sent this "message", represented as OllamaMessageRole
    • getContent

      public String getContent()
      Returns:
      The "message" or content sent by a source
    • toJSON

      public org.json.JSONObject toJSON()