Package com.sap.ai.sdk.orchestration
Class Message
java.lang.Object
com.sap.ai.sdk.orchestration.Message
- Direct Known Subclasses:
AssistantMessage,SystemMessage,ToolMessage,UserMessage
Contract-representing class for convenience wrappers of chat message to the orchestration
service.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AssistantMessageA convenience method to create an assistant message.protected booleanabstract MessageContentcontent()Returns the content of the message.booleaninthashCode()abstract Stringrole()Returns the role of the assistant.static SystemMessageA convenience method to create a system message from a string.static SystemMessagesystem(String message, CacheControl cacheControl) A convenience method to create a system message from a string allowing to configure cache checkpoint.static UserMessageA convenience method to create a user message containing only an image.static UserMessageA convenience method to create a user message from a string.static UserMessageuser(String message, CacheControl cacheControl) A convenience method to create a user message from a string.static UserMessageA convenience method to create a user message containing only a file loaded from disk.
-
Method Details
-
user
A convenience method to create a user message from a string.- Parameters:
message- the message content.- Returns:
- the user message.
-
user
@Nonnull public static UserMessage user(@Nonnull String message, @Nullable CacheControl cacheControl) A convenience method to create a user message from a string.- Parameters:
message- the message content.cacheControl- cache checkpoint configuration.- Returns:
- the user message.
- Since:
- 1.23.0
-
user
A convenience method to create a user message containing only an image.- Parameters:
imageItem- the message content.- Returns:
- the user message.
- Since:
- 1.3.0
-
user
A convenience method to create a user message containing only a file loaded from disk.- Parameters:
filePath- the path to a local file.- Returns:
- the user message.
- Since:
- 1.18.0
-
assistant
A convenience method to create an assistant message.- Parameters:
message- the message content.- Returns:
- the assistant message.
-
system
A convenience method to create a system message from a string.- Parameters:
message- the message content.- Returns:
- the system message.
-
system
@Nonnull public static SystemMessage system(@Nonnull String message, @Nullable CacheControl cacheControl) A convenience method to create a system message from a string allowing to configure cache checkpoint.- Parameters:
message- the message content.cacheControl- optional cache checkpoint configuration.- Returns:
- the system message.
- Since:
- 1.23.0
-
role
Returns the role of the assistant.- Returns:
- the role.
-
content
Returns the content of the message.- Returns:
- the content.
-
equals
-
canEqual
-
hashCode
public int hashCode()
-