Correggi il logger per AdvancedAIPromptSolver e modifica il metodo di invio dei messaggi
This commit is contained in:
@@ -23,7 +23,7 @@ public class AdvancedAIPromptSolver extends StepSolver {
|
|||||||
private String qai_custom_memory_id;
|
private String qai_custom_memory_id;
|
||||||
|
|
||||||
|
|
||||||
Logger logger = (Logger) LoggerFactory.getLogger(BasicQueryRagSolver.class);
|
Logger logger = (Logger) LoggerFactory.getLogger(AdvancedAIPromptSolver.class);
|
||||||
|
|
||||||
private void loadParameters(){
|
private void loadParameters(){
|
||||||
logger.info("Loading parameters");
|
logger.info("Loading parameters");
|
||||||
@@ -59,14 +59,16 @@ public class AdvancedAIPromptSolver extends StepSolver {
|
|||||||
this.scenarioExecution.setCurrentStepId(this.step.getStepId());
|
this.scenarioExecution.setCurrentStepId(this.step.getStepId());
|
||||||
|
|
||||||
loadParameters();
|
loadParameters();
|
||||||
|
/*
|
||||||
String userText = this.qai_user_input;
|
String userText = this.qai_user_input;
|
||||||
|
|
||||||
Message userMessage = new UserMessage(userText);
|
Message userMessage = new UserMessage(userText);
|
||||||
Message systemMessage = new SystemMessage(this.qai_system_prompt_template);
|
Message systemMessage = new SystemMessage(this.qai_system_prompt_template);
|
||||||
|
*/
|
||||||
CallResponseSpec resp = chatClient.prompt()
|
CallResponseSpec resp = chatClient.prompt()
|
||||||
.messages(userMessage,systemMessage)
|
.user(this.qai_user_input)
|
||||||
|
.system(this.qai_system_prompt_template)
|
||||||
|
//.messages(userMessage,systemMessage)
|
||||||
.advisors(advisor -> advisor
|
.advisors(advisor -> advisor
|
||||||
.param("chat_memory_conversation_id", this.scenarioExecution.getId()+this.qai_custom_memory_id)
|
.param("chat_memory_conversation_id", this.scenarioExecution.getId()+this.qai_custom_memory_id)
|
||||||
.param("chat_memory_response_size", 100))
|
.param("chat_memory_response_size", 100))
|
||||||
|
|||||||
@@ -57,8 +57,9 @@ public class BasicAIPromptSolver extends StepSolver {
|
|||||||
Message userMessage = new UserMessage(this.qai_user_input);
|
Message userMessage = new UserMessage(this.qai_user_input);
|
||||||
Message systemMessage = new SystemMessage(this.qai_system_prompt_template);
|
Message systemMessage = new SystemMessage(this.qai_system_prompt_template);
|
||||||
|
|
||||||
CallResponseSpec resp = chatClient.prompt()
|
CallResponseSpec resp = chatClient.prompt().user(this.qai_user_input)
|
||||||
.messages(userMessage,systemMessage)
|
.system(this.qai_system_prompt_template)
|
||||||
|
//.messages(userMessage,systemMessage)
|
||||||
.call();
|
.call();
|
||||||
|
|
||||||
String output = resp.content();
|
String output = resp.content();
|
||||||
|
|||||||
Reference in New Issue
Block a user