Skip to content

Commit e08591c

Browse files
yiguangjizhongBao
authored andcommitted
feat: support seedance and seedream param
1 parent d12b2b9 commit e08591c

3 files changed

Lines changed: 284 additions & 3 deletions

File tree

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/content/generation/CreateContentGenerationTaskRequest.java

Lines changed: 200 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public class CreateContentGenerationTaskRequest {
5353
@JsonProperty("draft")
5454
private Boolean draft;
5555

56+
@JsonProperty("tools")
57+
private List<ContentGenerationTool> tools;
58+
5659
public CreateContentGenerationTaskRequest() {
5760
}
5861

@@ -68,7 +71,7 @@ public CreateContentGenerationTaskRequest(String model, List<Content> content, S
6871
this.returnLastFrame = returnLastFrame;
6972
}
7073

71-
public CreateContentGenerationTaskRequest(String model, List<Content> content, String callbackUrl, Boolean returnLastFrame, String serviceTier, Long executionExpiresAfter, Boolean generateAudio, Boolean cameraFixed, Boolean watermark, Long seed, String resolution, String ratio, Long duration, Long frames, Boolean draft) {
74+
public CreateContentGenerationTaskRequest(String model, List<Content> content, String callbackUrl, Boolean returnLastFrame, String serviceTier, Long executionExpiresAfter, Boolean generateAudio, Boolean cameraFixed, Boolean watermark, Long seed, String resolution, String ratio, Long duration, Long frames, Boolean draft, List<ContentGenerationTool> tools ) {
7275
this.model = model;
7376
this.content = content;
7477
this.callbackUrl = callbackUrl;
@@ -84,6 +87,7 @@ public CreateContentGenerationTaskRequest(String model, List<Content> content, S
8487
this.duration = duration;
8588
this.frames = frames;
8689
this.draft = draft;
90+
this.tools = tools;
8791
}
8892

8993
public String getModel() {
@@ -200,6 +204,14 @@ public void setDraft(Boolean draft) {
200204
this.draft = draft;
201205
}
202206

207+
public List<ContentGenerationTool> getTools() {
208+
return tools;
209+
}
210+
211+
public void setTools(List<ContentGenerationTool> tools) {
212+
this.tools = tools;
213+
}
214+
203215
@Override
204216
public String toString() {
205217
return "CreateContentGenerationTaskRequest{" +
@@ -218,6 +230,7 @@ public String toString() {
218230
", duration=" + duration +
219231
", frames=" + frames +
220232
", draft=" + draft +
233+
", tools=" + tools +
221234
'}';
222235
}
223236

@@ -241,6 +254,7 @@ public static class Builder {
241254
private Long duration;
242255
private Long frames;
243256
private Boolean draft;
257+
private List<ContentGenerationTool> tools;
244258

245259
private Builder() {
246260
}
@@ -320,6 +334,11 @@ public Builder draft(Boolean draft) {
320334
return this;
321335
}
322336

337+
public Builder tools(List<ContentGenerationTool> tools) {
338+
this.tools = tools;
339+
return this;
340+
}
341+
323342
public CreateContentGenerationTaskRequest build() {
324343
CreateContentGenerationTaskRequest createContentGenerationTaskRequest = new CreateContentGenerationTaskRequest();
325344
createContentGenerationTaskRequest.setModel(model);
@@ -337,10 +356,47 @@ public CreateContentGenerationTaskRequest build() {
337356
createContentGenerationTaskRequest.setDuration(duration);
338357
createContentGenerationTaskRequest.setFrames(frames);
339358
createContentGenerationTaskRequest.setDraft(draft);
359+
createContentGenerationTaskRequest.setTools(tools);
340360
return createContentGenerationTaskRequest;
341361
}
342362
}
343363

364+
365+
@JsonIgnoreProperties(ignoreUnknown = true)
366+
public static class ContentGenerationTool {
367+
@JsonProperty("type")
368+
private String type;
369+
370+
public String getType() {
371+
return type;
372+
}
373+
374+
public void setType(String type) {
375+
this.type = type;
376+
}
377+
378+
@Override
379+
public String toString() {
380+
return "ContentGenerationTool{" +
381+
"type='" + type + '\'' +
382+
'}';
383+
}
384+
385+
public static ContentGenerationTool.Builder builder() {
386+
return new ContentGenerationTool.Builder();
387+
}
388+
389+
public static class Builder {
390+
private String type;
391+
}
392+
393+
public ContentGenerationTool build() {
394+
ContentGenerationTool contentGenerationTool = new ContentGenerationTool();
395+
contentGenerationTool.setType(type);
396+
return contentGenerationTool;
397+
}
398+
}
399+
344400
@JsonIgnoreProperties(ignoreUnknown = true)
345401
public static class Content {
346402

@@ -353,6 +409,12 @@ public static class Content {
353409
@JsonProperty("image_url")
354410
private ImageUrl imageUrl;
355411

412+
@JsonProperty("audio_url")
413+
private AudioUrl audioUrl;
414+
415+
@JsonProperty("video_url")
416+
private VideoUrl videoUrl;
417+
356418
@JsonProperty("role")
357419
private String role;
358420

@@ -362,10 +424,12 @@ public static class Content {
362424
public Content() {
363425
}
364426

365-
public Content(String type, String text, ImageUrl imageUrl, String role, DraftTask draftTask) {
427+
public Content(String type, String text, ImageUrl imageUrl, AudioUrl audioUrl, VideoUrl videoUrl, String role, DraftTask draftTask) {
366428
this.type = type;
367429
this.text = text;
368430
this.imageUrl = imageUrl;
431+
this.audioUrl = audioUrl;
432+
this.videoUrl = videoUrl;
369433
this.role = role;
370434
this.draftTask = draftTask;
371435
}
@@ -394,6 +458,22 @@ public void setImageUrl(ImageUrl imageUrl) {
394458
this.imageUrl = imageUrl;
395459
}
396460

461+
public AudioUrl getAudioUrl() {
462+
return audioUrl;
463+
}
464+
465+
public void setAudioUrl(AudioUrl audioUrl) {
466+
this.audioUrl = audioUrl;
467+
}
468+
469+
public VideoUrl getVideoUrl() {
470+
return videoUrl;
471+
}
472+
473+
public void setVideoUrl(VideoUrl videoUrl) {
474+
this.videoUrl = videoUrl;
475+
}
476+
397477
public String getRole() {
398478
return role;
399479
}
@@ -416,6 +496,8 @@ public String toString() {
416496
"type='" + type + '\'' +
417497
", text='" + text + '\'' +
418498
", imageUrl=" + imageUrl +
499+
", audioUrl=" + audioUrl +
500+
", videoUrl=" + videoUrl +
419501
", role=" + role +
420502
", draftTask=" + draftTask +
421503
'}';
@@ -429,6 +511,8 @@ public static class Builder {
429511
private String type;
430512
private String text;
431513
private ImageUrl imageUrl;
514+
private AudioUrl audioUrl;
515+
private VideoUrl videoUrl;
432516
private String role;
433517
private DraftTask draftTask;
434518

@@ -450,6 +534,16 @@ public Builder imageUrl(ImageUrl imageUrl) {
450534
return this;
451535
}
452536

537+
public Builder audioUrl(AudioUrl audioUrl) {
538+
this.audioUrl = audioUrl;
539+
return this;
540+
}
541+
542+
public Builder videoUrl(VideoUrl videoUrl) {
543+
this.videoUrl = videoUrl;
544+
return this;
545+
}
546+
453547
public Builder role(String role) {
454548
this.role = role;
455549
return this;
@@ -465,6 +559,8 @@ public Content build() {
465559
content.setType(type);
466560
content.setText(text);
467561
content.setImageUrl(imageUrl);
562+
content.setAudioUrl(audioUrl);
563+
content.setVideoUrl(videoUrl);
468564
content.setRole(role);
469565
content.setDraftTask(draftTask);
470566
return content;
@@ -523,6 +619,108 @@ public ImageUrl build() {
523619
}
524620
}
525621

622+
@JsonIgnoreProperties(ignoreUnknown = true)
623+
public static class AudioUrl {
624+
625+
@JsonProperty("url")
626+
private String url;
627+
628+
public AudioUrl() {
629+
}
630+
631+
public AudioUrl(String url) {
632+
this.url = url;
633+
}
634+
635+
public String getUrl() {
636+
return url;
637+
}
638+
639+
public void setUrl(String url) {
640+
this.url = url;
641+
}
642+
643+
@Override
644+
public String toString() {
645+
return "AudioUrl{" +
646+
"url='" + url + '\'' +
647+
'}';
648+
}
649+
650+
public static AudioUrl.Builder builder() {
651+
return new Builder();
652+
}
653+
654+
public static class Builder {
655+
private String url;
656+
657+
private Builder() {
658+
}
659+
660+
public Builder url(String url) {
661+
this.url = url;
662+
return this;
663+
}
664+
665+
public AudioUrl build() {
666+
AudioUrl audioUrl = new AudioUrl();
667+
audioUrl.setUrl(url);
668+
return audioUrl;
669+
}
670+
}
671+
}
672+
673+
@JsonIgnoreProperties(ignoreUnknown = true)
674+
public static class VideoUrl {
675+
676+
@JsonProperty("url")
677+
private String url;
678+
679+
public VideoUrl() {
680+
}
681+
682+
public VideoUrl(String url) {
683+
this.url = url;
684+
}
685+
686+
public String getUrl() {
687+
return url;
688+
}
689+
690+
public void setUrl(String url) {
691+
this.url = url;
692+
}
693+
694+
@Override
695+
public String toString() {
696+
return "VideoUrl{" +
697+
"url='" + url + '\'' +
698+
'}';
699+
}
700+
701+
public static VideoUrl.Builder builder() {
702+
return new Builder();
703+
}
704+
705+
public static class Builder {
706+
private String url;
707+
708+
private Builder() {
709+
}
710+
711+
public Builder url(String url) {
712+
this.url = url;
713+
return this;
714+
}
715+
716+
public VideoUrl build() {
717+
VideoUrl videoUrl = new VideoUrl();
718+
videoUrl.setUrl(url);
719+
return videoUrl;
720+
}
721+
}
722+
}
723+
526724
@JsonIgnoreProperties(ignoreUnknown = true)
527725
public static class DraftTask {
528726

volcengine-java-sdk-ark-runtime/src/main/java/com/volcengine/ark/runtime/model/content/generation/GetContentGenerationTaskResponse.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
44
import com.fasterxml.jackson.annotation.JsonProperty;
55

6+
import java.util.List;
7+
68
@JsonIgnoreProperties(ignoreUnknown = true)
79
public class GetContentGenerationTaskResponse {
810

@@ -72,7 +74,8 @@ public class GetContentGenerationTaskResponse {
7274
@JsonProperty("draft_task_id")
7375
private String draftTaskID;
7476

75-
77+
@JsonProperty("tools")
78+
private List<CreateContentGenerationTaskRequest.ContentGenerationTool> tools;
7679

7780
public String getId() {
7881
return id;
@@ -250,6 +253,13 @@ public void setDraftTaskID(String draftTaskID) {
250253
this.draftTaskID = draftTaskID;
251254
}
252255

256+
public List<CreateContentGenerationTaskRequest.ContentGenerationTool> getTools() {
257+
return tools;
258+
}
259+
260+
public void setTools(List<CreateContentGenerationTaskRequest.ContentGenerationTool> tools) {
261+
this.tools = tools;
262+
}
253263

254264
@JsonIgnoreProperties(ignoreUnknown = true)
255265
public static class Content {
@@ -370,6 +380,7 @@ public String toString() {
370380
", resolution='" + resolution + '\'' +
371381
", draft=" + draft +
372382
", draftTaskID='" + draftTaskID + '\'' +
383+
", tools='" + tools + '\'' +
373384
'}';
374385
}
375386
}

0 commit comments

Comments
 (0)