23 changed files with 188 additions and 173 deletions
-
5CLAUDE.md
-
24client/README.md
-
21client/dist/chatbot-sdk.js
-
2client/dist/chatbot-sdk.js.map
-
2client/dist/chatbot-sdk.min.js
-
2client/dist/chatbot-sdk.min.js.map
-
4client/src/api.ts
-
5client/src/chat.ts
-
2client/src/config.ts
-
12client/src/types.ts
-
27src/main/java/com/wok/supportbot/app/AssistantApp.java
-
46src/main/java/com/wok/supportbot/config/ChatModelFactory.java
-
35src/main/java/com/wok/supportbot/config/EmbeddingModelFactory.java
-
28src/main/java/com/wok/supportbot/rag/config/QueryExpanderConfig.java
-
46src/main/java/com/wok/supportbot/rag/config/QueryTransformerConfig.java
-
15src/main/java/com/wok/supportbot/service/AiModelConfigService.java
-
6src/main/java/com/wok/supportbot/service/CustomerServiceRoleService.java
-
9src/main/resources/static/components/ModelConfigManager.js
-
21src/main/resources/static/sdk/chatbot-sdk.js
-
2src/main/resources/static/sdk/chatbot-sdk.js.map
-
2src/main/resources/static/sdk/chatbot-sdk.min.js
-
2src/main/resources/static/sdk/chatbot-sdk.min.js.map
-
9src/main/resources/static/sdk/test.html
2
client/dist/chatbot-sdk.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
client/dist/chatbot-sdk.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
client/dist/chatbot-sdk.min.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,28 +0,0 @@ |
|||
package com.wok.supportbot.rag.config; |
|||
|
|||
import com.wok.supportbot.config.ChatModelFactory; |
|||
import org.springframework.ai.chat.client.ChatClient; |
|||
import org.springframework.ai.rag.preretrieval.query.expansion.MultiQueryExpander; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
/** |
|||
* 查询扩展器 Bean 配置 |
|||
* 通过 ChatModelFactory 获取 ChatModel,支持多提供商动态切换 |
|||
*/ |
|||
@Configuration |
|||
public class QueryExpanderConfig { |
|||
|
|||
@Autowired |
|||
private ChatModelFactory chatModelFactory; |
|||
|
|||
@Bean |
|||
public MultiQueryExpander multiQueryExpander() { |
|||
return MultiQueryExpander.builder() |
|||
.chatClientBuilder(ChatClient.builder(chatModelFactory.getChatModel("RAG_REWRITE"))) |
|||
.numberOfQueries(3) |
|||
.includeOriginal(true) |
|||
.build(); |
|||
} |
|||
} |
|||
@ -1,46 +0,0 @@ |
|||
package com.wok.supportbot.rag.config; |
|||
|
|||
import com.wok.supportbot.config.ChatModelFactory; |
|||
import org.springframework.ai.chat.client.ChatClient; |
|||
import org.springframework.ai.rag.preretrieval.query.transformation.CompressionQueryTransformer; |
|||
import org.springframework.ai.rag.preretrieval.query.transformation.QueryTransformer; |
|||
import org.springframework.ai.rag.preretrieval.query.transformation.RewriteQueryTransformer; |
|||
import org.springframework.ai.rag.preretrieval.query.transformation.TranslationQueryTransformer; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
/** |
|||
* 查询转换器 Bean 配置 |
|||
* 通过 ChatModelFactory 获取 ChatModel,支持多提供商动态切换 |
|||
* 注意:这些 Bean 在 doChatWithRagEnhance() 中被注入但未生效(TODO), |
|||
* 实际使用的查询重写逻辑在 preretrieval/ 包下的 Rewriter 组件中 |
|||
*/ |
|||
@Configuration |
|||
public class QueryTransformerConfig { |
|||
|
|||
@Autowired |
|||
private ChatModelFactory chatModelFactory; |
|||
|
|||
@Bean |
|||
public QueryTransformer rewriteQueryTransformer() { |
|||
return RewriteQueryTransformer.builder() |
|||
.chatClientBuilder(ChatClient.builder(chatModelFactory.getChatModel("RAG_REWRITE"))) |
|||
.build(); |
|||
} |
|||
|
|||
@Bean |
|||
public QueryTransformer translationQueryTransformer() { |
|||
return TranslationQueryTransformer.builder() |
|||
.chatClientBuilder(ChatClient.builder(chatModelFactory.getChatModel("RAG_REWRITE"))) |
|||
.targetLanguage("chinese") |
|||
.build(); |
|||
} |
|||
|
|||
@Bean |
|||
public QueryTransformer compressionQueryTransformer() { |
|||
return CompressionQueryTransformer.builder() |
|||
.chatClientBuilder(ChatClient.builder(chatModelFactory.getChatModel("RAG_REWRITE"))) |
|||
.build(); |
|||
} |
|||
} |
|||
2
src/main/resources/static/sdk/chatbot-sdk.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
src/main/resources/static/sdk/chatbot-sdk.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2
src/main/resources/static/sdk/chatbot-sdk.min.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue