spring-projects / spring-ai

An Application Framework for AI Engineering
https://docs.spring.io/spring-ai/reference/index.html
Apache License 2.0
3.33k stars 858 forks source link

Do not add empty user text on chat memory #1708

Closed DHKIM-0511 closed 2 weeks ago

DHKIM-0511 commented 2 weeks ago

close https://github.com/spring-projects/spring-ai/issues/1601

someone did not want add empty user text on chat memory

so, I fix chat advisor to not add message when user text is empty

ThomasVitale commented 2 weeks ago

Thanks for submitting this PR! This shouldn't be needed anymore since we introduced null-safety for ChatClient and Advisor APIs, and removed the default empty user text. The user message is now required and it will never be null or empty in the context of an Advisor.

DHKIM-0511 commented 2 weeks ago

Thanks for submitting this PR! This shouldn't be needed anymore since we introduced null-safety for ChatClient and Advisor APIs, and removed the default empty user text. The user message is now required and it will never be null or empty in the context of an Advisor.

Oh, I see. I'm also curious about other possible solutions—would it be possible to check the commit history to see how it was implemented? Thanks for your kind response!

ThomasVitale commented 2 weeks ago

Yes, of course! Most changes are in this PR: https://github.com/spring-projects/spring-ai/pull/1651

ThomasVitale commented 2 weeks ago

@DHKIM-0511 we have an open discussion about making the logic of identifying a user message more flexible, while still ensuring internal consistency. If you have some use cases or ideas related to that, feel free to share them in https://github.com/spring-projects/spring-ai/issues/1665 Thanks!

DHKIM-0511 commented 2 weeks ago

Looking at the PR. I understand now that the feature is no longer needed. I’ll also consider the issue https://github.com/spring-projects/spring-ai/issues/1665. Thanks!