aws-samples / amazon-bedrock-workshop

This is a workshop designed for Amazon Bedrock a foundational model service.
https://catalog.us-east-1.prod.workshops.aws/workshops/a4bdb007-5600-4368-81c5-ff5b4154f518/en-US/20-intro
MIT No Attribution
1.42k stars 607 forks source link

The generated code now is printed without truncation in the output #260

Closed sambit19 closed 3 months ago

sambit19 commented 4 months ago

Issue #, if available: The existing code asked user to copy the output to a text editor to view it as it was trunctaed in the cell output of the notebook

Description of changes: Added the display_markdown() from IPython.display so that the output is displayed in the cell output and user does not have to copy the output. In the workshops this is usually a question from the participants. Hence making the change

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

sambit19 commented 4 months ago

Previous output

image

With PR merge the output will look like

image

Changes performed

The following import has been added to the cell from IPython.display import clear_output, display, display_markdown, Markdown

Instead of printing response_body directly, now it is passed to the method display_markdown()