Skip to content

Commit

Permalink
[improvement][headless]Refactor LLMReq and move linking values to LLM…
Browse files Browse the repository at this point in the history
…Schema.
  • Loading branch information
jerryjzhang committed Sep 12, 2024
1 parent 71ff817 commit de6a5c9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public LLMReq getLlmReq(ChatQueryContext queryCtx, Long dataSetId) {
llmSchema.setDimensions(getMappedDimensions(queryCtx, dataSetId));
llmSchema.setPartitionTime(getPartitionTime(queryCtx, dataSetId));
llmSchema.setPrimaryKey(getPrimaryKey(queryCtx, dataSetId));
llmSchema.setTerms(getTerms(queryCtx, dataSetId));

boolean linkingValueEnabled =
Boolean.valueOf(parserConfig.getParameterValue(PARSER_LINKING_VALUE_ENABLE));
Expand All @@ -76,6 +75,7 @@ public LLMReq getLlmReq(ChatQueryContext queryCtx, Long dataSetId) {
}

llmReq.setCurrentDate(DateUtils.getBeforeDate(0));
llmReq.setTerms(getTerms(queryCtx, dataSetId));
llmReq.setSqlGenType(
LLMReq.SqlGenType.valueOf(parserConfig.getParameterValue(PARSER_STRATEGY_TYPE)));
llmReq.setModelConfig(queryCtx.getModelConfig());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public String buildSchemaStr(LLMReq llmReq) {
}

private String buildTermStr(LLMReq llmReq) {
List<LLMReq.Term> terms = llmReq.getSchema().getTerms();
List<LLMReq.Term> terms = llmReq.getTerms();
List<String> termStr = Lists.newArrayList();
terms.stream()
.forEach(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
public class LLMReq {
private String queryText;
private LLMSchema schema;
private List<Term> terms;
private String currentDate;
private String priorExts;
private SqlGenType sqlGenType;
Expand All @@ -39,7 +40,6 @@ public static class LLMSchema {
private List<ElementValue> values;
private SchemaElement partitionTime;
private SchemaElement primaryKey;
private List<Term> terms;

public List<String> getFieldNameList() {
List<String> fieldNameList = new ArrayList<>();
Expand Down

0 comments on commit de6a5c9

Please sign in to comment.