File tree Expand file tree Collapse file tree 8 files changed +68
-5
lines changed
src/main/java/com/theokanning/openai Expand file tree Collapse file tree 8 files changed +68
-5
lines changed Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >top.bella</groupId >
88 <artifactId >openai-java</artifactId >
9- <version >0.23.79 </version >
9+ <version >0.23.80 </version >
1010 </parent >
1111 <packaging >jar</packaging >
1212 <artifactId >openai-api</artifactId >
Original file line number Diff line number Diff line change 22
33import com .fasterxml .jackson .annotation .JsonInclude ;
44import com .fasterxml .jackson .annotation .JsonProperty ;
5+ import com .theokanning .openai .assistants .message .content .Approval ;
56import com .theokanning .openai .assistants .message .content .AudioData ;
67import com .theokanning .openai .assistants .message .content .ImageFile ;
78import com .theokanning .openai .assistants .message .content .Text ;
89import com .theokanning .openai .completion .chat .ChatToolCall ;
910import com .theokanning .openai .completion .chat .ImageUrl ;
1011import com .theokanning .openai .completion .chat .ToolMessage ;
12+ import com .theokanning .openai .response .tool .MCPApprovalResponse ;
1113import com .theokanning .openai .response .tool .ToolCall ;
1214import lombok .Data ;
1315
2123public class MessageContent {
2224
2325 /**
24- * image_url/image_file/text/tool_call/tool_result/audio
26+ * image_url/image_file/text/tool_call/tool_result/audio/clear/approval
2527 */
2628 String type ;
2729
@@ -58,6 +60,10 @@ public class MessageContent {
5860 @ JsonInclude (JsonInclude .Include .NON_NULL )
5961 ToolMessage toolResult ;
6062
63+ @ JsonProperty ("approval" )
64+ @ JsonInclude (JsonInclude .Include .NON_NULL )
65+ Approval approval ;
66+
6167 public boolean empty () {
6268 switch (type ) {
6369 case "image_file" :
Original file line number Diff line number Diff line change 1+ package com .theokanning .openai .assistants .message .content ;
2+
3+ import com .fasterxml .jackson .annotation .JsonInclude ;
4+ import com .fasterxml .jackson .annotation .JsonProperty ;
5+ import lombok .AllArgsConstructor ;
6+ import lombok .Data ;
7+ import lombok .NoArgsConstructor ;
8+
9+ @ Data
10+ @ NoArgsConstructor
11+ @ AllArgsConstructor
12+ @ JsonInclude (JsonInclude .Include .NON_NULL )
13+ public class Approval {
14+ /**
15+ * The ID of the approval request being answered.
16+ */
17+ @ JsonProperty ("approval_request_id" )
18+ private String approvalRequestId ;
19+
20+ /**
21+ * The label of the MCP server making the request.
22+ */
23+ @ JsonProperty ("server_label" )
24+ private String serverLabel ;
25+
26+ /**
27+ * The name of the tool to run.
28+ */
29+ private String name ;
30+
31+ /**
32+ * A JSON string of arguments for the tool.
33+ */
34+ private String arguments ;
35+
36+ /**
37+ * Whether the request was approved.
38+ */
39+ private Boolean approve ;
40+
41+ /**
42+ * Optional reason for the decision.
43+ */
44+ private String reason ;
45+
46+ private Integer index ;
47+ }
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ public class StepDetails {
4646 @ JsonProperty ("redacted_reasoning_content" )
4747 private String redactedReasoningContent ;
4848
49+ @ JsonInclude (JsonInclude .Include .NON_NULL )
50+ @ JsonProperty ("approval_ids" )
51+ private List <String > approvalIds ;
52+
4953 @ JsonInclude (JsonInclude .Include .NON_NULL )
5054 private List <Annotation > annotations ;
5155
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ public class MCPToolCall extends ToolCall {
4646 */
4747 private String arguments ;
4848
49+ /**
50+ * Unique identifier for the MCP tool call approval request. Include this value in a subsequent mcp_approval_response input to approve or reject the corresponding tool call.
51+ */
52+ @ JsonProperty ("approval_request_id" )
53+ private String approvalRequestId ;
54+
4955 /**
5056 * The output from the tool call.
5157 */
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >top.bella</groupId >
88 <artifactId >openai-java</artifactId >
9- <version >0.23.79 </version >
9+ <version >0.23.80 </version >
1010 </parent >
1111 <packaging >jar</packaging >
1212
Original file line number Diff line number Diff line change 55
66 <groupId >top.bella</groupId >
77 <artifactId >openai-java</artifactId >
8- <version >0.23.79 </version >
8+ <version >0.23.80 </version >
99 <packaging >pom</packaging >
1010 <description >openai java 版本</description >
1111 <name >openai-java</name >
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >top.bella</groupId >
88 <artifactId >openai-java</artifactId >
9- <version >0.23.79 </version >
9+ <version >0.23.80 </version >
1010 </parent >
1111 <packaging >jar</packaging >
1212
You can’t perform that action at this time.
0 commit comments