Package com.sap.ai.sdk.orchestration
Class AssistantMessage
java.lang.Object
com.sap.ai.sdk.orchestration.AssistantMessage
- All Implemented Interfaces:
Message
Represents a chat message as 'assistant' to the orchestration service.
-
Constructor Summary
ConstructorsConstructorDescriptionAssistantMessage(String singleMessage) Creates a new assistant message with the given single message.AssistantMessage(List<MessageToolCall> toolCalls) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptioncontent()The content of the message.Converts the message to a serializable ChatMessage object.booleaninthashCode()role()The role of the assistant.Tool call if there is any.toString()withToolCalls(List<MessageToolCall> toolCalls) Returns a new AssistantMessage instance with the provided tool calls added to the existing ones.
-
Constructor Details
-
AssistantMessage
Creates a new assistant message with the given single message.- Parameters:
singleMessage- the single message.
-
AssistantMessage
Deprecated.Please usewithToolCalls(List)instead.Creates a new assistant message with the given tool calls.- Parameters:
toolCalls- list of tool call objects
-
-
Method Details
-
withToolCalls
Returns a new AssistantMessage instance with the provided tool calls added to the existing ones.- Parameters:
toolCalls- the list of tool calls to add.- Returns:
- a new AssistantMessage instance with the combined tool calls.
-
createChatMessage
Description copied from interface:MessageConverts the message to a serializable ChatMessage object.- Specified by:
createChatMessagein interfaceMessage- Returns:
- the corresponding
ChatMessageobject.
-
equals
-
hashCode
public int hashCode() -
toString
-
role
The role of the assistant. -
toolCalls
Tool call if there is any. -
content
The content of the message.
-
withToolCalls(List)instead.