feat(box): 实现 AI 对话窗口并添加网络 API 调用
- 新增 LMApi 类实现 API 调用获取 AI 回复 - 修改 LocalWindow 类,添加系统提示信息- 更新 Main 类,引入 Markdown处理库 - 在 build.gradle 中添加相关依赖
This commit is contained in:
@@ -6,12 +6,13 @@ import com.axis.innovators.box.events.SubscribeEvent;
|
||||
import com.axis.innovators.box.gui.FridaWindow;
|
||||
import com.axis.innovators.box.gui.LocalWindow;
|
||||
import com.axis.innovators.box.gui.MainWindow;
|
||||
import com.axis.innovators.box.tools.FolderCreator;
|
||||
import com.axis.innovators.box.tools.LibraryLoad;
|
||||
import org.markdown4j.Markdown4jProcessor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 主类
|
||||
@@ -33,7 +34,7 @@ public class Main {
|
||||
// 我不想写这个了你们自己实现
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) throws IOException {
|
||||
// 注册事件
|
||||
GlobalEventBus.EVENT_BUS.register(new Main());
|
||||
// 设置系统外观
|
||||
|
||||
@@ -210,6 +210,7 @@ public class LocalWindow extends JDialog {
|
||||
contextHandles.getLast(),
|
||||
temperature,
|
||||
prompt,
|
||||
"你是一个乐于助人的AI助手,请用友好自然的语气回答用户问题。",
|
||||
this::publish
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user