From b1359b67a65c4ac86fe1409ff0aa6c9e9d7f5f9e Mon Sep 17 00:00:00 2001 From: jinhaiyang Date: Tue, 1 Jul 2025 16:24:03 +0800 Subject: [PATCH 1/3] 4v-thinking --- .../com/zhipu/oapi/service/v4/model/ChatMessage.java | 12 ++++++++++++ .../java/com/zhipu/oapi/service/v4/model/Delta.java | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/main/java/com/zhipu/oapi/service/v4/model/ChatMessage.java b/src/main/java/com/zhipu/oapi/service/v4/model/ChatMessage.java index 9280dec..0542d5f 100644 --- a/src/main/java/com/zhipu/oapi/service/v4/model/ChatMessage.java +++ b/src/main/java/com/zhipu/oapi/service/v4/model/ChatMessage.java @@ -24,6 +24,8 @@ public class ChatMessage extends ObjectNode { private String role; private Object content; + private Object reasoning_content; + private String name; @JsonProperty("tool_calls") @@ -71,6 +73,11 @@ public ChatMessage(ObjectNode objectNode) { } else { this.setTool_call_id(null); } + if (objectNode.get("reasoning_content") != null) { + this.setReasoning_content(objectNode.get("reasoning_content").asText()); + } else { + this.setReasoning_content(null); + } Iterator fieldNames = objectNode.fieldNames(); @@ -115,4 +122,9 @@ public void setTool_call_id(String tool_call_id) { this.tool_call_id = tool_call_id; this.put("tool_call_id", tool_call_id); } + + public void setReasoning_content(Object reasoning_content) { + this.reasoning_content = reasoning_content; + this.putPOJO("reasoning_content", reasoning_content); + } } diff --git a/src/main/java/com/zhipu/oapi/service/v4/model/Delta.java b/src/main/java/com/zhipu/oapi/service/v4/model/Delta.java index 046e737..fc64b6b 100644 --- a/src/main/java/com/zhipu/oapi/service/v4/model/Delta.java +++ b/src/main/java/com/zhipu/oapi/service/v4/model/Delta.java @@ -25,6 +25,8 @@ public class Delta extends ObjectNode { private String content; + private String reasoning_content; + @JsonProperty("tool_calls") private List tool_calls; @@ -53,6 +55,11 @@ public Delta(ObjectNode objectNode) { } else { this.setTool_calls(null); } + if (objectNode.get("reasoning_content") != null) { + this.setReasoning_content(objectNode.get("reasoning_content").asText()); + } else { + this.setReasoning_content(null); + } Iterator fieldNames = objectNode.fieldNames(); @@ -86,4 +93,9 @@ public void setTool_calls(List tool_calls) { } } } + + public void setReasoning_content(String reasoning_content) { + this.reasoning_content = reasoning_content; + this.put("reasoning_content", reasoning_content); + } } From ad2df359100dffebbc0d7d4cf4379545ddcecbfc Mon Sep 17 00:00:00 2001 From: jinhaiyang Date: Thu, 10 Jul 2025 10:29:01 +0800 Subject: [PATCH 2/3] cogvideox-3 --- .../com/zhipu/oapi/service/v4/videos/VideoCreateParams.java | 2 +- .../java/com/zhipu/oapi/TestVideosClientApiService.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/zhipu/oapi/service/v4/videos/VideoCreateParams.java b/src/main/java/com/zhipu/oapi/service/v4/videos/VideoCreateParams.java index 97e8a02..dbdabd0 100644 --- a/src/main/java/com/zhipu/oapi/service/v4/videos/VideoCreateParams.java +++ b/src/main/java/com/zhipu/oapi/service/v4/videos/VideoCreateParams.java @@ -34,7 +34,7 @@ public class VideoCreateParams implements ClientRequest { * 图片大小: */ @JsonProperty("image_url") - private String imageUrl; + private Object imageUrl; /** * 调用指定模型进行对 prompt 优化,推荐使用 GLM-4-Air 和 GLM-4-Flash。如未指定,则直接使用原始 prompt。 diff --git a/src/test/java/com/zhipu/oapi/TestVideosClientApiService.java b/src/test/java/com/zhipu/oapi/TestVideosClientApiService.java index b76e3f4..c466723 100644 --- a/src/test/java/com/zhipu/oapi/TestVideosClientApiService.java +++ b/src/test/java/com/zhipu/oapi/TestVideosClientApiService.java @@ -50,7 +50,7 @@ public void testVideo(){ VideoCreateParams build = VideoCreateParams.builder() .prompt("A person driving a boat") - .model("cogvideox") + .model("cogvideox-3") .withAudio(Boolean.TRUE) .quality("quality") .build(); @@ -70,7 +70,7 @@ public void testVideoSensitiveWordCheck(){ VideoCreateParams build = VideoCreateParams.builder() .prompt("A person driving a boat") - .model("cogvideox") + .model("cogvideox-3") .sensitiveWordCheck(sensitiveWordCheckRequest) .build(); VideosResponse apply = new VideosClientApiService(client.getConfig().getHttpClient(), client.getConfig().getBaseUrl()) @@ -90,7 +90,7 @@ public void testVideoByImage() throws IOException { .prompt( "This scene depicts a magical atmosphere. On a stone table surrounded by green plants and orange flowers, an ancient book lies open, its pages seemingly just turned. Next to the book sits a transparent magic orb filled with twinkling lights and flowing shadows, as if mysterious energy flows within. The base beneath the magic orb emits a faint glow, while tiny light particles float in the surrounding air, enhancing the scene's mystique and magical ambiance. Vague architectural structures can be seen in the background, further emphasizing the fantasy and mystery of this scene.") .imageUrl(imageUrl) - .model("cogvideox") + .model("cogvideox-3") .build(); VideosResponse apply = new VideosClientApiService(client.getConfig().getHttpClient(), client.getConfig().getBaseUrl()) .videoGenerations(build) From bf79e99c5e1f64ab153ff18a66043a6706cb1681 Mon Sep 17 00:00:00 2001 From: jinhaiyang Date: Tue, 15 Jul 2025 18:58:44 +0800 Subject: [PATCH 3/3] cogvideox-3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a8ece16..42a8068 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ cn.bigmodel.openapi oapi-java-sdk - release-V4-2.4.3 + release-V4-2.4.4 jar