Record Class OllamaApi.Message
java.lang.Object
java.lang.Record
org.springframework.ai.ollama.api.OllamaApi.Message
- Record Components:
role
- The role of the message of typeOllamaApi.Message.Role
.content
- The content of the message.images
- The list of base64-encoded images to send with the message. Requires multimodal models such as llava or bakllava.toolCalls
- The relevant tool call.
- Enclosing class:
- OllamaApi
public static record OllamaApi.Message(OllamaApi.Message.Role role, String content, List<String> images, List<OllamaApi.Message.ToolCall> toolCalls)
extends Record
Chat message object.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
The role of the message in the conversation.static final record
The relevant tool call.static final record
The function definition. -
Constructor Summary
ConstructorDescriptionMessage
(OllamaApi.Message.Role role, String content, List<String> images, List<OllamaApi.Message.ToolCall> toolCalls) Creates an instance of aMessage
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic OllamaApi.Message.Builder
content()
Returns the value of thecontent
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.images()
Returns the value of theimages
record component.role()
Returns the value of therole
record component.Returns the value of thetoolCalls
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Message
public Message(OllamaApi.Message.Role role, String content, List<String> images, List<OllamaApi.Message.ToolCall> toolCalls) Creates an instance of aMessage
record class.
-
-
Method Details
-
builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
role
Returns the value of therole
record component.- Returns:
- the value of the
role
record component
-
content
Returns the value of thecontent
record component.- Returns:
- the value of the
content
record component
-
images
Returns the value of theimages
record component.- Returns:
- the value of the
images
record component
-
toolCalls
Returns the value of thetoolCalls
record component.- Returns:
- the value of the
toolCalls
record component
-