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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumThe role of the message in the conversation.static final recordThe relevant tool call.static final recordThe function definition. -
Constructor Summary
ConstructorsConstructorDescriptionMessage(OllamaApi.Message.Role role, String content, List<String> images, List<OllamaApi.Message.ToolCall> toolCalls) Creates an instance of aMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic OllamaApi.Message.Buildercontent()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.images()Returns the value of theimagesrecord component.role()Returns the value of therolerecord component.Returns the value of thetoolCallsrecord component.final StringtoString()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 aMessagerecord 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 therolerecord component.- Returns:
- the value of the
rolerecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
images
Returns the value of theimagesrecord component.- Returns:
- the value of the
imagesrecord component
-
toolCalls
Returns the value of thetoolCallsrecord component.- Returns:
- the value of the
toolCallsrecord component
-