类 TextContent

java.lang.Object
dev.langchain4j.data.message.TextContent
所有已实现的接口:
Content

public class TextContent extends Object implements Content
Represents a text content.
  • 构造器详细资料

    • TextContent

      public TextContent(String text)
      Creates a new text content.
      参数:
      text - the text.
  • 方法详细资料

    • text

      public String text()
      Returns the text.
      返回:
      the text.
    • type

      public ContentType type()
      从接口复制的说明: Content
      Returns the type of content.

      Can be used to cast the content to the correct type.

      指定者:
      type 在接口中 Content
      返回:
      The type of content.
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • from

      public static TextContent from(String text)
      Creates a new text content.
      参数:
      text - the text.
      返回:
      the text content.