Class MCPResourceContent.ContentPart

java.lang.Object
com.google.genkit.plugins.mcp.MCPResourceContent.ContentPart
Enclosing class:
MCPResourceContent

public static class MCPResourceContent.ContentPart extends Object
Represents a single part of resource content.
  • Constructor Details

    • ContentPart

      public ContentPart(String text, String blob, String mimeType)
      Creates a new content part.
      Parameters:
      text - the text content (or null for binary)
      blob - the base64-encoded binary content (or null for text)
      mimeType - the MIME type
  • Method Details

    • getText

      public String getText()
      Gets the text content.
      Returns:
      the text, or null if binary
    • getBlob

      public String getBlob()
      Gets the base64-encoded binary content.
      Returns:
      the blob, or null if text
    • getMimeType

      public String getMimeType()
      Gets the MIME type.
      Returns:
      the MIME type
    • isText

      public boolean isText()
      Checks if this part is text.
      Returns:
      true if text
    • isBinary

      public boolean isBinary()
      Checks if this part is binary.
      Returns:
      true if binary