# Class TextPart

java.lang.Object
com.codename1.ai.MessagePart
com.codename1.ai.TextPart

public final class TextPart extends MessagePart
A plain-text fragment of a `ChatMessage`. Text content within a multimodal `ChatMessage`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TextPart(String text)`
  Creates a text part.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getText()`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TextPart

    public TextPart(String text)
    Creates a text part.
    Parameters:
      `text` - text sent to or received from the model

- ## Method Details

  - ### getText

    public String getText()
    Returns:
      text carried by this part