The complex constructor in AbstractMessage has been simplified and the AbstractMessageBuilder class has been added for flexible extension.

  • Added AbstractMessageBuilder
  • Applied AbstractMessageBuilder for
  • ChatMessage
  • SystemMessage
  • FunctionMessage
  • UserMessage
  • AssistantMessage
  • Modified files that have a dependency relationship with Message

408

Comment From: markpollack

With 3 arguments, not sure how much value there is to having the builder. Also, the design pattern to follow that is consistent with the spring ecosystem is to have the Builder class be internal to the product class itself. I'm going to create an issue, in a way related to the similar options PR you made to discuss how to approach.

Comment From: markpollack

Closing the PR as we got to it late and needs more design discussion. opened https://github.com/spring-projects/spring-ai/issues/1594