(improvement)(chat) remove domain in wordservice and the model id takes precedence over the number of model aliases (#87)

This commit is contained in:
lexluo09
2023-09-13 21:25:31 +08:00
committed by GitHub
parent c802c508fb
commit 6a98ce9d28
5 changed files with 65 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ public class WordBuilderFactory {
static {
wordNatures.put(DictWordType.DIMENSION, new DimensionWordBuilder());
wordNatures.put(DictWordType.METRIC, new MetricWordBuilder());
wordNatures.put(DictWordType.DOMAIN, new ModelWordBuilder());
wordNatures.put(DictWordType.MODEL, new ModelWordBuilder());
wordNatures.put(DictWordType.ENTITY, new EntityWordBuilder());
wordNatures.put(DictWordType.VALUE, new ValueWordBuilder());
}

View File

@@ -29,7 +29,7 @@ public class WordService {
addWordsByType(DictWordType.DIMENSION, semanticSchema.getDimensions(), words);
addWordsByType(DictWordType.METRIC, semanticSchema.getMetrics(), words);
addWordsByType(DictWordType.DOMAIN, semanticSchema.getModels(), words);
addWordsByType(DictWordType.MODEL, semanticSchema.getModels(), words);
addWordsByType(DictWordType.ENTITY, semanticSchema.getEntities(), words);
addWordsByType(DictWordType.VALUE, semanticSchema.getDimensionValues(), words);

View File

@@ -0,0 +1,16 @@
package com.tencent.supersonic.knowledge.utils;
import cn.hutool.core.lang.Assert;
import com.tencent.supersonic.chat.api.pojo.SchemaElementType;
import org.junit.jupiter.api.Test;
class NatureHelperTest {
@Test
void convertToElementType() {
SchemaElementType schemaElementType = NatureHelper.convertToElementType("_1");
Assert.equals(schemaElementType, SchemaElementType.MODEL);
}
}