Class OpenAiUserMessage
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.OpenAiUserMessage
- All Implemented Interfaces:
OpenAiMessage
Represents a chat message as 'user' to OpenAI service. *
- Since:
- 1.4.0
-
Method Summary
Modifier and TypeMethodDescriptioncontent()The content of the message.booleaninthashCode()role()The role associated with this message.toString()Add an image to the message with the given image URL.withImage(String imageUrl, OpenAiImageItem.DetailLevel detailLevel) Add an image to the message with the given image URL and detail level.Add text to the message.
-
Method Details
-
withText
Add text to the message.- Parameters:
message- the text to add.- Returns:
- the new message.
-
withImage
@Nonnull public OpenAiUserMessage withImage(@Nonnull String imageUrl, @Nonnull OpenAiImageItem.DetailLevel detailLevel) Add an image to the message with the given image URL and detail level.- Parameters:
imageUrl- the URL of the image.detailLevel- the detail level of the image.- Returns:
- the new message.
-
withImage
Add an image to the message with the given image URL.- Parameters:
imageUrl- the URL of the image.- Returns:
- the new message.
-
role
The role associated with this message.- Specified by:
rolein interfaceOpenAiMessage- Returns:
- the role.
-
equals
-
hashCode
public int hashCode() -
toString
-
content
The content of the message.- Specified by:
contentin interfaceOpenAiMessage- Returns:
- the content.
-