Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>cn.bigmodel.openapi</groupId>
<artifactId>oapi-java-sdk</artifactId>
<version>release-V4-2.4.3</version>
<version>release-V4-2.4.4</version>

<packaging>jar</packaging>

Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/zhipu/oapi/service/v4/model/ChatMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class ChatMessage extends ObjectNode {
private String role;
private Object content;
private Audio audio;

private Object reasoning_content;

private String name;

@JsonProperty("tool_calls")
Expand Down Expand Up @@ -70,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<String> fieldNames = objectNode.fieldNames();

Expand Down Expand Up @@ -120,4 +128,9 @@ public void setAudio(Audio audio) {
this.putPOJO("audio", audio);
}


public void setReasoning_content(Object reasoning_content) {
this.reasoning_content = reasoning_content;
this.putPOJO("reasoning_content", reasoning_content);
}
}
12 changes: 12 additions & 0 deletions src/main/java/com/zhipu/oapi/service/v4/model/Delta.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class Delta extends ObjectNode {

@Setter
private Audio audio;
private String reasoning_content;


@JsonProperty("tool_calls")
private List<ToolCalls> tool_calls;
Expand Down Expand Up @@ -61,6 +63,11 @@ public Delta(ObjectNode objectNode) {
} else {
this.setAudio(null);
}
if (objectNode.get("reasoning_content") != null) {
this.setReasoning_content(objectNode.get("reasoning_content").asText());
} else {
this.setReasoning_content(null);
}

Iterator<String> fieldNames = objectNode.fieldNames();

Expand Down Expand Up @@ -94,4 +101,9 @@ public void setTool_calls(List<ToolCalls> tool_calls) {
}
}
}

public void setReasoning_content(String reasoning_content) {
this.reasoning_content = reasoning_content;
this.put("reasoning_content", reasoning_content);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class VideoCreateParams implements ClientRequest<VideoCreateParams> {
* 图片大小:
*/
@JsonProperty("image_url")
private String imageUrl;
private Object imageUrl;

/**
* 调用指定模型进行对 prompt 优化,推荐使用 GLM-4-Air 和 GLM-4-Flash。如未指定,则直接使用原始 prompt。
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/zhipu/oapi/TestVideosClientApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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())
Expand All @@ -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)
Expand Down
Loading