choices = Stream.of(new StreamResponse.Choice(0, new StreamResponse.Delta(content), null)).collect(Collectors.toList());
+ StreamResponse streamResponse = new StreamResponse(chat_message_id, model, "chat.completion.chunk", choices, timestamp);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("data: ");
stringBuilder.append(com.alibaba.fastjson.JSONObject.toJSONString(streamResponse));
diff --git a/src/main/java/com/gpt4/copilot/controller/CustomErrorController.java b/src/main/java/com/gpt4/copilot/controller/CustomErrorController.java
index f648e0e..4362d94 100644
--- a/src/main/java/com/gpt4/copilot/controller/CustomErrorController.java
+++ b/src/main/java/com/gpt4/copilot/controller/CustomErrorController.java
@@ -25,7 +25,7 @@ public class CustomErrorController implements ErrorController {
" Document\n" +
"\n" +
"\n" +
- " Thanks you use gpt4-copilot-java-0.2.5
\n" +
+ " Thanks you use gpt4-copilot-java-0.2.6
\n" +
" 详细使用文档
\n" +
" 项目地址
\n" +
"\n" +
diff --git a/src/main/java/com/gpt4/copilot/copilotApplication.java b/src/main/java/com/gpt4/copilot/copilotApplication.java
index 0d3ad84..5bb3f5e 100644
--- a/src/main/java/com/gpt4/copilot/copilotApplication.java
+++ b/src/main/java/com/gpt4/copilot/copilotApplication.java
@@ -298,9 +298,10 @@ public class copilotApplication {
System.out.println("one_selfCopilot_limit:" + ChatController.getSystemSetting().getOne_selfCopilot_limit());
System.out.println("gpt4-copilot-java 初始化接口成功!");
System.out.println("======================================================");
- System.out.println("******原神gpt4-copilot-java v0.2.5启动成功******");
+ System.out.println("******原神gpt4-copilot-java v0.2.6启动成功******");
System.out.println("* 由于本人略菜,graalvm依赖问题无法解决,之后代码将只通过jar和docker的形式运行");
System.out.println("* 适配最新的ui Open Webui");
+ System.out.println("* 同时适配最新的UI Open Webui 里的/v1/embeddings接口");
System.out.println("URL地址:http://0.0.0.0:" + config.getServerPort() + config.getPrefix() + "");
System.out.println("======================================================");
}
diff --git a/src/main/java/com/gpt4/copilot/pojo/Embeddings.java b/src/main/java/com/gpt4/copilot/pojo/Embeddings.java
new file mode 100644
index 0000000..1302037
--- /dev/null
+++ b/src/main/java/com/gpt4/copilot/pojo/Embeddings.java
@@ -0,0 +1,20 @@
+package com.gpt4.copilot.pojo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * @author Yangyang
+ * @create 2024-04-26 14:15
+ */
+
+@Data
+@Slf4j
+@NoArgsConstructor
+@AllArgsConstructor
+public class Embeddings {
+ private Object input;
+ private String model;
+}
diff --git a/src/main/java/com/gpt4/copilot/pojo/streamResponse.java b/src/main/java/com/gpt4/copilot/pojo/StreamResponse.java
similarity index 96%
rename from src/main/java/com/gpt4/copilot/pojo/streamResponse.java
rename to src/main/java/com/gpt4/copilot/pojo/StreamResponse.java
index e4ff31e..4f62090 100644
--- a/src/main/java/com/gpt4/copilot/pojo/streamResponse.java
+++ b/src/main/java/com/gpt4/copilot/pojo/StreamResponse.java
@@ -15,7 +15,7 @@ import java.util.List;
@NoArgsConstructor
@AllArgsConstructor
@JSONType(orders={"id","model","object","choices","created"})
-public class streamResponse {
+public class StreamResponse {
private String id;
private String model;
private String object;
diff --git a/target/classes/com/gpt4/copilot/controller/ChatController$1.class b/target/classes/com/gpt4/copilot/controller/ChatController$1.class
index d930e21..2ef1c1b 100644
Binary files a/target/classes/com/gpt4/copilot/controller/ChatController$1.class and b/target/classes/com/gpt4/copilot/controller/ChatController$1.class differ
diff --git a/target/classes/com/gpt4/copilot/controller/ChatController$2.class b/target/classes/com/gpt4/copilot/controller/ChatController$2.class
index 145c0bb..0575bdb 100644
Binary files a/target/classes/com/gpt4/copilot/controller/ChatController$2.class and b/target/classes/com/gpt4/copilot/controller/ChatController$2.class differ
diff --git a/target/classes/com/gpt4/copilot/controller/ChatController.class b/target/classes/com/gpt4/copilot/controller/ChatController.class
index 5fa020f..35a7e95 100644
Binary files a/target/classes/com/gpt4/copilot/controller/ChatController.class and b/target/classes/com/gpt4/copilot/controller/ChatController.class differ
diff --git a/target/classes/com/gpt4/copilot/controller/CustomErrorController.class b/target/classes/com/gpt4/copilot/controller/CustomErrorController.class
index 712fc35..5bfb223 100644
Binary files a/target/classes/com/gpt4/copilot/controller/CustomErrorController.class and b/target/classes/com/gpt4/copilot/controller/CustomErrorController.class differ
diff --git a/target/classes/com/gpt4/copilot/copilotApplication.class b/target/classes/com/gpt4/copilot/copilotApplication.class
index 72f3460..98a9a8d 100644
Binary files a/target/classes/com/gpt4/copilot/copilotApplication.class and b/target/classes/com/gpt4/copilot/copilotApplication.class differ
diff --git a/target/classes/com/gpt4/copilot/pojo/Embeddings.class b/target/classes/com/gpt4/copilot/pojo/Embeddings.class
new file mode 100644
index 0000000..c1b7640
Binary files /dev/null and b/target/classes/com/gpt4/copilot/pojo/Embeddings.class differ
diff --git a/target/classes/com/gpt4/copilot/pojo/streamResponse$Choice.class b/target/classes/com/gpt4/copilot/pojo/streamResponse$Choice.class
index 53fb138..c604ffb 100644
Binary files a/target/classes/com/gpt4/copilot/pojo/streamResponse$Choice.class and b/target/classes/com/gpt4/copilot/pojo/streamResponse$Choice.class differ
diff --git a/target/classes/com/gpt4/copilot/pojo/streamResponse$Delta.class b/target/classes/com/gpt4/copilot/pojo/streamResponse$Delta.class
index e6d8a13..a0b5894 100644
Binary files a/target/classes/com/gpt4/copilot/pojo/streamResponse$Delta.class and b/target/classes/com/gpt4/copilot/pojo/streamResponse$Delta.class differ
diff --git a/target/classes/com/gpt4/copilot/pojo/streamResponse.class b/target/classes/com/gpt4/copilot/pojo/streamResponse.class
index b8fcf2d..bcad6c5 100644
Binary files a/target/classes/com/gpt4/copilot/pojo/streamResponse.class and b/target/classes/com/gpt4/copilot/pojo/streamResponse.class differ
diff --git a/target/gpt-4-copilot-0.2.5.jar.original b/target/gpt-4-copilot-0.2.5.jar.original
deleted file mode 100644
index 8d0f02f..0000000
Binary files a/target/gpt-4-copilot-0.2.5.jar.original and /dev/null differ
diff --git a/target/gpt-4-copilot-0.2.5.jar b/target/gpt-4-copilot-0.2.6.jar
similarity index 99%
rename from target/gpt-4-copilot-0.2.5.jar
rename to target/gpt-4-copilot-0.2.6.jar
index f72eee5..3a855a6 100644
Binary files a/target/gpt-4-copilot-0.2.5.jar and b/target/gpt-4-copilot-0.2.6.jar differ
diff --git a/target/gpt-4-copilot-0.2.6.jar.original b/target/gpt-4-copilot-0.2.6.jar.original
new file mode 100644
index 0000000..02ad4a1
Binary files /dev/null and b/target/gpt-4-copilot-0.2.6.jar.original differ
diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties
index 17e36ad..8a00aaf 100644
--- a/target/maven-archiver/pom.properties
+++ b/target/maven-archiver/pom.properties
@@ -1,3 +1,3 @@
artifactId=gpt-4-copilot
groupId=com.gpt4.copilot
-version=0.2.5
+version=0.2.6
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
index 9180cbc..4a16b94 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -1,15 +1,16 @@
com\gpt4\copilot\controller\ChatController.class
com\gpt4\copilot\config\CorsConfig.class
+com\gpt4\copilot\pojo\StreamResponse.class
com\gpt4\copilot\pojo\Conversation$ConversationBuilderImpl.class
-com\gpt4\copilot\pojo\streamResponse.class
com\gpt4\copilot\copilotApplication.class
-com\gpt4\copilot\pojo\streamResponse$Delta.class
com\gpt4\copilot\controller\ChatController$1.class
com\gpt4\copilot\pojo\Conversation$ConversationBuilder.class
com\gpt4\copilot\config\WebConfig.class
com\gpt4\copilot\controller\CustomErrorController.class
com\gpt4\copilot\pojo\Conversation.class
-com\gpt4\copilot\pojo\streamResponse$Choice.class
+com\gpt4\copilot\pojo\StreamResponse$Choice.class
com\gpt4\copilot\pojo\SystemSetting.class
com\gpt4\copilot\pojo\Result.class
+com\gpt4\copilot\pojo\StreamResponse$Delta.class
+com\gpt4\copilot\pojo\Embeddings.class
com\gpt4\copilot\controller\ChatController$2.class
diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
index 3be3273..d1445e7 100644
--- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
+++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -4,6 +4,7 @@ F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\pojo\Conversation.java
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\pojo\SystemSetting.java
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\controller\ChatController.java
-F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\pojo\streamResponse.java
+F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\pojo\StreamResponse.java
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\config\WebConfig.java
F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\copilotApplication.java
+F:\vue\fakeApiTool\graalvm-demos\spring-native-image\GPT4-Copilot\src\main\java\com\gpt4\copilot\pojo\Embeddings.java