FEAT: Add support for safe image outputs in console printer, file output in markdown printer#1659
Open
fdubut wants to merge 9 commits intomicrosoft:mainfrom
Open
FEAT: Add support for safe image outputs in console printer, file output in markdown printer#1659fdubut wants to merge 9 commits intomicrosoft:mainfrom
fdubut wants to merge 9 commits intomicrosoft:mainfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
romanlutz
reviewed
Apr 27, 2026
Comment on lines
+54
to
+60
| if safe_outputs: | ||
| new_width = int(image.width * 0.5) | ||
| new_height = int(image.height * 0.5) | ||
| image = image.resize((new_width, new_height), Image.Resampling.LANCZOS) | ||
|
|
||
| image = ImageEnhance.Color(image).enhance(0.0) | ||
| image = image.rotate(90.0, expand=True, fillcolor=(255, 255, 255)) |
Contributor
There was a problem hiding this comment.
Why the rotation and the other changes? Blurring seems more appropriate?
romanlutz
reviewed
Apr 27, 2026
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| async def display_image_response(response_piece: MessagePiece, safe_outputs: bool = False) -> None: |
Contributor
There was a problem hiding this comment.
"safe" implies that we hide only unsafe ones. Maybe hide_outputs or blur_outputs or similar would be preferable? Also, this only applies to images, not all outputs.
I also don't want to turn this on in our example notebooks because the entire point is to illustrate how the package works. We can show it in one of them, of course.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
safe_outputsin the constructor, defaults toFalse(no breaking change).Tests and Documentation
display_response(for console printer).