I am trying to use Advisors in a Spring Boot app using Spring AI and Ollama, but cant get it working. Tried adding SimpleLoggerAdvisor and also a custom one(LoggingAdvisor) which I created.
Relevant code copied below
this.chatClient = chatClientBuilder
.defaultAdvisors(new SimpleLoggerAdvisor(),new LoggingAdvisor())
.build();
Prompt prompt = new Prompt(List.of(systemMessage,userMessage));
Generation result = this.chatClient.prompt(prompt)
.call()
.chatResponse()
.getResult();
<spring-ai.version>1.0.0-SNAPSHOT</spring-ai.version>
Although integration with Ollama is working fine, advisors are not getting called. Logs are not coming despite setting the log level to debug.
Also control is not coming while debugging.
Feels like I am missing something here. Can someone help me on this.