Package com.sap.ai.sdk.foundationmodels.openai.model

# 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 Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `OpenAiChatMessage.OpenAiChatUserMessage.ContentPart`
  Content part, can be of type `text` or `image_url` when passing in images.
  `static class`
  `OpenAiChatMessage.OpenAiChatUserMessage.ContentPartImage`
  Content part image input, only supported when using the `gpt-4-visual-preview` model.
  `static class`
  `OpenAiChatMessage.OpenAiChatUserMessage.ContentPartText`
  Content part text input.
  `static enum`
  `OpenAiChatMessage.OpenAiChatUserMessage.ImageDetailLevel`
  Specifies 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
  Constructor
  Description
  `OpenAiChatUserMessage()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `OpenAiChatMessage.OpenAiChatUserMessage`
  `addContent(OpenAiChatMessage.OpenAiChatUserMessage.ContentPart... content)`
  Add images or text to the user message.
  `OpenAiChatMessage.OpenAiChatUserMessage`
  `addImage(String content)`
  Add an image to the user message.
  `OpenAiChatMessage.OpenAiChatUserMessage`
  `addImage(String content, OpenAiChatMessage.OpenAiChatUserMessage.ImageDetailLevel detail)`
  Add an image to the user message.
  `OpenAiChatMessage.OpenAiChatUserMessage`
  `addText(String content)`
  Add text to the user message.
  `protected boolean`
  `canEqual(Object other)`
  `boolean`
  `equals(Object o)`
  `List<OpenAiChatMessage.OpenAiChatUserMessage.ContentPart>`
  `getContent()`
  The contents of the user message.
  `String`
  `getRole()`
  The role of the messages author.
  `int`
  `hashCode()`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### OpenAiChatUserMessage

    public OpenAiChatUserMessage()

- ## Method Details

  - ### addText

    @Nonnull public OpenAiChatMessage.OpenAiChatUserMessage addText(@Nonnull String content)
    Add text to the user message.
    Parameters:
      `content` - The text content.
    Returns:
      The user message.

  - ### addImage

    @Nonnull public OpenAiChatMessage.OpenAiChatUserMessage addImage(@Nonnull String content)
    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

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### canEqual

    protected boolean canEqual(Object other)

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getRole

    @Nonnull public String getRole()
    The role of the messages author.
    Specified by:
      `getRole` in interface `OpenAiChatMessage`
    Returns:
      The role of the messages author.

  - ### getContent

    @Nullable public List<OpenAiChatMessage.OpenAiChatUserMessage.ContentPart> getContent()
    The contents of the user message.
    Specified by:
      `getContent` in interface `OpenAiChatMessage`
    Returns:
      The contents of the message.