withUpdatedMessages

Creates a copy of the Prompt with updated messages, allowing modifications to the current messages.

Return

A new Prompt instance with the modified list of messages.

Parameters

update

A lambda function that operates on a mutable list of Message to apply modifications.