Commit c8a2c8369fdb7bfd992c64b6fbbe2aa83ccede73
1 parent
9476a059
修改测试名称
Showing
1 changed file
with
12 additions
and
12 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/test/java/cn/iocoder/yudao/framework/ai/midjourney/MidjourneyInteractionsTests.java
| 1 | 1 | package cn.iocoder.yudao.framework.ai.midjourney; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.io.FileUtil; |
| 4 | -import cn.iocoder.yudao.framework.ai.midjourney.interactions.MidjourneyInteractions; | |
| 5 | -import cn.iocoder.yudao.framework.ai.midjourney.vo.Attachments; | |
| 6 | -import cn.iocoder.yudao.framework.ai.midjourney.vo.Describe; | |
| 7 | -import cn.iocoder.yudao.framework.ai.midjourney.vo.ReRoll; | |
| 8 | -import cn.iocoder.yudao.framework.ai.midjourney.vo.UploadAttachmentsRes; | |
| 4 | +import cn.iocoder.yudao.framework.ai.midjourney.api.MidjourneyInteractionsApi; | |
| 5 | +import cn.iocoder.yudao.framework.ai.midjourney.api.req.AttachmentsReq; | |
| 6 | +import cn.iocoder.yudao.framework.ai.midjourney.api.req.DescribeReq; | |
| 7 | +import cn.iocoder.yudao.framework.ai.midjourney.api.req.ReRollReq; | |
| 8 | +import cn.iocoder.yudao.framework.ai.midjourney.api.res.UploadAttachmentsRes; | |
| 9 | 9 | import com.alibaba.fastjson.JSON; |
| 10 | 10 | import org.junit.Before; |
| 11 | 11 | import org.junit.Test; |
| ... | ... | @@ -38,24 +38,24 @@ public class MidjourneyInteractionsTests { |
| 38 | 38 | |
| 39 | 39 | @Test |
| 40 | 40 | public void mjImageTest() { |
| 41 | - MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig); | |
| 41 | + MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig); | |
| 42 | 42 | mjImagineInteractions.imagine("童话里应该是什么样子?"); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | @Test |
| 47 | 47 | public void reRollTest() { |
| 48 | - MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig); | |
| 49 | - mjImagineInteractions.reRoll(new ReRoll() | |
| 48 | + MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig); | |
| 49 | + mjImagineInteractions.reRoll(new ReRollReq() | |
| 50 | 50 | .setMessageId("1226165117448753243") |
| 51 | 51 | .setCustomId("MJ::JOB::upsample::3::2aeefbef-43e2-4057-bcf1-43b5f39ab6f7")); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | @Test |
| 55 | 55 | public void uploadAttachmentsTest() { |
| 56 | - MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig); | |
| 56 | + MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig); | |
| 57 | 57 | UploadAttachmentsRes res = mjImagineInteractions.uploadAttachments( |
| 58 | - new Attachments().setFileSystemResource( | |
| 58 | + new AttachmentsReq().setFileSystemResource( | |
| 59 | 59 | new FileSystemResource(new File("/Users/fansili/Downloads/DSC01402.JPG"))) |
| 60 | 60 | ); |
| 61 | 61 | System.err.println(JSON.toJSONString(res)); |
| ... | ... | @@ -63,8 +63,8 @@ public class MidjourneyInteractionsTests { |
| 63 | 63 | |
| 64 | 64 | @Test |
| 65 | 65 | public void describeTest() { |
| 66 | - MidjourneyInteractions mjImagineInteractions = new MidjourneyInteractions(midjourneyConfig); | |
| 67 | - mjImagineInteractions.describe(new Describe() | |
| 66 | + MidjourneyInteractionsApi mjImagineInteractions = new MidjourneyInteractionsApi(midjourneyConfig); | |
| 67 | + mjImagineInteractions.describe(new DescribeReq() | |
| 68 | 68 | .setFileName("DSC01402.JPG") |
| 69 | 69 | .setFinalFileName("16826931-2873-45ec-8cfb-0ad81f1a075f/DSC01402.JPG") |
| 70 | 70 | ); | ... | ... |