Class ToolBinaryResult

java.lang.Object
com.github.copilot.sdk.json.ToolBinaryResult

public final class ToolBinaryResult extends Object
Binary result from a tool execution.

This class represents binary data (such as images) returned by a tool. The data is base64-encoded for JSON transmission.

Example Usage


 var binaryResult = new ToolBinaryResult().setType("image").setMimeType("image/png")
 		.setData(Base64.getEncoder().encodeToString(imageBytes)).setDescription("Generated chart");
 
Since:
1.0.0
See Also:
  • Constructor Details

    • ToolBinaryResult

      public ToolBinaryResult()
  • Method Details

    • getData

      public String getData()
      Gets the base64-encoded binary data.
      Returns:
      the base64-encoded data string
    • setData

      public ToolBinaryResult setData(String data)
      Sets the base64-encoded binary data.
      Parameters:
      data - the base64-encoded data
      Returns:
      this result for method chaining
    • getMimeType

      public String getMimeType()
      Gets the MIME type of the binary data.
      Returns:
      the MIME type (e.g., "image/png", "application/pdf")
    • setMimeType

      public ToolBinaryResult setMimeType(String mimeType)
      Sets the MIME type of the binary data.
      Parameters:
      mimeType - the MIME type
      Returns:
      this result for method chaining
    • getType

      public String getType()
      Gets the type of binary content.
      Returns:
      the content type (e.g., "image", "file")
    • setType

      public ToolBinaryResult setType(String type)
      Sets the type of binary content.
      Parameters:
      type - the content type
      Returns:
      this result for method chaining
    • getDescription

      public String getDescription()
      Gets the description of the binary content.
      Returns:
      the content description
    • setDescription

      public ToolBinaryResult setDescription(String description)
      Sets a description of the binary content.

      This helps the assistant understand the content.

      Parameters:
      description - the content description
      Returns:
      this result for method chaining