Class OpenAiChatMessage.OpenAiChatUserMessage
java.lang.Object
com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatMessage.OpenAiChatUserMessage
- All Implemented Interfaces:
OpenAiChatMessage
- Enclosing interface:
OpenAiChatMessage
public static class OpenAiChatMessage.OpenAiChatUserMessage
extends Object
implements OpenAiChatMessage
OpenAI user message.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContent part, can be of type `text` or `image_url` when passing in images.static classContent part image input, only supported when using the `gpt-4-visual-preview` model.static classContent part text input.static enumSpecifies the detail level of the image.Nested classes/interfaces inherited from interface com.sap.ai.sdk.foundationmodels.openai.model.OpenAiChatMessage
OpenAiChatMessage.OpenAiChatAssistantMessage, OpenAiChatMessage.OpenAiChatFunctionMessage, OpenAiChatMessage.OpenAiChatSystemMessage, OpenAiChatMessage.OpenAiChatToolMessage, OpenAiChatMessage.OpenAiChatUserMessage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd images or text to the user message.Add an image to the user message.addImage(String content, OpenAiChatMessage.OpenAiChatUserMessage.ImageDetailLevel detail) Add an image to the user message.Add text to the user message.protected booleanbooleanThe contents of the user message.getRole()The role of the messages author.inthashCode()toString()
-
Constructor Details
-
OpenAiChatUserMessage
public OpenAiChatUserMessage()
-
-
Method Details
-
addText
Add text to the user message.- Parameters:
content- The text content.- Returns:
- The user message.
-
addImage
Add an image to the user message.- Parameters:
content- The image URL.- Returns:
- The user message.
-
addImage
@Nonnull public OpenAiChatMessage.OpenAiChatUserMessage addImage(@Nonnull String content, @Nullable OpenAiChatMessage.OpenAiChatUserMessage.ImageDetailLevel detail) Add an image to the user message.- Parameters:
content- The image URL.detail- The detail level of the image.- Returns:
- The user message.
-
addContent
@Nonnull public OpenAiChatMessage.OpenAiChatUserMessage addContent(@Nonnull OpenAiChatMessage.OpenAiChatUserMessage.ContentPart... content) Add images or text to the user message.- Parameters:
content- The content(s) to add.- Returns:
- The user message.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getRole
The role of the messages author.- Specified by:
getRolein interfaceOpenAiChatMessage- Returns:
- The role of the messages author.
-
getContent
The contents of the user message.- Specified by:
getContentin interfaceOpenAiChatMessage- Returns:
- The contents of the message.
-