MCPcopy Create free account
hub / github.com/dot-agent/nextpy / _display_html

Method _display_html

nextpy/ai/engine/_program.py:578–597  ·  view source on GitHub ↗
(self, html)

Source from the content-addressed store, hash-verified

576 self._last_display_update = time.time()
577
578 def _display_html(self, html):
579 from IPython.display import display
580
581 # create the comm object if we don't have one
582 if self._comm is None:
583 self._comm = _utils.JupyterComm(
584 self._id, self._ipython, self._interface_event
585 )
586
587 # dump the html to the front end
588 html = f"""<div id="engine-stop-button-{self._id}" style="cursor: pointer; margin: 0px; display: none; float: right; padding: 3px; border-radius: 4px 4px 4px 4px; border: 0px solid rgba(127, 127, 127, 1); padding-left: 10px; padding-right: 10px; font-size: 13px; background-color: rgba(127, 127, 127, 0.25);">Stop program</div><div id="engine-content-{self._id}">{html}</div>
589<script type="text/javascript">{js_data}; window._engineDisplay("{self._id}");</script>"""
590 display(
591 {"text/html": html},
592 display_id=self._id,
593 raw=True,
594 clear=True,
595 include=["text/html"],
596 )
597 self._displayed = True
598
599 async def execute(self, memory=None, from_agent=False):
600 """Execute the current program.

Callers 2

_ipython_display_Method · 0.95
_update_displayMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected