2025年4月21日15:12:31
parent
5fcb78176e
commit
02ec8bf376
|
|
@ -68,9 +68,9 @@
|
||||||
## 使用指南
|
## 使用指南
|
||||||
|
|
||||||
### 环境要求
|
### 环境要求
|
||||||
- Java 17 或更高版本
|
1. Java 17 或更高版本
|
||||||
- Ollama 服务已安装并运行
|
2. Ollama 服务已安装并运行
|
||||||
- 系统内存建议 8GB 以上
|
3. 系统内存建议 8GB 以上
|
||||||
|
|
||||||
### 安装步骤
|
### 安装步骤
|
||||||
1. 下载最新版本安装包
|
1. 下载最新版本安装包
|
||||||
|
|
@ -89,6 +89,8 @@
|
||||||
- 建议定期备份重要对话
|
- 建议定期备份重要对话
|
||||||
- 注意网络连接状态
|
- 注意网络连接状态
|
||||||
|
|
||||||
|
> 由于许多成熟的客户端较多,暂时放弃对此项目的维护
|
||||||
|
|
||||||
## 反馈与支持
|
## 反馈与支持
|
||||||
- 问题反馈请提交 Issue
|
- 问题反馈请提交 Issue
|
||||||
- 功能建议欢迎提交 PR
|
- 功能建议欢迎提交 PR
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import java.util.function.Consumer;
|
||||||
public class ChatService {
|
public class ChatService {
|
||||||
private final HttpClient client;
|
private final HttpClient client;
|
||||||
private final ObjectMapper mapper;
|
private final ObjectMapper mapper;
|
||||||
private final String BASE_URL = "http://localhost:8083/ai/v1/ollama/redis/chat";
|
private final String BASE_URL = "http://localhost:8083/ai/chat";
|
||||||
|
|
||||||
public ChatService() {
|
public ChatService() {
|
||||||
this.client = HttpClient.newBuilder()
|
this.client = HttpClient.newBuilder()
|
||||||
|
|
@ -33,7 +33,7 @@ public class ChatService {
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
String encodedMessage = URLEncoder.encode(message, StandardCharsets.UTF_8);
|
String encodedMessage = URLEncoder.encode(message, StandardCharsets.UTF_8);
|
||||||
String url = String.format("%s?input=%s&userId=%s", BASE_URL, encodedMessage,currentChat.getId());
|
String url = String.format("%s?prompt=%s&chatId=%s", BASE_URL, encodedMessage,currentChat.getId());
|
||||||
|
|
||||||
HttpRequest request = HttpRequest.newBuilder()
|
HttpRequest request = HttpRequest.newBuilder()
|
||||||
.uri(URI.create(url))
|
.uri(URI.create(url))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue