|
@@ -1,11 +1,11 @@
|
|
|
package cn.iocoder.yudao.framework.ai.midjourney;
|
|
|
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
-import cn.iocoder.yudao.framework.ai.midjourney.interactions.MidjourneyInteractions;
|
|
|
-import cn.iocoder.yudao.framework.ai.midjourney.vo.Attachments;
|
|
|
-import cn.iocoder.yudao.framework.ai.midjourney.vo.Describe;
|
|
|
-import cn.iocoder.yudao.framework.ai.midjourney.vo.ReRoll;
|
|
|
-import cn.iocoder.yudao.framework.ai.midjourney.vo.UploadAttachmentsRes;
|
|
|
+import cn.iocoder.yudao.framework.ai.midjourney.api.MidjourneyInteractionsApi;
|
|
|
+import cn.iocoder.yudao.framework.ai.midjourney.api.req.AttachmentsReq;
|
|
|
+import cn.iocoder.yudao.framework.ai.midjourney.api.req.DescribeReq;
|
|
|
+import cn.iocoder.yudao.framework.ai.midjourney.api.req.ReRollReq;
|
|
|
+import cn.iocoder.yudao.framework.ai.midjourney.api.res.UploadAttachmentsRes;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import org.junit.Before;
|
|
|
import org.junit.Test;
|
|
@@ -38,24 +38,24 @@ public class MidjourneyInteractionsTests {
|
|
|
|
|
|
@Test
|
|
|
public void mjImageTest() {
|
|
|
- MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig);
|
|
|
+ MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig);
|
|
|
mjImagineInteractions.imagine("童话里应该是什么样子?");
|
|
|
}
|
|
|
|
|
|
|
|
|
@Test
|
|
|
public void reRollTest() {
|
|
|
- MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig);
|
|
|
- mjImagineInteractions.reRoll(new ReRoll()
|
|
|
+ MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig);
|
|
|
+ mjImagineInteractions.reRoll(new ReRollReq()
|
|
|
.setMessageId("1226165117448753243")
|
|
|
.setCustomId("MJ::JOB::upsample::3::2aeefbef-43e2-4057-bcf1-43b5f39ab6f7"));
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
public void uploadAttachmentsTest() {
|
|
|
- MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig);
|
|
|
+ MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig);
|
|
|
UploadAttachmentsRes res = mjImagineInteractions.uploadAttachments(
|
|
|
- new Attachments().setFileSystemResource(
|
|
|
+ new AttachmentsReq().setFileSystemResource(
|
|
|
new FileSystemResource(new File("/Users/fansili/Downloads/DSC01402.JPG")))
|
|
|
);
|
|
|
System.err.println(JSON.toJSONString(res));
|
|
@@ -63,8 +63,8 @@ public class MidjourneyInteractionsTests {
|
|
|
|
|
|
@Test
|
|
|
public void describeTest() {
|
|
|
- MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig);
|
|
|
- mjImagineInteractions.describe(new Describe()
|
|
|
+ MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig);
|
|
|
+ mjImagineInteractions.describe(new DescribeReq()
|
|
|
.setFileName("DSC01402.JPG")
|
|
|
.setFinalFileName("16826931-2873-45ec-8cfb-0ad81f1a075f/DSC01402.JPG")
|
|
|
);
|