mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
Compare commits
3 Commits
47c2595fb8
...
62b9db6791
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62b9db6791 | ||
|
|
6d907b6adf | ||
|
|
da172a030e |
@@ -175,6 +175,7 @@ public class FileHandlerImpl implements FileHandler {
|
|||||||
private DictValueResp convert2Resp(String lineStr) {
|
private DictValueResp convert2Resp(String lineStr) {
|
||||||
DictValueResp dictValueResp = new DictValueResp();
|
DictValueResp dictValueResp = new DictValueResp();
|
||||||
if (StringUtils.isNotEmpty(lineStr)) {
|
if (StringUtils.isNotEmpty(lineStr)) {
|
||||||
|
lineStr=StringUtils.stripStart(lineStr,null);
|
||||||
String[] itemArray = lineStr.split("\\s+");
|
String[] itemArray = lineStr.split("\\s+");
|
||||||
if (Objects.nonNull(itemArray) && itemArray.length >= 3) {
|
if (Objects.nonNull(itemArray) && itemArray.length >= 3) {
|
||||||
dictValueResp.setValue(itemArray[0].replace("#", " "));
|
dictValueResp.setValue(itemArray[0].replace("#", " "));
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.tencent.supersonic.headless.chat.mapper;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.hankcs.hanlp.seg.common.Term;
|
import com.hankcs.hanlp.seg.common.Term;
|
||||||
|
import com.tencent.supersonic.common.pojo.ChatModelConfig;
|
||||||
import com.tencent.supersonic.headless.api.pojo.response.S2Term;
|
import com.tencent.supersonic.headless.api.pojo.response.S2Term;
|
||||||
import com.tencent.supersonic.headless.chat.ChatQueryContext;
|
import com.tencent.supersonic.headless.chat.ChatQueryContext;
|
||||||
import com.tencent.supersonic.headless.chat.knowledge.EmbeddingResult;
|
import com.tencent.supersonic.headless.chat.knowledge.EmbeddingResult;
|
||||||
@@ -167,9 +168,13 @@ public class EmbeddingMatchStrategy extends BatchMatchStrategy<EmbeddingResult>
|
|||||||
variable.put("retrievedInfo", JSONObject.toJSONString(results));
|
variable.put("retrievedInfo", JSONObject.toJSONString(results));
|
||||||
|
|
||||||
Prompt prompt = PromptTemplate.from(LLM_FILTER_PROMPT).apply(variable);
|
Prompt prompt = PromptTemplate.from(LLM_FILTER_PROMPT).apply(variable);
|
||||||
ChatLanguageModel chatLanguageModel =
|
|
||||||
ModelProvider.getChatModel(chatQueryContext.getRequest().getChatAppConfig()
|
ChatModelConfig chatModelConfig=null;
|
||||||
.get("REWRITE_MULTI_TURN").getChatModelConfig());
|
if(chatQueryContext.getRequest().getChatAppConfig()!=null
|
||||||
|
&& chatQueryContext.getRequest().getChatAppConfig().containsKey("REWRITE_MULTI_TURN")){
|
||||||
|
chatModelConfig=chatQueryContext.getRequest().getChatAppConfig().get("REWRITE_MULTI_TURN").getChatModelConfig();
|
||||||
|
}
|
||||||
|
ChatLanguageModel chatLanguageModel = ModelProvider.getChatModel(chatModelConfig);
|
||||||
String response = chatLanguageModel.generate(prompt.toUserMessage().singleText());
|
String response = chatLanguageModel.generate(prompt.toUserMessage().singleText());
|
||||||
|
|
||||||
if (StringUtils.isBlank(response)) {
|
if (StringUtils.isBlank(response)) {
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ const ChatMsg: React.FC<Props> = ({
|
|||||||
entityName !== undefined;
|
entityName !== undefined;
|
||||||
|
|
||||||
const existDrillDownDimension =
|
const existDrillDownDimension =
|
||||||
queryMode.includes('METRIC') &&
|
(queryMode.includes('METRIC') || queryMode === 'LLM_S2SQL')&&
|
||||||
getMsgContentType() !== MsgContentTypeEnum.TEXT &&
|
getMsgContentType() !== MsgContentTypeEnum.TEXT &&
|
||||||
!isEntityMode;
|
!isEntityMode;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user