trim and remove stop-suffixes from summary (#369)
The chat generation removes parameters.stop and <|endoftext|>
from the generated text. And additionally trims trailing whitespace.
This PR copies that behavior to the summarize functionality, when the
summary is produced by a the chat model.