|
|
|
@ -17,24 +17,24 @@ public class TestMaxKB {
|
|
|
|
|
//初始化数据库
|
|
|
|
|
MaxKbUtil.Init();
|
|
|
|
|
|
|
|
|
|
//获取模型的id
|
|
|
|
|
String model_name = "DeepSeek";
|
|
|
|
|
Record record = MaxKbUtil.getModel(model_name);
|
|
|
|
|
String model_id = record.getStr("id");
|
|
|
|
|
System.out.println(model_id);
|
|
|
|
|
// //获取模型的id
|
|
|
|
|
// String model_name = "DeepSeek";
|
|
|
|
|
// Record record = MaxKbUtil.getModel(model_name);
|
|
|
|
|
// String model_id = record.getStr("id");
|
|
|
|
|
// System.out.println(model_id);
|
|
|
|
|
|
|
|
|
|
//拷贝生成应用
|
|
|
|
|
//1、拷贝生成应用
|
|
|
|
|
String sourceApplicationName = "应用【模板】";
|
|
|
|
|
String targetApplicationName = "XXX的应用";
|
|
|
|
|
String application_id = MaxKbUtil.addApplication(sourceApplicationName, targetApplicationName);
|
|
|
|
|
|
|
|
|
|
//拷贝生成知识库
|
|
|
|
|
//2、拷贝生成知识库
|
|
|
|
|
String sourceDataSetName = "知识库【模板】";
|
|
|
|
|
String targetDataSetName = "XXX的知识库";
|
|
|
|
|
String dataset_id = MaxKbUtil.addDataSet(sourceDataSetName, targetDataSetName);
|
|
|
|
|
|
|
|
|
|
//应用与知识库关联
|
|
|
|
|
record = new Record();
|
|
|
|
|
//3、应用与知识库关联
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record.set("create_time", LocalDateTime.now());
|
|
|
|
|
record.set("update_time", LocalDateTime.now());
|
|
|
|
|
record.set("id", UUID.randomUUID());
|
|
|
|
@ -42,7 +42,7 @@ public class TestMaxKB {
|
|
|
|
|
record.set("dataset_id", UUID.fromString(dataset_id));
|
|
|
|
|
Db.save("application_dataset_mapping", "id", record);
|
|
|
|
|
|
|
|
|
|
//生成应用的访问Token
|
|
|
|
|
//4、生成应用的访问Token
|
|
|
|
|
MaxKbUtil.addAccessToken(application_id);
|
|
|
|
|
|
|
|
|
|
System.out.println("增加成功!");
|
|
|
|
|