Package com.sap.ai.sdk.orchestration
Interface Message
- All Known Implementing Classes:
AssistantMessage,SystemMessage,ToolMessage,UserMessage
Interface representing convenience wrappers of chat message to the orchestration service.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AssistantMessageA convenience method to create an assistant message.content()Returns the content of the message.Converts the message to a serializable ChatMessage object.role()Returns the role of the assistant.static SystemMessageA convenience method to create a system message from a string.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 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
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.
-
createChatMessage
Converts the message to a serializable ChatMessage object.- Returns:
- the corresponding
ChatMessageobject.
-
role
Returns the role of the assistant.- Returns:
- the role.
-
content
Returns the content of the message.- Returns:
- the content.
-