Record Class ToolBinaryResult
java.lang.Object
java.lang.Record
com.github.copilot.rpc.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:
-
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
-
hashCode
-
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
-
mimeType
-
type
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-