重命名测试包

This commit is contained in:
cherishsince 2024-04-06 22:00:56 +08:00
parent 0c42d6175e
commit 21b6e9f996
3 changed files with 22 additions and 10 deletions

View File

@ -1,8 +1,9 @@
package cn.iocoder.yudao.framework.ai.image;
package cn.iocoder.yudao.framework.ai.mj;
import cn.hutool.core.io.FileUtil;
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;
import cn.iocoder.yudao.framework.ai.midjourney.interactions.MjImagineInteractions;
import cn.iocoder.yudao.framework.ai.midjourney.interactions.MjInteractions;
import cn.iocoder.yudao.framework.ai.midjourney.vo.ReRoll;
import org.junit.Before;
import org.junit.Test;
@ -17,23 +18,32 @@ import java.util.Map;
* author: fansili
* time: 2024/4/4 18:59
*/
public class MjTests {
public class MjInteractionsTests {
private MidjourneyConfig midjourneyConfig;
@Before
public void setup() {
String token = "OTcwNDc3NzQxMjUyMTY5NzI4.GJcVxa.VrzMii8dsHOJAPZn4Mw8GuEo7_nIUJij9JIHD4";
String token = "OTcyNzIxMzA0ODkxNDUzNDUw.G_vMOz.BO_Q0sXAD80u5ZKIHPNYDTRX_FgeKL3cKFc53I";
Map<String, String> requestTemplates = new HashMap<>();
List<File> files = FileUtil.loopFiles("/Users/fansili/projects/github/ruoyi-vue-pro/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/resources/http-body");
for (File file : files) {
requestTemplates.put(file.getName().replace(".json", ""), FileUtil.readUtf8String(file));
}
this.midjourneyConfig = new MidjourneyConfig(token, "1225414986084388926", "1225414986587832385", requestTemplates);
this.midjourneyConfig = new MidjourneyConfig(token, "1225608134878302329", "1225608134878302332", requestTemplates);
}
@Test
public void mjImage() {
MjImagineInteractions mjImagineInteractions = new MjImagineInteractions(midjourneyConfig);
mjImagineInteractions.execute("童话里应该是什么样子?");
public void mjImageTest() {
MjInteractions mjImagineInteractions = new MjInteractions(midjourneyConfig);
mjImagineInteractions.imagine("童话里应该是什么样子?");
}
@Test
public void reRollTest() {
MjInteractions mjImagineInteractions = new MjInteractions(midjourneyConfig);
mjImagineInteractions.reRoll(new ReRoll()
.setMessageId("1226165117448753243")
.setCustomId("MJ::JOB::upsample::3::2aeefbef-43e2-4057-bcf1-43b5f39ab6f7"));
}
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.framework.ai.image;
package cn.iocoder.yudao.framework.ai.mj;
import cn.hutool.core.io.FileUtil;
import cn.iocoder.yudao.framework.ai.midjourney.MidjourneyConfig;

View File

@ -1,8 +1,10 @@
package cn.iocoder.yudao.framework.ai.image;
package cn.iocoder.yudao.framework.ai.openAiImage;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageApi;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageClient;
import cn.iocoder.yudao.framework.ai.imageopenai.OpenAiImageOptions;
import cn.iocoder.yudao.framework.ai.mj.ImagePrompt;
import cn.iocoder.yudao.framework.ai.mj.ImageResponse;
import org.junit.Before;
import org.junit.Test;