mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-30 04:54:25 +08:00
Compare commits
3 Commits
f804371134
...
91768892cf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91768892cf | ||
|
|
0868a18b08 | ||
|
|
46316cadcf |
@@ -74,7 +74,7 @@ public class UserController {
|
||||
|
||||
@PostMapping("/resetPassword")
|
||||
public void resetPassword(@RequestBody UserReq userCmd, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
HttpServletResponse response) {
|
||||
User user = userService.getCurrentUser(request, response);
|
||||
userService.resetPassword(user.getName(), userCmd.getPassword(), userCmd.getNewPassword());
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.tencent.supersonic.chat.server.pojo.ParseContext;
|
||||
import com.tencent.supersonic.common.pojo.ChatApp;
|
||||
import com.tencent.supersonic.common.pojo.enums.AppModule;
|
||||
import com.tencent.supersonic.common.util.ChatAppManager;
|
||||
import com.tencent.supersonic.headless.api.pojo.response.ParseResp;
|
||||
import com.tencent.supersonic.headless.server.utils.ModelConfigHelper;
|
||||
import dev.langchain4j.data.message.AiMessage;
|
||||
import dev.langchain4j.model.chat.ChatLanguageModel;
|
||||
@@ -71,6 +72,7 @@ public class ErrorMsgRewriteProcessor implements ParseResultProcessor {
|
||||
Response<AiMessage> response = chatLanguageModel.generate(prompt.toUserMessage());
|
||||
String rewrittenMsg = response.content().text();
|
||||
parseContext.getResponse().setErrorMsg(rewrittenMsg);
|
||||
parseContext.getResponse().setState(ParseResp.ParseState.FAILED);
|
||||
keyPipelineLog.info("ErrorMessageProcessor modelReq:\n{} \nmodelResp:\n{}", prompt.text(),
|
||||
rewrittenMsg);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,10 @@ public class QueryExpressionReplaceVisitor extends ExpressionVisitorAdapter {
|
||||
visitBinaryExpression(binaryExpression);
|
||||
}
|
||||
|
||||
if (expression instanceof Parenthesis) {
|
||||
replace(expression, fieldExprMap);
|
||||
}
|
||||
|
||||
if (!toReplace.isEmpty()) {
|
||||
Expression toReplaceExpr = getExpression(toReplace);
|
||||
if (Objects.nonNull(toReplaceExpr)) {
|
||||
|
||||
@@ -364,8 +364,10 @@ public class ModelServiceImpl implements ModelService {
|
||||
metaFilter.setModelIds(Lists.newArrayList(modelId));
|
||||
List<MetricResp> metricResps = metricService.getMetrics(metaFilter);
|
||||
List<DimensionResp> dimensionResps = dimensionService.getDimensions(metaFilter);
|
||||
boolean validMetric = metricResps.stream().anyMatch(metricResp -> Objects.equals(metricResp.getStatus(), StatusEnum.ONLINE.getCode()));
|
||||
boolean validDimension = dimensionResps.stream().anyMatch(dimensionResp -> Objects.equals(dimensionResp.getStatus(), StatusEnum.ONLINE.getCode()));
|
||||
boolean validMetric = metricResps.stream().anyMatch(
|
||||
metricResp -> Objects.equals(metricResp.getStatus(), StatusEnum.ONLINE.getCode()));
|
||||
boolean validDimension = dimensionResps.stream().anyMatch(dimensionResp -> Objects
|
||||
.equals(dimensionResp.getStatus(), StatusEnum.ONLINE.getCode()));
|
||||
if (validMetric || validDimension) {
|
||||
throw new RuntimeException("存在基于该模型创建的指标和维度, 暂不能删除, 请确认");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user