MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / show_output

Function show_output

bmtools/tools/image_generation/api.py:64–78  ·  view source on GitHub ↗

Display the multi-modal output from the agent.

(output)

Source from the content-addressed store, hash-verified

62 return read_signed_url
63
64def 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
80def build_tool(config) -> Tool:
81 tool = Tool(

Callers

nothing calls this directly

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected