Display the multi-modal output from the agent.
(output)
| 62 | return read_signed_url |
| 63 | |
| 64 | def show_output(output): |
| 65 | """Display the multi-modal output from the agent.""" |
| 66 | UUID_PATTERN = re.compile( |
| 67 | r"([0-9A-Za-z]{8}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{4}-[0-9A-Za-z]{12})" |
| 68 | ) |
| 69 | |
| 70 | outputs = UUID_PATTERN.split(output) |
| 71 | outputs = [re.sub(r"^\W+", "", el) for el in outputs] # Clean trailing and leading non-word characters |
| 72 | |
| 73 | for output in outputs: |
| 74 | maybe_block_id = UUID_PATTERN.search(output) |
| 75 | if maybe_block_id: |
| 76 | display(Image(Block.get(Steamship(), _id=maybe_block_id.group()).raw())) |
| 77 | else: |
| 78 | print(output, end="\n\n") |
| 79 | |
| 80 | def build_tool(config) -> Tool: |
| 81 | tool = Tool( |