Package com.github.copilot.sdk.json
Record Class ToolBinaryResult
java.lang.Object
java.lang.Record
com.github.copilot.sdk.json.ToolBinaryResult
- Record Components:
data- the base64-encoded binary datamimeType- the MIME type (e.g., "image/png", "application/pdf")type- the content type (e.g., "image", "file")description- the content description, helps the assistant understand the content
public record ToolBinaryResult(String data, String mimeType, String type, String description)
extends Record
Binary result from a tool execution.
This record represents binary data (such as images) returned by a tool. The data is base64-encoded for JSON transmission.
Example Usage
var binaryResult = new ToolBinaryResult(Base64.getEncoder().encodeToString(imageBytes), "image/png", "image",
"Generated chart");
- Since:
- 1.0.0
- See Also:
-
ToolResultObject#setBinaryResultsForLlm(java.util.List)
-
Constructor Summary
ConstructorsConstructorDescriptionToolBinaryResult(String data, String mimeType, String type, String description) Creates an instance of aToolBinaryResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.mimeType()Returns the value of themimeTyperecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ToolBinaryResult
Creates an instance of aToolBinaryResultrecord class.- Parameters:
data- the value for thedatarecord componentmimeType- the value for themimeTyperecord componenttype- the value for thetyperecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
mimeType
Returns the value of themimeTyperecord component.- Returns:
- the value of the
mimeTyperecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-