forked from github/copilot-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToolBinaryResult.java
More file actions
38 lines (35 loc) · 1.41 KB
/
ToolBinaryResult.java
File metadata and controls
38 lines (35 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.sdk.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Binary result from a tool execution.
* <p>
* This record represents binary data (such as images) returned by a tool. The
* data is base64-encoded for JSON transmission.
*
* <h2>Example Usage</h2>
*
* <pre>{@code
* var binaryResult = new ToolBinaryResult(Base64.getEncoder().encodeToString(imageBytes), "image/png", "image",
* "Generated chart");
* }</pre>
*
* @param data
* the base64-encoded binary data
* @param mimeType
* the MIME type (e.g., "image/png", "application/pdf")
* @param type
* the content type (e.g., "image", "file")
* @param description
* the content description, helps the assistant understand the
* content
* @see ToolResultObject#setBinaryResultsForLlm(java.util.List)
* @since 1.0.0
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public record ToolBinaryResult(@JsonProperty("data") String data, @JsonProperty("mimeType") String mimeType,
@JsonProperty("type") String type, @JsonProperty("description") String description) {
}