Package com.github.copilot.sdk.json
Class ToolBinaryResult
java.lang.Object
com.github.copilot.sdk.json.ToolBinaryResult
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");
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()Gets the base64-encoded binary data.Gets the description of the binary content.Gets the MIME type of the binary data.getType()Gets the type of binary content.Sets the base64-encoded binary data.setDescription(String description) Sets a description of the binary content.setMimeType(String mimeType) Sets the MIME type of the binary data.Sets the type of binary content.
-
Constructor Details
-
ToolBinaryResult
public ToolBinaryResult()
-
-
Method Details
-
getData
Gets the base64-encoded binary data.- Returns:
- the base64-encoded data string
-
setData
Sets the base64-encoded binary data.- Parameters:
data- the base64-encoded data- Returns:
- this result for method chaining
-
getMimeType
Gets the MIME type of the binary data.- Returns:
- the MIME type (e.g., "image/png", "application/pdf")
-
setMimeType
Sets the MIME type of the binary data.- Parameters:
mimeType- the MIME type- Returns:
- this result for method chaining
-
getType
Gets the type of binary content.- Returns:
- the content type (e.g., "image", "file")
-
setType
Sets the type of binary content.- Parameters:
type- the content type- Returns:
- this result for method chaining
-
getDescription
Gets the description of the binary content.- Returns:
- the content description
-
setDescription
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
-