Skip to content

Conversation

@ThomasVitale
Copy link
Contributor

@ThomasVitale ThomasVitale commented Sep 9, 2025

In alignment with SystemMessage and UserMessage, introduced a builder for AssistantMessage to simplify instantiation considering the many arguments currently needed by the constructors.

Introduced missing tests for AssistantMessage.

@ThomasVitale ThomasVitale force-pushed the gh-add-builder-for-assistant-message branch from eb364dc to 6994a56 Compare September 9, 2025 21:20
@ilayaperumalg ilayaperumalg self-assigned this Sep 10, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M2 milestone Sep 10, 2025
protected final List<Media> media;

public AssistantMessage(String content) {
this(content, Map.of());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThomasVitale What do you think about deprecating this public usage as well - in favour of the builder? This way, new instance of AssistantMessage can only be created via builder only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be fine by me. I know that for UserMessage and SystemMessage we opted for keeping the 1-argument constructor for convenience, and forcing the Builder for any other use cases where more than one argument needs to be provided. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. That's a good point. I like the convenience aspect as well. We can keep the single argument constructor for AssistantMessage as well.

@ilayaperumalg
Copy link
Member

@ThomasVitale Thanks for the PR!

@ilayaperumalg
Copy link
Member

Rebased and merged as f4a1c96

@ThomasVitale
Copy link
Contributor Author

@ilayaperumalg thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants