Class OllamaMessage
java.lang.Object
me.neurodock.ollama.OllamaMessage
- Direct Known Subclasses:
OllamaMessageToolCall, OllamaToolError, OllamaToolResponse, SystemMessage
Represents a message sent by a Tool, Assistant(Ollama), or User.
-
Constructor Summary
ConstructorsConstructorDescriptionOllamaMessage(OllamaMessageRole role, String content) Creates a new instance of OllamaMessage.OllamaMessage(OllamaMessageRole role, String content, @NotNull Image... images) Creates a new instance of OllamaMessage. -
Method Summary
-
Constructor Details
-
OllamaMessage
Creates a new instance of OllamaMessage.- Parameters:
role- The role of the messagecontent- The content of the message
-
OllamaMessage
public OllamaMessage(OllamaMessageRole role, String content, @NotNull @NotNull Image... images) throws IOException Creates a new instance of OllamaMessage.- Parameters:
role- The role of the messagecontent- The content of the messageimages- The image of the message- Throws:
IOException- if an error occurs during writing or when not able to create the required ImageOutputStream.
-
-
Method Details
-
getRole
- Returns:
- The role of who sent this "message", represented as
OllamaMessageRole
-
getContent
- Returns:
- The "message" or content sent by a source
-
toJSON
public org.json.JSONObject toJSON()
-