Skip to content

Conversation

@ranjitm2001
Copy link

Summary

This PR adds DEBUG level logging to the before() and after() methods of the following BaseAdvisor implementations:

  • QuestionAnswerAdvisor
  • VectorStoreChatMemoryAdvisor
  • MessageChatMemoryAdvisor
  • RetrievalAugmentationAdvisor

Changes

Each advisor now logs:

  • In before(): The incoming query/request, number of documents retrieved, and any augmentation applied
  • In after(): Processing of the response and any metadata added

Example Log Output

DEBUG [QuestionAnswerAdvisor] before: userQuery='What is Spring AI?'
DEBUG [QuestionAnswerAdvisor] before: retrieved 5 documents from vector store
DEBUG [QuestionAnswerAdvisor] before: augmented user message with 1234 characters of context
DEBUG [QuestionAnswerAdvisor] after: processing response
DEBUG [QuestionAnswerAdvisor] after: added retrieved documents metadata to response

Testing

  • All existing tests pass
  • Logging follows the same pattern as PromptChatMemoryAdvisor which already has logging

Closes gh-3587

Add DEBUG level logging to the before() and after() methods of:
- QuestionAnswerAdvisor
- VectorStoreChatMemoryAdvisor
- MessageChatMemoryAdvisor
- RetrievalAugmentationAdvisor

This helps with debugging and understanding the flow of advisor
invocations during chat client operations.

Closes spring-projectsgh-3587

Signed-off-by: Ranjith Muniyappa <rmuniyappa@tekion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Most of classes implementing BaseAdvisor lacks logs

1 participant