Interface Message.Builder

All Superinterfaces:
Buildable, CopyableBuilder<Message.Builder,Message>, SdkBuilder<Message.Builder,Message>, SdkPojo
Enclosing class:
Message

public static interface Message.Builder extends SdkPojo, CopyableBuilder<Message.Builder,Message>
  • Method Details

    • role

      Message.Builder role(String role)

      The role that the message plays in the message.

      Parameters:
      role - The role that the message plays in the message.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • role

      The role that the message plays in the message.

      Parameters:
      role - The role that the message plays in the message.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • content

      The message content. Note the following restrictions:

      • You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.

      • You can include up to five documents. Each document's size must be no more than 4.5 MB.

      • If you include a ContentBlock with a document field in the array, you must also include a ContentBlock with a text field.

      • You can only include images and documents if the role is user.

      Parameters:
      content - The message content. Note the following restrictions:

      • You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.

      • You can include up to five documents. Each document's size must be no more than 4.5 MB.

      • If you include a ContentBlock with a document field in the array, you must also include a ContentBlock with a text field.

      • You can only include images and documents if the role is user.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • content

      Message.Builder content(ContentBlock... content)

      The message content. Note the following restrictions:

      • You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.

      • You can include up to five documents. Each document's size must be no more than 4.5 MB.

      • If you include a ContentBlock with a document field in the array, you must also include a ContentBlock with a text field.

      • You can only include images and documents if the role is user.

      Parameters:
      content - The message content. Note the following restrictions:

      • You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.

      • You can include up to five documents. Each document's size must be no more than 4.5 MB.

      • If you include a ContentBlock with a document field in the array, you must also include a ContentBlock with a text field.

      • You can only include images and documents if the role is user.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • content

      The message content. Note the following restrictions:

      • You can include up to 20 images. Each image's size, height, and width must be no more than 3.75 MB, 8000 px, and 8000 px, respectively.

      • You can include up to five documents. Each document's size must be no more than 4.5 MB.

      • If you include a ContentBlock with a document field in the array, you must also include a ContentBlock with a text field.

      • You can only include images and documents if the role is user.

      This is a convenience method that creates an instance of the ContentBlock.Builder avoiding the need to create one manually via ContentBlock.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to content(List<ContentBlock>).

      Parameters:
      content - a consumer that will call methods on ContentBlock.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: