Aggiungi gestione delle query elaborate in AdvancedQueryRagSolver
This commit is contained in:
@@ -128,10 +128,12 @@ public class AdvancedQueryRagSolver extends StepSolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Document> docs = new ArrayList<Document>();
|
List<Document> docs = new ArrayList<Document>();
|
||||||
|
List<String> queries = new ArrayList<String>();
|
||||||
|
|
||||||
for (String query : elaboratedQuery.split("\n")) {
|
for (String query : elaboratedQuery.split("\n")) {
|
||||||
|
|
||||||
logger.info("Elaborated query: " + query);
|
logger.info("Elaborated query: " + query);
|
||||||
|
queries.add(query);
|
||||||
Builder request_builder = SearchRequest.builder()
|
Builder request_builder = SearchRequest.builder()
|
||||||
.query(elaboratedQuery)
|
.query(elaboratedQuery)
|
||||||
.topK(this.topk)
|
.topK(this.topk)
|
||||||
@@ -166,6 +168,7 @@ public class AdvancedQueryRagSolver extends StepSolver {
|
|||||||
String resultString = String.join("\n", result);
|
String resultString = String.join("\n", result);
|
||||||
|
|
||||||
this.scenarioExecution.getExecSharedMap().put("tech_rag_source_documents", source_doc);
|
this.scenarioExecution.getExecSharedMap().put("tech_rag_source_documents", source_doc);
|
||||||
|
this.scenarioExecution.getExecSharedMap().put("tech_rag_query", queries);
|
||||||
this.scenarioExecution.getExecSharedMap().put(this.outputField, resultString);
|
this.scenarioExecution.getExecSharedMap().put(this.outputField, resultString);
|
||||||
this.scenarioExecution.setCurrentStepId(this.step.getStepId());
|
this.scenarioExecution.setCurrentStepId(this.step.getStepId());
|
||||||
this.scenarioExecution.setNextStepId(this.step.getNextStepId());
|
this.scenarioExecution.setNextStepId(this.step.getNextStepId());
|
||||||
|
|||||||
Reference in New Issue
Block a user