Record Class TextChatMessage.TextChatMessageAssistant
java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.watsonx.bean.TextChatMessage.TextChatMessageAssistant
- All Implemented Interfaces:
TextChatMessage
- Enclosing interface:
TextChatMessage
public static record TextChatMessage.TextChatMessageAssistant(String role, String content, List<TextChatMessage.TextChatToolCall> toolCalls)
extends Record
implements TextChatMessage
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkiverse.langchain4j.watsonx.bean.TextChatMessage
TextChatMessage.StreamingToolFetcher, TextChatMessage.TextChatMessageAssistant, TextChatMessage.TextChatMessageSystem, TextChatMessage.TextChatMessageTool, TextChatMessage.TextChatMessageUser, TextChatMessage.TextChatParameterTool, TextChatMessage.TextChatToolCall
-
Constructor Summary
ConstructorsConstructorDescriptionTextChatMessageAssistant
(String role, String content, List<TextChatMessage.TextChatToolCall> toolCalls) Creates an instance of aTextChatMessageAssistant
record class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()
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.of
(dev.langchain4j.data.message.AiMessage aiMessage) Creates aTextChatMessage.TextChatMessageAssistant
from aAiMessage
.Creates aTextChatMessage.TextChatMessageAssistant
.of
(List<TextChatMessage.TextChatToolCall> toolCalls) Creates aTextChatMessage.TextChatMessageAssistant
.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
-
TextChatMessageAssistant
public TextChatMessageAssistant(String role, String content, List<TextChatMessage.TextChatToolCall> toolCalls) Creates an instance of aTextChatMessageAssistant
record class.- Parameters:
role
- the value for therole
record componentcontent
- the value for thecontent
record componenttoolCalls
- the value for thetoolCalls
record component
-
-
Method Details
-
of
public static TextChatMessage.TextChatMessageAssistant of(dev.langchain4j.data.message.AiMessage aiMessage) Creates aTextChatMessage.TextChatMessageAssistant
from aAiMessage
.- Parameters:
aiMessage
- the ai message to convert- Returns:
- the created
TextChatMessage.TextChatMessageAssistant
-
of
Creates aTextChatMessage.TextChatMessageAssistant
.- Parameters:
message
- the content of the system message to be created.- Returns:
- the created
TextChatMessage.TextChatMessageAssistant
.
-
of
public static TextChatMessage.TextChatMessageAssistant of(List<TextChatMessage.TextChatToolCall> toolCalls) Creates aTextChatMessage.TextChatMessageAssistant
.- Parameters:
toolCalls
- the tools to execute.- Returns:
- the created
TextChatMessage.TextChatMessageAssistant
.
-
toString
-
hashCode
-
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
-
toolCalls
Returns the value of thetoolCalls
record component.- Returns:
- the value of the
toolCalls
record component
-