Package com.sap.ai.sdk.orchestration
Class SystemMessage
java.lang.Object
com.sap.ai.sdk.orchestration.SystemMessage
- All Implemented Interfaces:
Message
Represents a chat message as 'system' to the orchestration service.
-
Constructor Summary
ConstructorsConstructorDescriptionSystemMessage(String message) Creates a new system message from a string.SystemMessage(String message, CacheControl cacheControl) Creates a new system message from a string, allows for cache checkpoint configuration -
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.toString()Add text to the message.withText(String message, CacheControl cacheControl) Add text to the message
-
Constructor Details
-
SystemMessage
Creates a new system message from a string.- Parameters:
message- the first message.
-
SystemMessage
Creates a new system message from a string, allows for cache checkpoint configuration- Parameters:
message- the first message.cacheControl- prompt caching configuration to use, nullable- Since:
- 1.23.0
-
-
Method Details
-
withText
Add text to the message.- Parameters:
message- the text to add.- Returns:
- the new message.
- Since:
- 1.3.0
-
withText
@Nonnull public SystemMessage withText(@Nonnull String message, @Nullable CacheControl cacheControl) Add text to the message- Parameters:
message- the text to addcacheControl- optional cache checkpoint configuration- Returns:
- the new message
- Since:
- 1.23.0
-
createChatMessage
Description copied from interface:MessageConverts the message to a serializable ChatMessage object.- Specified by:
createChatMessagein interfaceMessage- Returns:
- the corresponding
ChatMessageobject.
-
role
The role of the assistant. -
equals
-
hashCode
public int hashCode() -
toString
-
content
The content of the message.
-