修改为OpenAI规范
去除了单次对话 配置文件格式修改 待测试
This commit is contained in:
@@ -14,19 +14,10 @@ import org.apache.http.message.BasicHeader;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.junit.Test;
|
||||
import plugin.App;
|
||||
import plugin.constant.ChatConstant;
|
||||
import plugin.constant.ConfigConstant;
|
||||
import plugin.listener.OwnerMessageListener;
|
||||
import plugin.utils.AIUtil;
|
||||
import plugin.utils.ConfigUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Scanner;
|
||||
|
||||
import static kotlin.io.ConsoleKt.readln;
|
||||
|
||||
public class MyTest {
|
||||
|
||||
@Test
|
||||
@@ -128,57 +119,6 @@ public class MyTest {
|
||||
client.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ownerTest() throws ClassNotFoundException, IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
|
||||
ConfigUtil.load();
|
||||
|
||||
Class clazz = OwnerMessageListener.class;
|
||||
Method handleCommand = clazz.getDeclaredMethod("handleCommand", String.class, String.class);
|
||||
handleCommand.setAccessible(true);
|
||||
while (true){
|
||||
String input = readln();
|
||||
String command = input.split(ChatConstant.BLANK)[0];
|
||||
String arguments = input.split(ChatConstant.BLANK)[1];
|
||||
|
||||
Object invoke = handleCommand.invoke(clazz.getDeclaredConstructor().newInstance(), command, arguments);
|
||||
System.out.println(invoke);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void chatTest() throws IOException, ClassNotFoundException {
|
||||
ConfigUtil.load();
|
||||
|
||||
Long id = 1L;
|
||||
String content = "你好";
|
||||
String chatCommand = "/c ";
|
||||
|
||||
String customChat = AIUtil.customChat(id, content, null, chatCommand);
|
||||
System.out.println(customChat);
|
||||
|
||||
String defaultChat = AIUtil.defaultChat(id, content, null);
|
||||
System.out.println(defaultChat);
|
||||
|
||||
String chatOnce = AIUtil.chatOnce(content, null);
|
||||
System.out.println(chatOnce);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void regexTest(){
|
||||
String str = "/c glm";
|
||||
System.out.println(str.matches(ConfigConstant.MODEL_CHANGE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void textBlockTest(){
|
||||
String str = """
|
||||
aliyun:
|
||||
123:
|
||||
111
|
||||
""";
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void terminalTest() throws InterruptedException {
|
||||
|
||||
Reference in New Issue
Block a user